|
|
JimV
Responsible
Supreme Hero
|
posted September 25, 2012 05:58 PM |
|
Edited by JimV at 18:55, 25 Sep 2012.
|
I haven't checked your script because by the time I did and figured out what you were trying to do, you will have fixed it yourself, but I have a quick comment:
Artifact Merchants will buy artifacts (and Altars of Sacrifice will give experience for them to certain factions - which I believe has been expanded to all factions in an ERM script somewhere, or if not could be) - so there are already ways to get get rid of artifacts - although not for mithril. The Artificier script is a fairly complicated script. It might be easier to add a mithril option to Altars of Sacrifice (or Black Markets).
Of course, once a script has been started, one wants to complete it, so I expect you will.
P.S. I just noticed your comment about exiting the function. Note that to exit a function called by a DO (completely, without continuing to process x16 values), you must set x16 to a value greater than or equal to the DO limit.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted September 25, 2012 06:06 PM |
|
|
Yes I know that, but those random maps have the bad habit to totally ignore the sacrificial altair, they just don't place it. And if we play with "pick double artefact" option, we end with thousand of them in a few weeks. So my first option was the artificer, as there are many of them.
What is artefact merchant? I miss that one.
____________
Era II mods and utilities
|
|
artu
Promising
Undefeatable Hero
My BS sensor is tingling again
|
posted September 25, 2012 06:10 PM |
|
|
the merchants in dungeon, tower and conflux that buy and sell artifacts.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted September 25, 2012 06:15 PM |
|
|
phew, I never noticed that one. I usually buy, didn't notice there is a second option.
____________
Era II mods and utilities
|
|
artu
Promising
Undefeatable Hero
My BS sensor is tingling again
|
posted September 25, 2012 06:43 PM |
|
|
yes, i never noticed for years too till a friend told me.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted September 25, 2012 07:06 PM |
|
|
I fixed x16 still I have one redundant message. It exits, goes back to main dialog (FU168) then when "leave this place" I get one more time "what you want today for, mithril or gold". This happens if I cancel trade. Added a lot of checks in DO too, still problem, can't see where.
!?FU168;
!!VRv4118:S2048;
** questions of artificer **
!!IF&1000/v160=1:G1/4118/2048/z126001/z126034/z126035/z126036/z126037/z126047///////z126038;
!!IF&1000/v160=2:G1/4118/2048/z126002/z126034/z126035/z126036/z126037/z126047///////z126038;
!!IF&1000/v160=3:M1/z126012;
!!FU&v4118=2048:E; it should exit here when return, but it runs once more (?)
!!IF&v4118=16:Q1/7/0/6/0/1^Pal! Buddy! Glad to see you! C'mon in, c'mon in! Step into the light where I can see you better! - I buy your useless junk and give you {~Cyan} MITHRIL{~} or {~Gold}GOLD{~} for! What a deal! Let's see whatcha got...^;
!!FU177&v4118=16:P;
** AI = Upgrade **
!!VRv4118&-1000:S1;
!!FU166:P1; [call needed function]
!?FU177;
!!IF:V1/0;
!!VRv44:S0;
!!DO8800/40/44/1&x16<45:P;
!!IF&v44=5:M^You have no artefacts in your backpack, so unless there's something else you want to take off and show me, I guess we won't be doing business today. No hard feelings though - come back anytime!^;
!?FU8800;
!!IF:M^%X16^;
!!VRy1:Sx16-21;
!!HE-1:A1/?y2/y1;
!!VRv44|y2<1/y2>1000:+1; increase v44 if no artefact found in backpack slot
!!FU|y2<1/y2>=1000:E;
!!HE-1:A2/y2/?y3/?y4;
!!UN:Ay2/1/?y5;
!!VRy6:Sy5; set gold
!!VRy5::1000+2; set mithril
!!IF:Q1/7/0/6/0/10^What you want today for, Mithril or Gold?^; I get this once more after leaving the object
!!VRx16&v1=0:S45;
!!if&v1=1:;
!!IF:Q1/8/y2/7/y5/2^I will offer for it...let's say, {%Y5} mithril?^;
!!HE-1&1:A3/y2/1/d-1;
!!OW&1:R-1/7/dy5;
!!en:;
!!if&v1=2:;
!!IF:Q1/8/y2/6/y6/2^I will offer for it...let's say, {%Y6} Gold?^;
!!HE-1&1:A3/y2/1/d-1;
!!OW&1:R-1/6/dy6;
!!en:;
!!IF&1:M^Bwahaha. Everything goes according to my plan. I mean, uh, thanks! Pleasure doing business!^;
!!FU168:P;
____________
Era II mods and utilities
|
|
Hemske
Tavern Dweller
|
posted September 25, 2012 07:38 PM |
|
|
Ill continue my questions about my problems here.
Quote: It runs smoothly and without the "staggering lag" as I changed that line. I do get some error message every time I start a new map though, it is a lot of different numbers and letters and somewhere in the middle of it all it says %%world%%. Anyone know the reason of this? I also get another message stating "ERM has wrong syntax. Disabled."
Quote: Seems that you installed Era on WoG.
I've never had WoG installed before. I only used that Era 2.4 installation from this forum. As long as not someone else have been installed WoG while I'd be at work, I doubt that is the reason.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted September 25, 2012 07:41 PM |
|
|
|
JimV
Responsible
Supreme Hero
|
posted September 25, 2012 07:44 PM |
|
|
Some comments, possibly irrelevant:
Quote: ...
!!FU177&v4118=16:P;
** AI = Upgrade **
!!VRv4118&-1000:S1;
!!FU166:P1; [call needed function]
!?FU177;
!!IF:V1/0;
!!VRv44:S0;
!!DO8800/40/44/1&x16<45:P;
I see some possible confusion there. According to ERM Help, each function has its own separate set of x-variables (the same as for y-variables), and FU177 was not called with a DO, so its x16 should always have the value zero. Only within FU8800 will x16 have the values 40-45 (as the DO is processed).
...
!?FU8800;
!!IF:M^%X16^;
!!VRy1:Sx16-21;
!!HE-1:A1/?y2/y1;
!!VRv44|y2<1/y2>1000:+1; increase v44 if no artefact found in backpack slot
!!FU|y2<1/y2>=1000:E;
!!HE-1:A2/y2/?y3/?y4;
!!UN:Ay2/1/?y5;
!!VRy6:Sy5; set gold
!!VRy5::1000+2; set mithril
!!IF:Q1/7/0/6/0/10^What you want today for, Mithril or Gold?^; I get this once more after leaving the object
!!VRx16&v1=0:S45;
!!if&v1=1:;
!!IF:Q1/8/y2/7/y5/2^I will offer for it...let's say, {%Y5} mithril?^;
!!HE-1&1:A3/y2/1/d-1;
!!OW&1:R-1/7/dy5;
!!en:;
!!if&v1=2:;
!!IF:Q1/8/y2/6/y6/2^I will offer for it...let's say, {%Y6} Gold?^;
!!HE-1&1:A3/y2/1/d-1;
!!OW&1:R-1/6/dy6;
!!en:;
!!IF&1:M^Bwahaha. Everything goes according to my plan. I mean, uh, thanks! Pleasure doing business!^;
!!FU168:P;
Why is FU168 (which calls FU177 which calls FU8800) being called at the end of FU8800? This would restart the whole process, possibly resulting in your extra message. I can't be sure without testing, but this is very complicated code, apt to cause problems.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted September 25, 2012 07:48 PM |
|
|
I added the x16 check to DO only as test, as I was worried why is triggered again after exit. Didn't help. FU168 brings back the main dialog, so we can exit. I also removed that last command, did not help.
Is complicate code because the aritificer script is complicate, it doesn't look handy to me, I was expecting checks on v4118 which open different functions, so I can insert my code there, but no. All the script looks like a big loop between several functions.
____________
Era II mods and utilities
|
|
Hemske
Tavern Dweller
|
posted September 25, 2012 07:48 PM |
|
|
Also, I do not know if it is of any importance, but as I try to install VCMI it states I am missing a file called zelp.txt and I see the help at the developers of VCMI states that file comes from era installation, but apparently it is missing for me. Might that be the reason I am having these issues here?
|
|
Bersy
Honorable
Supreme Hero
|
posted September 25, 2012 07:56 PM |
|
Edited by Bersy at 19:57, 25 Sep 2012.
|
Hemske, you definitely do not have clean Complete. Even scripts differ. Do you have vanilla SoD or Complete? I mean original Heroes 3 disk. Install it from scratch.
|
|
JimV
Responsible
Supreme Hero
|
posted September 25, 2012 08:13 PM |
|
|
Quote: FU168 brings back the main dialog, so we can exit.
Then perhaps it should be called at the end of FU177, or at the end of FU168. Say that FU8800 processes the case of x16=40, then calls FU168. This will re-display the main menu. Suppose the user chooses to continue selling artifacts. Then FU177 will be called, which will call FU8800 again, but starting at the value of x16=40 again. To make this complicated process work without doing x16=40 over and over, it seems to me that x16 must be saved in some v-variable which is used as the lower limit of the DO8800.
Which still may be irrelevant and I probably am not following your logic. All I can say is that for my own mental health I would try to avoid the following type of code:
!?FU168;
...
!!FU177:P;
...
!?FU177;
...
!!DO8800/40/44/1:P:
...
!?FU8800;
...
!!FU168:P;
|
|
Hemske
Tavern Dweller
|
posted September 25, 2012 08:21 PM |
|
|
Bersy, Damn. No idea where this HoMM is from, been on my computer forever. I know I got an original disc for it somewhere however, but it could be like a needle in a haystack. I suppose my problems would be over if I get a clean HoMM of the sound of it, I'll have to hear with any of my friends if they might got a CD. Thanks for the help, I'll get back here if it won't work.
|
|
JimV
Responsible
Supreme Hero
|
posted September 25, 2012 08:34 PM |
|
|
Quote: I know I got an original disc for it somewhere however, but it could be like a needle in a haystack.
This is why I recommend (at the Era 2 thread, which is where Era installation problems should be discussed) making a copy of the entire Heroes 3 game folder before installing Era.
However, as a note that is slightly on-topic here, the variables v2777 and v2778 in the error message are Unclaimed variables from some custom script, so the problem could be due to the specific WoG map which you are trying to run. Try a standard H3 map, without wogification, and if you still have a problem, report it at the Era 2 thread. (People who don't read this thread may have had a similar problem with Era installation and would be more likely to read the Era thread and reply there.)
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted September 25, 2012 09:07 PM |
|
|
Yeah, that script is unnecessary crowded, was a bad idea to touch the artificer. Thanks for help anyway, much appreciated.
@Hemske, my Heroes CD stopped working years ago, but I still have it. When I need Heroes I just search on net and I find some link in a few minutes.
____________
Era II mods and utilities
|
|
JimV
Responsible
Supreme Hero
|
posted September 25, 2012 09:25 PM |
|
Edited by JimV at 21:27, 25 Sep 2012.
|
Removing the end call to FU168 seems to work on my system under WoG 3.58f (I replaced WoG 3.59 instructions with WoG 3.58f code):
!?FU168;
!!VRv4118:S2048;
** questions of artificer **
!!VRz-1:S^Sell Artifacts^;
!!IF&1000/v160=1:G1/4118/2048/z126001/z126034/z126035/z126036/z126037/z-1///////z126038;
!!IF&1000/v160=2:G1/4118/2048/z126002/z126034/z126035/z126036/z126037/z-1///////z126038;
!!IF&1000/v160=3:M1/z126012;
!!FU&v4118=2048:E; it should exit here when return, but it runs once more (?)[not for me, with this version--JV]
!!IF&v4118=16:Q1/7/0/6/0/1^I will buy your unwanted artifacts and give you {Mithril} or {Gold} for them! First, show me your first five backpack slots.^;
!!FU177&v4118=16:P;
** AI = Upgrade **
!!VRv4118&-1000:S1;
!!FU166:P1; [call needed function]
!?FU177;
!!IF:V1/0;
!!VRv44:S0;
!!DO8800/40/44/1:P;
!!IF&v44=5:M^You have no artifacts in your backpack, so unless there's something you want to unequip, I guess we won't be doing business today. No hard feelings though - come back anytime!^;
!?FU8800;
!!VRy1:Sx16-21;
!!HE-1:A1/?y2/y1;
!!VRv44|y2<1/y2>1000:+1; increase v44 if no artifact found in backpack slot
!!FU|y2<1/y2>=1000:E;
!!HE-1:A2/y2/?y3/?y4;
!!UN:Ay2/1/?y5;
!!VRy6:Sy5; set gold
!!VRy5::1000+2; set mithril
!!IF:Q1/7/0/6/0/10^What do you want, Mithril or Gold?^; I get this once more after leaving the object [I don't--JV]
!!VRx16&v1=0:S45;
!!IF&v1=1:Q1/8/y2/7/y5/2^I will offer for it...let's say, {%Y5} mithril?^;
!!HE-1&v1=1/1:A3/y2/1/d-1;
!!OW&v1=1/1:R-1/7/dy5;
!!IF&v1=2:Q1/8/y2/6/y6/2^I will offer for it...let's say, {%Y6} Gold?^;
!!HE-1&v1=2/1:A3/y2/1/d-1;
!!OW&v1=2/1:R-1/6/dy6;
Results: I sold five artifacts to the Artificer successfully, and at the end returned to the main menu, pressed Enter to exit, and exited without any additional message. There is another call to FU168 at the end of the AI work, which produces the last main menu.
Notes: artefact is the British spelling, and artifact is the American/Canadian spelling. The rest of the script uses "artifact" (on my system) so I changed to that to be consistent. Also, if the Artificer is "tired" the script will not allow the player to sell artifacts.
Edit - meant to say "will not allow" in last sentence, fixed.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted September 25, 2012 09:28 PM |
|
|
Thanks, I have same problem, steps:
1) go until it shows artefact picture and price on right. At that moment, cancel. The previous question will be back, instead of exiting...
____________
Era II mods and utilities
|
|
JimV
Responsible
Supreme Hero
|
posted September 25, 2012 11:04 PM |
|
|
That is what it is scripted to do. If you cancel when it asks "Gold or Mithril?", x16 will be set to 45 and the next screen will be the main menu, where you can exit. If you cancel out of the offered price, though, x16 is not set to 45 and the DO continues, offering a price for the next artifact slot. So for example, you could refuse to sell the Titan's Gladius in slot 19, but agree to sell the Sentinel's Shield in slot 20. That seems to me to be workable, although it might be preferable to the player to first show the artifact and ask whether the player wants to sell it, rather than asking "Mithril or Gold?" first.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted September 25, 2012 11:07 PM |
|
|
Very good idea, thanks.
ok, final version working:
*mithril/gold prices will show on first dialog, as well as art graphic
*name of artefact added
*x16=45 removed, to allow loop through all slots, no matter if cancel one item.
!?FU8800;
!!VRy1:Sx16-21;
!!HE-1:A1/?y2/y1;
!!VRv44|y2<1/y2>1000:+1; increase v44 if no artifact found in backpack slot
!!FU|y2<1/y2>=1000:E;
!!HE-1:A2/y2/?y3/?y4;
!!UN:Ay2/1/?y5;
!!VRy6:Sy5; set gold
!!VRy5::1000+2; set mithril
!!UN:N0/z1/y2;
!!IF:Q1/7/y5/6/y6/8/y2/10^What do you want for the %Z1, Mithril or Gold?^;
!!if&v1=1:;
!!IF:Q1/8/y2/7/y5/2^Confirm selling the %Z1 for {%Y5} mithril?^;
!!HE-1&1:A3/y2/1/d-1;
!!OW&1:R-1/7/dy5;
!!en:;
!!if&v1=2:;
!!IF:Q1/8/y2/6/y6/2^Confirm selling the %Z1 for {%Y6} Gold?^;
!!HE-1&1:A3/y2/1/d-1;
!!OW&1:R-1/6/dy6;
!!en:;
____________
Era II mods and utilities
|
|
|
|