|
|
JimV
Responsible
Supreme Hero
|
posted January 23, 2012 02:55 PM |
|
|
Quote: The object is visitable and the coordinates should be right - horizontal: 8 and vertical: 6 yeah, the yellow square. Here is the code i used:
ZVSE
!?OB8/6/0;
!!IF:M^{You gaze upon the small cottage for one last time.}^;
The script looks correct to me (for the yellow square at 8/6/0). (Although the {} brackets stop producing gold characters at a new line so you may need to put them around each word.) Another possibility is that the object itself is a new one, or "mod", and it has an error in its object definition (in the text files which are used to define objects). If this is the case, replacing it with some standard object (such as a Knowledge Tree) will make the script work, and you will know the problem is in the object not in the script.
Basically, you must keep trying different things until something works, and then try to figure out a mental model for when it will and will not work, to use in the future - with the mental model always subject to revision due to new data, as in the case of my yellow-square model. This is how the scientific method works, so you will be practicing science.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted January 23, 2012 04:32 PM |
|
|
Does anyone know how it is coded the external dwellings growth dependence? For instance, if the town is castle at start of the game, and later we change its type to inferno, it does not count the owned external dwellings. But will count the ones we flag after the town type was modified.
It recalls me the monoliths problem. We can place them and enter, but if one is placed during game, none of other monoliths will send to it. Seems there is some needed data at start of the game.
____________
Era II mods and utilities
|
|
solitaire345
Promising
Famous Hero
|
posted January 23, 2012 04:51 PM |
|
|
I guess there's some value that stores amount of growth bonus from dwellings.
I think running through all dwellings and if they are inferno dwellings and are owned by player who changed the town to inferno change their owner to neutral and back could do the job (however this would slow down the game if there are many dwellings on the map or town types are changed often)
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted January 23, 2012 05:46 PM |
|
|
Thanks, but does not work. Set them to -1 then back to human owner, nothing changes in growth.
____________
Era II mods and utilities
|
|
greendrag
Bad-mannered
Adventuring Hero
young dragon,changed
|
posted January 24, 2012 09:01 AM |
|
|
Quote: !?OB6/8/0, try this.
This worked, thank you! ;D
The object was one of the new house buildings in the Towns section.
I'll continue experimenting with different codes too, just like JimV said, I'm really glad for the help. ^^
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted January 24, 2012 11:37 AM |
|
|
|
tryphone
Tavern Dweller
|
posted January 25, 2012 11:42 AM |
|
|
Unequip an artifact to an AI Hero
Hi,
in the map i'm creating i need the AI to equip some artifact. Unfortunately, the AI logic for equipping the artifact is somewhat strange. I would like to force equipping it via ERM.
The ERM help says that i can equip an artifact only if the slot is free, otherwise it will be put in the backpack. And i found nothing in the help about unequipping an artifact.
Is there any workaround to do this? I'm a programmer and i have practice with ERM.
Thank you very much
Roberto
|
|
solitaire345
Promising
Famous Hero
|
posted January 25, 2012 02:07 PM |
|
|
Use the same command as for equipping, just put negative number of artifact.
For example:
!!HE-1:A-7; remove centaur's axe from current hero.
Another possible way is HE:A3 (if you need to remove several artifacts of the same type), but id doesn't work ok for combo artifacts and it doesn't remove bonuses.
|
|
tryphone
Tavern Dweller
|
posted January 25, 2012 02:44 PM |
|
|
Quote: Use the same command as for equipping, just put negative number of artifact.
For example:
!!HE-1:A-7; remove centaur's axe from current hero.
Another possible way is HE:A3 (if you need to remove several artifacts of the same type), but id doesn't work ok for combo artifacts and it doesn't remove bonuses.
Thank you, but i don't know the artifact to unequip.
I mean, i need to equip an artifact, and if the slot is busy i want to unequip the artifact in that slot.. do you think there's a way to do it?
Thank you in advance
|
|
JimV
Responsible
Supreme Hero
|
posted January 25, 2012 03:49 PM |
|
|
From ERM Help:
A1/$1/$2 - Equip an artifact
$1 - number of artifact. (see Format A1).
$2 - position on the body where to place (see Format AP).
Use this command to "get" ($1 = ?variable) the number of an artifact at a given location. (As explained in ERM Help, the $ syntax means that you can "get" as well as set a parameter - although there are a few places where this syntax is not used correctly.)
See my script "Dress Code" in "The Dragon Slaughter v2.07J" or "JV_WoG_Scripts" for an example. This script allows a player to record (and later equip) two sets of owned artifacts, one for "day" and one for "night". That is, a Hero might wear artifacts for battle during the day, and artifacts that generate resources or mana or movement points during the night. To do this I "get" all the equipped artifacts a Hero has and the locations where they are equipped.
|
|
tryphone
Tavern Dweller
|
posted January 25, 2012 04:03 PM |
|
|
Quote: From ERM Help:
A1/$1/$2 - Equip an artifact
$1 - number of artifact. (see Format A1).
$2 - position on the body where to place (see Format AP).
Use this command to "get" ($1 = ?variable) the number of an artifact at a given location. (As explained in ERM Help, the $ syntax means that you can "get" as well as set a parameter - although there are a few places where this syntax is not used correctly.)
See my script "Dress Code" in "The Dragon Slaughter v2.07J" or "JV_WoG_Scripts" for an example. This script allows a player to record (and later equip) two sets of owned artifacts, one for "day" and one for "night". That is, a Hero might wear artifacts for battle during the day, and artifacts that generate resources or mana or movement points during the night. To do this I "get" all the equipped artifacts a Hero has and the locations where they are equipped.
Thank you JimV, i understand the logic you suggest. It's a good idea, i will do it
|
|
tryphone
Tavern Dweller
|
posted January 25, 2012 06:21 PM |
|
|
I need help with another issue.
There is a way to let level 8 creatures accumulating over weeks in castles? Even if it can be accumulated in the dwellings it would be good. Because i need to avoid that each lvl8 creature not bought in a week is lost
thank you
|
|
JimV
Responsible
Supreme Hero
|
posted January 25, 2012 06:41 PM |
|
Edited by JimV at 18:44, 25 Jan 2012.
|
As far as I know, Level 8 creatures do accumulate in Towns - but they can only be bought one at a time. After buying one, check again and another one will still be available after a week of not buying one. (This can be seen in "The Dragon Slaughter", for example.)
There is a WoG script for letting creatures accumulate in Dwellings. I believe that it will work for Level 8 Dwellings provided that you select the feature that Level 8's are not bought in Towns.
(TDS uses that script, so maybe L8's only accumulate in Towns when that script is active - but for sure they can only be bought one at a time.)
|
|
solitaire345
Promising
Famous Hero
|
posted January 25, 2012 06:54 PM |
|
|
Quote:
There is a WoG script for letting creatures accumulate in Dwellings. I believe that it will work for Level 8 Dwellings provided that you select the feature that Level 8's are not bought in Towns.
It's not a script, but a hard-coded option and lvl8 accumulation is disabled somewhere in the exe, though it can probably be enabled with UN:C.
|
|
JimV
Responsible
Supreme Hero
|
posted January 25, 2012 09:07 PM |
|
Edited by JimV at 15:05, 26 Jan 2012.
|
Solitaire is of course correct, and I am sorry for my misinformation. The case I was thinking of was when a player has several Level 8 Dwellings flagged, and can recruit one creature for each one in a Town, but only one at a time.
Level 8 Dwellings could be re-stocked by an ERM script, similar to the WoG scripts which increase neutral bands or re-stock Creature Banks, using the !?TM and !!DW commands, and the post-visit !$OB trigger to record when a Level 8 creature was last bought in a particular dwelling, saved in a !!PO value.
Update: here is a sample, tested script:
ZVSE
* TestLevel8DwAcc, JHV, Jan. 25, 2011
* Accumulate Creatures in Level 8 Dwellings (Types 17/80-17/88)
!#UN:P1; set Level 8 standard dwelling behavior
!?OB17; visit to type 17 Object
!!OBv998/v999/v1000:U?y1; get subtype
!!FU|y1<80/y1>88:E; do only subtypes 80-88
!!DWv998/v999/v1000:O?y1;
!!FU&y1=-1:E; skip accumulation if not owned
!!PO998:V2/?y2 V3/?y3; get week and count at last visit
!!VRy4:Sc0-1:7+1; current week (first week is week 1)
!!VRy4:-y2; current week-last visit
!!VRy3:+y4; accumulate count
!!DWv998/v999/v1000:M0/d/y3; set accumulated count
!$OB17; post-visit to type 17 Object
!!OBv998/v999/v1000:U?y1; get subtype
!!FU|y1<80/y1>88:E; do only subtypes 80-88
!!VRy3:Sc0-1:7+1; current week
!!DWv998/v999/v1000:M0/d/?y4; get count
!!PO998:V2/y3 V3/y4; save week and count
Edit - found a glitch, and added an ownership test.
|
|
tryphone
Tavern Dweller
|
posted January 27, 2012 12:37 PM |
|
|
hi Solitaire and JimV, and thanks for the answer
some things are still not clear to me and i kindly ask you about that..
1) so as far as i understand if i want lvl8 accumulation in town there's nothing i should do as it's already enabled. Correct?
2) i've read your script and i found the !!DW and !!UN:C with i have no information at all in my ERM help! I've 3.58F ERM version, where did you find info for that triggers? Maybe there is a newer version of help?
3) i didn't clearly understand what do you mean for re-stock. If i wish to make lvl8 act as normal i expected they accumulate creatures regardless of ownership.. the new owner will find the creatures that were not been hired from previous owner..
thank you for the answer, you two are very competent and fast
|
|
JimV
Responsible
Supreme Hero
|
posted January 27, 2012 02:43 PM |
|
Edited by JimV at 14:47, 27 Jan 2012.
|
Solitaire's answer is correct - my first answer was mistaken. See my second response (updated) for a script which will make Level 8 creatures accumulate in external dwellings.
The !!DW command is under a clickable icon called "Other Objects", on the top right of the screen in the ERM 3.58f Help. The UN:C command was not in the original version of that document but was added in an update available here: http://www.box.com/s/nv038pb3shsgnsuuum5a - but you need to know internal addresses for the Heroes 3/WoG program to use it.
Solitaire has updated the ERM Help for WoG 3.59 (which is the basis of Era). See Bersy's last post on this thread for a download link.
P.S. About ownership - in my first version of the Level 8 Dwelling script, creatures accumulated from week 1. In the updated version, they only start to accumulate once a player has flagged them. But don't take my word for it - try it in a test map and see what happens.
|
|
WanderingHero
Tavern Dweller
|
posted January 27, 2012 04:01 PM |
|
|
thank you JimV, now i understood and i'll go to update my ERM help. I've also read your script, and i need to accumulate creature from week 1, regardless of being flagged or not could you post your first script? Also when i have time i'll test it for it (and eventually correct it) and report here. Thank you again
|
|
WanderingHero
Tavern Dweller
|
posted January 27, 2012 04:04 PM |
|
|
sorry double account:
WanderingHero == Tryphone
|
|
JimV
Responsible
Supreme Hero
|
posted January 27, 2012 06:03 PM |
|
|
WH/TP: if you remove the two lines below from the !?OB trigger, the script should accumulate from the first week, i.e., have 1 creature the first week, two the second week, etc., unless a player buys a creature in the first week. In other words, the number of creatures in a dwelling will be the week number (which starts at 1) minus the number of creatures previously bought at that dwelling. In the posted version, it would be the number of the current week minus the number of the week when the dwelling was first flagged, plus one, minus the number of creatures previously bought.
!!DWv998/v999/v1000:O?y1;
!!FU&y1=-1:E; skip accumulation if not owned
As I said, I have tested this in a test map, but perhaps my test conditions will not match yours. In particular, if you use another script which sets PO:V values, there may be an interference. We have a saying, "trust, but verify". I never liked that saying much, but maybe it applies here.
|
|
|