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: 2813
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: thinking about petrify
I don't get what you mean because the only variable I am using is the internal unit variable, and there isn't a counter. Our ideas were pretty similar. (I considered using a foreach loop, which would have made the code even closer.) The internal variable is the biggest difference. Yours will work better if someone changes the turns manually during testing though.
I did think to test mine with multiple units getting frozen and unfrozen at different times, and it worked.
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
Thanks for the unit code. There's some advanced stuff in there.
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
It originally wanted the frozen unit to stay frozen 2 turns, but I haven't been able to get beetlenaut's code to work.
So I went in a different direction. I tried to make it work with
So this is what the Frostbite monster's code looks like now...
Basically, the monster temporarily freezes opponents so they can't do anything for the rest of the turn. The frozen units automatically thaw at the beginning of the new turn, and floating text says, "thawed" (beetlenaut's idea). Temporarily freezing units into inaction is powerful, but I don't think it's over-powered. I think it's troublesome, like poison and slow.
So I went in a different direction. I tried to make it work with
[switch]
and a new status
that I called halfway_thawed
, but couldn't get that to work either.So this is what the Frostbite monster's code looks like now...
Basically, the monster temporarily freezes opponents so they can't do anything for the rest of the turn. The frozen units automatically thaw at the beginning of the new turn, and floating text says, "thawed" (beetlenaut's idea). Temporarily freezing units into inaction is powerful, but I don't think it's over-powered. I think it's troublesome, like poison and slow.
Code: Select all
[event]
name=new_turn
first_time_only=no
[floating_text]
[filter]
status=petrified
[/filter]
text= _ "thawed"
color="0,127,255" {COLOR_HEAL}
[/floating_text]
[unpetrify]
side=2
[/unpetrify]
[/event]
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
Sculpt works for 2 turns already and is easy to adjust turn_of_unstoning=$"($turn_number| + 2)".
Re: thinking about petrify
I noticed that. The code seemed to be what I wanted: a powerful attack, but with a temporary effect. But I couldn't get it to work, even a little.
Right at the top, there isn't even an opening tag for
[specials]
. It looks like some of the code is missing.History has indicated that I can't debug code that is too advanced, too clever or too convoluted. It either works right out of the box, or it doesn't. If I have to figure-out what lines are missing, like beetlenaut expected me to do, the code will remain non-functional.
Code: Select all
#define WEAPON_SPECIAL_AE_MAG_SCULPT
# wmlxgettext: [attack]
# wmlxgettext: [specials]
[petrifies]
id=sculpts
name= _ "sculpts"
description=_"This attack petrifies the target, turning it to stone for two turns. Units that have been petrified may not move or attack. When this effect wears off, the unit is slowed for 1 turn. Inactive in rpg."
[filter_self]
lua_function=wesnoth.wml_conditionals.AE_not_rpg
[/filter_self]
[/petrifies]
[/specials]
# wmlindent: start ignoring
[/attack]
# wmlindent: stop ignoring
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
It's a macro that's used in some of the unit definitions, for example in units/EoMa_units/Sky_Kingdom/Sculptor.cfg:
Sculpts wears off during a turn belonging to the unit that did the petrification, which means it can still be excessively overpowered in scenarios where the enemy has a few powerful hero units. An example would be Survival Extreme, where each player has a single superpowered hero - the hero gets petrified, misses their next turn, and then gets petrified again without being able to move at all (at least we caught that in alpha-testing ).
Code: Select all
[attack]
name=gaze
description= _ "petrifyng spell"
type=cold
[specials]
{WEAPON_SPECIAL_AE_MAG_SCULPT}
{WEAPON_SPECIAL_MAGICAL}
[/specials]
damage=2
number=2
range=ranged
icon=attacks/sculpt.png
[/attack]
Re: thinking about petrify
That makes sense. The more powerful the unit, the greater the impact of the unit not doing anything helpful on the battlefield. I've been play-testing almost entirely with peasants, ha ha.
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
Code: Select all
[filter_self]
lua_function=wesnoth.wml_conditionals.AE_not_rpg
[/filter_self]
Re: thinking about petrify
Thank you, Ravana! Removing theRavana wrote: ↑November 15th, 2022, 5:03 pmSays that this ability should not be active in RPG era. If you do not create era with RPG support, then you can remove this filter. Otherwise I can tell more how it works.Code: Select all
[filter_self] lua_function=wesnoth.wml_conditionals.AE_not_rpg [/filter_self]
[filter_self]
code was the answer. The code works now.I play-tested it a while. Wow, 2 turns is so much better than 1. And I like how the unit unpetrifies and moves, so it has the opportunity to run away or attack.
I thought it might be cool if the word "thawed" floated above the unit a moment before it unpetrifies. My code didn't work, though. I tried several different things. One mistake caused the word "thawed" to appear in every hex.
I suspect my filtering for x,y is the problem.
I wonder if the word "thawed" will overlap the 2 points of healing which appear above the unpetrified unit? That might not look good...
If it looks bad, could healing for the thawed unit be turned-off for that unit, for that turn only? I kinda doubt it.
Code: Select all
[then]
[floating_text]
x=$this_item.x|
y=$this_item.y|
text= _ "thawed"
color="0,127,255"
[/floating_text]
[unpetrify]
id=$sculpt_unit_information[$i].id
[/unpetrify]
{MODIFY_UNIT id=$sculpt_unit_information[$i].id status.slowed yes}
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
Thank you, Ravana! Removing theRavana wrote: ↑November 15th, 2022, 5:03 pmSays that this ability should not be active in RPG era. If you do not create era with RPG support, then you can remove this filter. Otherwise I can tell more how it works.Code: Select all
[filter_self] lua_function=wesnoth.wml_conditionals.AE_not_rpg [/filter_self]
[filter_self]
code was the answer. The code works now.I play-tested it a while. Wow, 2 turns is so much better than 1. And I like how the unit unpetrifies and moves, so it has the opportunity to run away or attack.
I thought it might be cool if the word "thawed" floated above the unit a moment before it unpetrifies. My code didn't work, though. I tried several different things. One mistake caused the word "thawed" to appear in every hex.
I suspect my filtering for x,y is the problem.
I wonder if the word "thawed" will overlap the 2 points of healing which appear above the unpetrified unit? That might not look good...
If it looks bad, could healing for the thawed unit be turned-off for that unit, for that turn only? I kinda doubt it, but thought I'd ask.
Code: Select all
[then]
[floating_text]
x=$this_item.x|
y=$this_item.y|
text= _ "thawed"
color="0,127,255"
[/floating_text]
[unpetrify]
id=$sculpt_unit_information[$i].id
[/unpetrify]
{MODIFY_UNIT id=$sculpt_unit_information[$i].id status.slowed yes}
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.
- beetlenaut
- Developer
- Posts: 2813
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: thinking about petrify
There is no $this_item with the {FOREACH} macro. That's for the [foreach] tag. You should change this to the tag version because the macro version is going to be removed soon. The code
$sculpt_unit_information[$i]
is equivalent to $this_item
. You might be able to just search and replace to change those, but you will have to look up the macro and the tag to see how they specify the array to use. (The macro is in core/macros/deprecated-utils.cfg.)Edit: Forgot this.
Maybe. Try turning the unit's "resting" key to "no" before the floating text happens.
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
Thanks for helping. I looked in the deprecated code, and saw stuff about animated campfires and so forth. And I didn't find anything in the Wiki onbeetlenaut wrote: ↑November 15th, 2022, 6:26 pm...Try turning the unit's "resting" key to "no" before the floating text happens.
resting=
, so I don't know what to do with it. It's not a modify_unit
key. I changed the x,y filter and it didn't do anything.Code: Select all
[then]
[floating_text]
x=$this_item[$i].x|
y=$this_item[$i].y|
text= _ "thawed"
color="0,127,255"
[/floating_text]
[unpetrify]
id=$sculpt_unit_information[$i].id
[/unpetrify]
. . .
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
You can store unit by id, and access its x and y after that. I also noticed that my code does not work, there needs to be {VARIABLE_OP i sub 1} after clear_variable. Otherwise every second unit will be unpetrified at later turn. clear_variable shifts indexes back by one, so currently 5 units take 3 turns to be all unpetrified.
Re: thinking about petrify
Thanks. I tried a few variations, but none worked. This was the third...
Code: Select all
[then]
[store_unit]
[filter]
id=$unit.id
[/filter]
resting=no
[/store_unit]
[floating_text]
x=$unit.x
y=$unit.y
text= _ "thawed"
color="0,127,255"
[/floating_text]
[unpetrify]
id=$sculpt_unit_information[$i].id
[/unpetrify]
{MODIFY_UNIT id=$sculpt_unit_information[$i].id status.slowed yes}
Uh oh.Ravana wrote: ↑November 15th, 2022, 7:22 pmI also noticed that my code does not work, there needs to be {VARIABLE_OP i sub 1} after clear_variable. Otherwise every second unit will be unpetrified at later turn. clear_variable shifts indexes back by one, so currently 5 units take 3 turns to be all unpetrified.
Last edited by Helmet on November 15th, 2022, 7:36 pm, edited 1 time in total.
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
id=$unit.id - who is $unit? Where you store it?