How to Prevent Rest Healing in Artificially Induced Poisoned
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.
- Gweddeoran
- Posts: 157
- Joined: December 19th, 2014, 6:03 am
- Location: Estmark Hills
How to Prevent Rest Healing in Artificially Induced Poisoned
In a scenario, there is a need to keep the player leader incurably poisoned throughout. It works, there is no curing whatsoever, but rest healing still takes place. How does one stop this from happening?
Here is the WML:
Here is the WML:
Code: Select all
[event]
name = "turn refresh"
first_time_only="no"
[store_unit]
[filter]
id = "Typhon"
[/filter]
variable = "stored_typhon"
kill = yes
[/store_unit]
[set_variables]
name = "stored_typhon.modifications.object"
[value]
[effect]
apply_to = status
add = poisoned
[/effect]
[/value]
[/set_variables]
# Not sure how it happened
# but Typhon can recover HP
# even while being poisoned
# however this should fix it
# Edit: It did not fix anything
# [set_variables]
# name = "stored_typhon.modifications.object"
# [value]
#
# [effect]
# apply_to = status
# add = unhealable
# [/effect]
#
# [/value]
# [/set_variables]
# [set_variables]
# name = "stored_typhon.status.poisoned"
# value = "yes"
# [/set_variables]
[unstore_unit]
variable = "stored_typhon"
find_vacant = yes
[/unstore_unit]
{CLEAR_VARIABLE stored_typhon}
[/event]
Last edited by Pentarctagon on August 2nd, 2019, 2:03 pm, edited 1 time in total.
Reason: [c] -> [code]
Reason: [c] -> [code]
Re: How to Prevent Rest Healing in Artificially Induced Poisoned
The "turn refresh" event happens after healing so that doesn't really help. The unhealable status should do what you want though so you need to set that properly. Probably just once somewhere at the start since I don't think anything resets it.
"If gameplay requires it, they can be made to live on Venus." -- scott
Re: How to Prevent Rest Healing in Artificially Induced Poisoned
Like Soliton said, if the leader needs to have the unhealable status for the whole scenario, use a first_time_only=yes event, no need to refresh the effect.
Try to use this in your event:
or - if you really want to use stored variables - you were quite near to get it right I think... Try this after the store:
Also, no need to kill poor Typhon (it could be detrimental if his death triggers events), you can safely store and unstore units without killing them.
Try to use this in your event:
Code: Select all
[object]
[filter]
id="Typhon"
[/filter]
id=artificial_poison #or whatever you want, you need this if you want to remove this object later with a [remove_object]
take_only_once=yes
duration=forever #or scenario, I usually use forever because I find it works better in my complex code
[effect]
apply_to=status
add=poisoned
[/effect]
[effect]
apply_to=status
add=unhealable
[/effect]
[/object]
Code: Select all
[set_variable]
name = "stored_typhon.status.poisoned"
value = "yes"
[/set_variable]
[set_variable]
name = "stored_typhon.status.unhealable"
value = "yes"
[/set_variable]
Last edited by Xalzar on August 7th, 2019, 7:31 am, edited 1 time in total.
- Gweddeoran
- Posts: 157
- Joined: December 19th, 2014, 6:03 am
- Location: Estmark Hills
Re: How to Prevent Rest Healing in Artificially Induced Poisoned
Thanks a lot for the remarks everyone!
@Xalzar- the first solution worked, the second didn't- I guess turn refresh and stored variables are too cumbersome and don't do the job anyway.
Also, is your location (New Saurgrath) by any chance from my campaign 'The Thelien Attack' (just wondering how many people here on the forums played it)?
@Xalzar- the first solution worked, the second didn't- I guess turn refresh and stored variables are too cumbersome and don't do the job anyway.
Also, is your location (New Saurgrath) by any chance from my campaign 'The Thelien Attack' (just wondering how many people here on the forums played it)?
Re: How to Prevent Rest Healing in Artificially Induced Poisoned
Glad it worked for you!
New Saurgrath is mostly an idea, is the hope that one day the scattered Saurian tribes - now reduced to mainly mercenaries and thieves - will reunite and rebuild their capital and the glorious Saurian Empire!
(that said, I may have had some ideas for an unreleased campaign by me about this subject, but alas nothing came from it since I was very unexperienced in WML at the time - and now I'm not so much better either )
Xalzar - Saurian aficionado
Unluckily I've had no time to play campaigns in nearly a year, so since your campaign is recent I've certainly not played it. But since it's a Saurian campaign, I'll correct that as soon as possible!gweddeoran wrote: ↑August 3rd, 2019, 2:37 am @Xalzar- is your location (New Saurgrath) by any chance from my campaign 'The Thelien Attack' (just wondering how many people here on the forums played it)?
New Saurgrath is mostly an idea, is the hope that one day the scattered Saurian tribes - now reduced to mainly mercenaries and thieves - will reunite and rebuild their capital and the glorious Saurian Empire!
(that said, I may have had some ideas for an unreleased campaign by me about this subject, but alas nothing came from it since I was very unexperienced in WML at the time - and now I'm not so much better either )
Xalzar - Saurian aficionado
- Gweddeoran
- Posts: 157
- Joined: December 19th, 2014, 6:03 am
- Location: Estmark Hills
Re: How to Prevent Rest Healing in Artificially Induced Poisoned
Oof, doesn't work entirely- the poison does show up, but doesn't do any loss of HP.
Re: How to Prevent Rest Healing in Artificially Induced Poisoned
You're right!gweddeoran wrote: ↑August 4th, 2019, 5:15 am Oof, doesn't work entirely- the poison does show up, but doesn't do any loss of HP.
I really thought the poison effect to be part of the status, all defined by the game engine...but clearly I was wrong.
At least unhealable works correctly.
I'd say you should use a [harm_unit] in a turn refresh event to simulate the poison effect then.
EDIT: or! Use directly [harm_unit] with poisoned=yes and 0 amount of damage and see if it works that way.
- Gweddeoran
- Posts: 157
- Joined: December 19th, 2014, 6:03 am
- Location: Estmark Hills
Re: How to Prevent Rest Healing in Artificially Induced Poisoned
I tried that, but it didn't work. Instead, I have now done a compromise- rest-healing when next to a healer or on a village is now a mechanic of this affliction (with some story text relating to the properties of the poison as a justification).
Re: How to Prevent Rest Healing in Artificially Induced Poisoned
Indeed unhealable also means no poison damage since that is part of the healing logic.
"If gameplay requires it, they can be made to live on Venus." -- scott
Re: How to Prevent Rest Healing in Artificially Induced Poisoned
There is unit attribute which shows whether unit is resting. If you update it at right times you should be able to decide if resting should happen.
Re: How to Prevent Rest Healing in Artificially Induced Poisoned
What logic is that? How should anyone guess that's how it works?
Oooh...yeah!
A
Code: Select all
[set_variable]
name = "stored_typhon.resting"
value = "no"
[/set_variable]
Re: How to Prevent Rest Healing in Artificially Induced Poisoned
Yeah, I suppose that's up for debate what unhealable exactly means. Intuitively I would agree that it does not follow that poison does nothing. Not sure how much would break when changing that. Might be a good idea.
"If gameplay requires it, they can be made to live on Venus." -- scott