thinking about petrify
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: thinking about petrify
The problem is, none of the code you are using does exactly what you want, so you have to modify it. In order to do that, you need to understand what it's doing. I think you are typing random things and hoping for the best, which almost never works. (You invented
$this_unit[$i]
for example.) This is why I told you to read through the code to figure out why it works. It will take you a while I know, but you have many people here who would be happy to explain a part of it that you don't get. I don't tell you every line and character to type because I want to help you get to the level you want to be on, not write your add-on for you.The FOREACH and NEXT macros are second and third from the bottom of the file. I checked before I told you to look there.
It's a unit variable. In the wiki, it says that [modify_unit] works on anything that ends up stored with [store_unit] or can be seen with the :inspect command. You can see "resting" with :inspect, so I'm sure it can be changed with [modify_unit]. I'm just not sure when it gets checked for the healing. I would guess turn_refresh though. (I'm glad that you have learned that keys only work in a particular context, but it does more-or-less mention "resting" in this case.)
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: thinking about petrify
I thought $unit.id was the unit that was getting unpetrified.
Storing and unstoring units is something I rarely get right.
I basically referred to my notes and substituted parts for other parts.
My notes:
Code: Select all
#define STORE_BARAN
[if]
[have_unit]
side=1
id=Baran
search_recall_list=yes
[/have_unit]
[then]
[store_unit]
[filter]
id=Baran
[/filter]
kill=yes
variable=baran_store
[/store_unit]
[/then]
[/if]
#enddef
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
Re: thinking about petrify
In unit-related events you have access to unit and more autostored variables. This event however is side turn, so not related to one specific unit.
Re: thinking about petrify
Ugh.
Coding wml is weird. Sometimes I expect something to be super-complicated and it turns out to be easy, and sometimes it's the exact opposite.
Different people have different learning styles. My style of learning is typically called by professionals in the field of education "visual."
And right now I'm visualizing deleting resting=no and "thawed" and using the code as is.
Coding wml is weird. Sometimes I expect something to be super-complicated and it turns out to be easy, and sometimes it's the exact opposite.
Different people have different learning styles. My style of learning is typically called by professionals in the field of education "visual."
And right now I'm visualizing deleting resting=no and "thawed" and using the code as is.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
Re: thinking about petrify
Consider why the code works. How it knows which unit to unpetrify. That would be the same unit whose coordinate you want.
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: thinking about petrify
OK, I checked this. If you put [unpetrify] in turn_refresh event instead of new_turn event, the healing never happens, so there is no problem with text showing two things at once. The reason this works is that a turn_refresh event happens just after healing, and the unit was still petrified when the healing would have happened. Changing the event type shouldn't have any adverse effects.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
- Atreides
- Posts: 1074
- Joined: March 30th, 2019, 10:38 pm
- Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off
Re: thinking about petrify
Hey, just found this thread when searching on Beyond Southern Hells. It's funny you should have tried that old unpetrify code because I just remade it for the era. The old code had some limitations such as only working with standard healers (8) and nothing else. I went a different way, I just unstone them on side turn and restone them on turn refresh. That way they get healed by villages (really bad if a unit gets stoned on a critical village...) and regen and any level of healer.