|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted March 20, 2009 03:37 PM |
|
|
From ERM:
How to check if the AI visits an object
When any hero visits an object the AI flag is stored in flag1000. Flag 1000 is set to True for a human player and False for the AI. So you can use it like this:
!?OB...;
!!IF&1000:M^Player^;
!!IF&-1000:M^AI^;
Use &1000 at the end of the object trigger.
!?OBx/l/I&1000;
Or do a check if the visitor is AI of human and if AI, change object to learning stone temporary (see Choices map by Fnord)
____________
Era II mods and utilities
|
|
Ayreon
Famous Hero
|
posted March 20, 2009 05:28 PM |
|
Edited by Ayreon at 17:28, 20 Mar 2009.
|
Thanks for that, but it doesn't really work as I wanted it to work. Can you discover the flaw?
ZVSE
!#OB4/2/0:S;
!#IF:V11/0;
!#VRz123:S^Haunted Guardhouse^;
!#OB4/2/0:H123;
!#VRv10:S0T3;
!#VRv10:+4;
!#VRv10:*3;
!?OB4/2/0;
!!IF&1000:M^Player^;
!!IF&-1000:M^AI^;
!?OB4/2/0&11;
!!IF&1000:M^The Guardhouse is empty and deserted. There are no pikemen to recruit.^;
!?OB4/2/0&-11;
!!IF&1000:Q10^The Guardhouse does not look odd from the outside. Do you want to enter?^;
!!HE-1&10?v5;
!!HE-1&10:T4/2/0/159/v10;
!!HE-1&10?v100;
!!OW&10/v5=v100:R-1/5/?v15;
!#VRv15:+5;
!!OW&10/v5=v100:R-1/6/?v16;
!#VRv16:+10000;
!!IF&10/v5=v100:V11/1;
!!IF&11&1000:Q1/5/10/6/5000/1^You have won the battle with %V10 Ghosts and received:^;
!!VRz123&11:S^Guardhouse^;
!!OB52/5/0&11:Hz123;
I have the feeling this disables the entire building for the AI...
And any tips about the reward thing? (in green)
|
|
sagamosa
Hired Hero
|
posted March 20, 2009 05:44 PM |
|
|
what do you want to achieve?
____________
Sagamosa
[url=http://www.wog.euweb.cz]Advanced Levels[/url]
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted March 20, 2009 06:14 PM |
|
|
You should write **comments at the end of each line to explain what you were trying to do, so it would be easier to help you without checking the whole code to identify variables.
If you want to reward the hero for killing the creatures, you don't need to store in v16 his gold.
Only check if the hero is still alive after the battle, and then use OW followed by the "hero alive" variable v5=v100;
You should also use a flag set to true (1) if battle was won, give reward(with true flag) and then reset that flag to 0 immediately, to prohibit another reward if object is revisited.
!!FU&v5<>v100:E; if the hero was killed exit further commands
!!HE-1&v5=v100:V12/1; **if the current hero is alive set flag 12 to true
!!OW&12/v5=v100:R-1/6/d10000; *if the current hero is alive after battle and flag 12 is true, give him 10000 gold
!!IF:V12/0; **reset the flag so the reward does not come again
If that was what you wanted, but I am not sure.
Here should be
!#OB4/2/0:H123; (change H123 to Hz123). Better to put also a S before to disable the original object:
!#OB4/2/0:SHz123;
Welcome to the tricky ERM. Headache guaranteed at start.
____________
Era II mods and utilities
|
|
Ayreon
Famous Hero
|
posted March 22, 2009 06:00 PM |
|
|
Quote:
!!HE-1&v5=v100:V12/1; **if the current hero is alive set flag 12 to true
Ok, next time I will use comments
The quoted piece of code is not understood by WoG. It gives errors and stuff. I tried to experiment a little there, but no success. Is my WoG out of date?
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted March 22, 2009 06:04 PM |
|
|
Of course it does not work. The one who gived you this code should never use ERM and start again to learn it. Damnt beginners :P
Use this and I apologize: (instead of !!HE...
!!IF&v5=v100:V12/1;
____________
Era II mods and utilities
|
|
Ayreon
Famous Hero
|
posted March 22, 2009 07:52 PM |
|
|
Haha
Thank you, it's working now
|
|
Ednaguy
Supreme Hero
My water just broke! No, wait.
|
posted March 25, 2009 04:44 PM |
|
|
Does anybody know if/where I can download Erm Script Master? I've done several searches for it, and I can't find a working link anywhere
____________
"Edna, there's a special, tiny, tiny place in hell, waiting just for you... "
|
|
Nostrazugus
Hired Hero
French guy who learn
|
posted March 25, 2009 04:49 PM |
|
|
I downloaded it on the [url=http://wakeofthegods.strategyplanet.gamespy.com/download.shtml]old Wog website[/url]
put the erm_tools.wog file in your UPDATE folder and launch H3wUpd.exe
____________
Learning ERM, starting to mapmaking, after more than ten years of HoMM playing
|
|
Ednaguy
Supreme Hero
My water just broke! No, wait.
|
posted March 25, 2009 05:39 PM |
|
|
Thank you
____________
"Edna, there's a special, tiny, tiny place in hell, waiting just for you... "
|
|
Sethiel
Tavern Dweller
|
posted March 27, 2009 02:07 PM |
|
|
Hi guys, I'm not allowed to make my own thread, so I can only hope I'm not too OT.
My question is - how do I change the price of buildings?
I noticed that the game is much more interesting if you don't have enough resources. That fact, plus the fact that the handicap is somehow bugged (you're not getting any resource from mines that normally produce 1/day when you set max handicap) made me try to increase the building expenses. It's much better game when the player can't build everything first and then start to fight (with high level monsters).
____________
|
|
kesnar
Famous Hero
from Kesnaria
|
posted March 28, 2009 04:10 PM |
|
|
I will try to learn ERM...
I have downloaded the patch Nostrazugus posted...
I have a noobish question...
Where do you write the code?!?
____________
|
|
Nostrazugus
Hired Hero
French guy who learn
|
posted March 28, 2009 04:30 PM |
|
|
You should have a folder named erm_s in your WoG main folder, with an erm_s.exe where you MUST write any of your erm script. The erm_sm.exe (aka script master) could be use to change your creature, but I never used it; Ask for someone else if you need help with it, even if it doesn't seems to hard to use
____________
Learning ERM, starting to mapmaking, after more than ten years of HoMM playing
|
|
Ayreon
Famous Hero
|
posted March 30, 2009 04:31 PM |
|
|
I want to make a special building now, but how can I make the flag gain the colour of the visited hero?
|
|
Ednaguy
Supreme Hero
My water just broke! No, wait.
|
posted March 30, 2009 05:24 PM |
|
Edited by Ednaguy at 17:25, 30 Mar 2009.
|
!!HE-1:O?v99; (Stores vising hero's owner in variable v99) perhaps? :)
____________
"Edna, there's a special, tiny, tiny place in hell, waiting just for you... "
|
|
Ayreon
Famous Hero
|
posted March 30, 2009 05:46 PM |
|
|
Tried that already, doesn't work. Any other suggestions?
|
|
Nostrazugus
Hired Hero
French guy who learn
|
posted March 30, 2009 08:31 PM |
|
|
Sorry for the off-topic, but, i find it better than creating a new thread.
Is there an uptaded thread about WoG scripts that anyone can use ?
I mean, ones of Sagammosa are great, but the common players can't use it.
I'm searching for some new features, or modified WoG features which allow me to enhanced games
(If moderator thinks this reply should'nt be here, then, I may make a new thread )
____________
Learning ERM, starting to mapmaking, after more than ten years of HoMM playing
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted March 30, 2009 08:32 PM |
|
|
@Ayeron
What kind of building it is? If it is a normal dwelling which you had to disable for doing a custom battle, just enable it post visit again with !$OB/x/l/y:E#; #=player color.
@Nostrazugus:
Thats not the way it works. You have to play WoG maps and choose the scripts you like, then import them in your maps. Once you get familiar with them, you will add some personal adds, then improve them. ERM is very long to learn if you are not a programmer.
____________
Era II mods and utilities
|
|
WoGFan
Tavern Dweller
|
posted March 31, 2009 01:58 PM |
|
|
Hi all,
i have a few questions about ERM:
- Map Editor has a limit for maximum amount of dwelling which could be put into a map. I override this limit placing dwelling after map creation with ERM. Did somebody experience any problem for it?
- Suppose i wish to give to a player a weekly growth of 100 liches for its castles. I found that with the UN:I command you could put objects where is not normally possible, even 2 object in a square. If i put 100 lich dwelling in a square assigning the player as owner, it will works or there's a simpler way to do that?
- I want to create an object that makes you battle against some monsters when you enter into it. There's a way for letting the AI estimate if it is convenient to enter for him according to its army?
Thanks to all
|
|
Nostrazugus
Hired Hero
French guy who learn
|
posted March 31, 2009 04:27 PM |
|
|
@Salamandre
Okay. Haven't thought about it. Learning ERM doesn't seems to me too hard, thanks to my studies. Should I look on the yahoo group WoGmap archives ? Or is there a better archive/website ?
____________
Learning ERM, starting to mapmaking, after more than ten years of HoMM playing
|
|
|