I want to understand
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.
-
- Posts: 41
- Joined: March 4th, 2017, 7:00 am
- Location: Reach me here: Orwell64123@gmail.com
Re: I want to understand
This is what I have now.
Code: Select all
#define WEAPON_SPECIAL_ARCANA_ACTIVATE_P
[arcana_activate_p]
id=TLOBH_arcana_activate_p
name= _ "arcana activate"
name_inactive=_ "inactive activate"
description= _ "Changes the schedule based on the nature of the attacking unit, and may change stats as well."
description_inactive=_ "This attack changes the unit's surroundings."
[/arcana_activate_p] # wmlxgettext: [specials]
[/specials] # wmlxgettext: [attack]
[/attack]
[event]
name=side turn
first_time_only=no
[store_unit]
[filter]
id=$frigid_store[i].id
[filter_wml]
[status]
frigid=yes
[/status]
[/filter_wml]
[/filter]
variable=frigid_store
value=unit
kill=yes
[/store_unit]
{FOREACH frigid_store i}
[set_variable]
name=status.frigid
value=yes
[/set_variable]
[unstore_unit]
variable=frigid_store[i].status.frigid
[/unstore_unit]
[unit_overlay]
id=$unit.id
image="data/add-ons/The_Legend_of_Buttheart/images/misc/frigid_clear.png"
[/unit_overlay]
{NEXT i}
{CLEAR_VARIABLE frigid_store}
[/event]
[event]
name=attacker hits
first_time_only=no
[filter_attack]
special=TLOBH_arcana_activate_p
[/filter_attack]
[time_area]
x,y=$unit.x,$unit.y
radius=50
{POLAR_SCHEDULE}
[/time_area]
{POLAR_SIGNAL}
[set_variable]
name=second_unit.status.frigid
value=yes
[/set_variable]
[unstore_unit]
variable=second_unit
[/unstore_unit]
[unit_overlay]
id=$unit.id
image="data/add-ons/The_Legend_of_Buttheart/images/misc/frigid_clear.png"
[/unit_overlay]
[/event]
[+attack]
[+specials]
# wmlxgettext: [/specials]
# wmlxgettext: [/attack]
#enddef
Re: I want to understand
Lines 16, 24, 29, 33, 36 are wrong.
16, 33 were correct in your last post.
24, 29, 36 are still wrong.
16, 33 were correct in your last post.
24, 29, 36 are still wrong.
-
- Posts: 41
- Joined: March 4th, 2017, 7:00 am
- Location: Reach me here: Orwell64123@gmail.com
Re: I want to understand
Not sure about the first [set_variable] tag.
Code: Select all
#define WEAPON_SPECIAL_ARCANA_ACTIVATE_P
[arcana_activate_p]
id=TLOBH_arcana_activate_p
name= _ "arcana activate"
name_inactive=_ "inactive activate"
description= _ "Changes the schedule based on the nature of the attacking unit, and may change stats as well."
description_inactive=_ "This attack changes the unit's surroundings."
[/arcana_activate_p] # wmlxgettext: [specials]
[/specials] # wmlxgettext: [attack]
[/attack]
[event]
name=side turn
first_time_only=no
[store_unit]
[filter]
side=$side_number
[filter_wml]
[status]
frigid=yes
[/status]
[/filter_wml]
[/filter]
variable=frigid_store
kill=yes
[/store_unit]
{FOREACH frigid_store i}
[set_variable]
name=status.frigid
value=unit
[/set_variable]
[unstore_unit]
variable=frigid_store[$i]
[/unstore_unit]
[unit_overlay]
id=$unit.id
image="misc/frigid_clear.png"
[/unit_overlay]
{NEXT i}
{CLEAR_VARIABLE frigid_store}
[/event]
[event]
name=attacker hits
first_time_only=no
[filter_attack]
special=TLOBH_arcana_activate_p
[/filter_attack]
[time_area]
x,y=$unit.x,$unit.y
radius=50
{POLAR_SCHEDULE}
[/time_area]
{POLAR_SIGNAL}
[set_variable]
name=second_unit.status.frigid
value=yes
[/set_variable]
[unstore_unit]
variable=second_unit
[/unstore_unit]
[unit_overlay]
id=$unit.id
image="misc/frigid_clear.png"
[/unit_overlay]
[/event]
[+attack]
[+specials]
# wmlxgettext: [/specials]
# wmlxgettext: [/attack]
#enddef
Re: I want to understand
It sets a variable that you clearly never use for anything. And it doesn't make any sense anyway. So, yeah.
- beetlenaut
- Developer
- Posts: 2827
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: I want to understand
No, store_unit does nothing automatically. You were right before in assuming that it needs an event. It is in one though. The [event] tag sets that up. This event (not the store_unit) automatically takes effect at the beginning of each side's turn. That's what "name=side turn" does. The store_unit is just along for the ride. If you change the event's name, the store_unit will happen at a different time.Rodrom wrote:# What I didn't understand about the "store unit" tag before was the way
# it automatically takes effect on all chosen units at the beginning of each
# turn. Before I assumed that a conditional or action event was needed.
How do you know that? Did you use :inspect to check? And how do you know that more than one unit should be stored? Did you check that too? That [store_unit] tag looks OK to me. It may be the only part that really does work just like you want it to.Rodrom wrote: # only one unit gets
# stored
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
-
- Posts: 41
- Joined: March 4th, 2017, 7:00 am
- Location: Reach me here: Orwell64123@gmail.com
Re: I want to understand
I used the SigurdFireDragon's gamestate GUI to check. What happens is that the unit hit by the new weapon special gets the frigid status and no other unit.How do you know that? Did you use :inspect to check? And how do you know that more than one unit should be stored? Did you check that too? That [store_unit] tag looks OK to me. It may be the only part that really does work just like you want it to.
I don't want to change the [store_unit] tag, I want to select only the units in the changed time area,
[time_area]
x,y=$unit.x,$unit.y
radius=50
{POLAR_SCHEDULE}
[/time_area]
and then apply the [store_unit] tag to only those units. I'm not sure what the best way to do that is. I tried using a custom event to filter, but I see now that [store_unit] doesn't work that way.
- beetlenaut
- Developer
- Posts: 2827
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: I want to understand
If that's what you wanted, then the [filter_attack], [set_variable], and [unstore_unit] tags in the second event are correct.Rodrom wrote:What happens is that the unit hit by the new weapon special gets the frigid status
So, in the store_unit tag, filter for units in locations that have the changed time area. You actually had that before I think.Rodrom wrote:I want to select only the units in the changed time area
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
-
- Posts: 41
- Joined: March 4th, 2017, 7:00 am
- Location: Reach me here: Orwell64123@gmail.com
Re: I want to understand
beetlenaut wrote:So, in the store_unit tag, filter for units in locations that have the changed time area. You actually had that before I think.Rodrom wrote:I want to select only the units in the changed time area
Code: Select all
[event]
name=side turn
first_time_only=no
[store_unit]
[filter]
side=$side_number
[filter_location]
time_of_day_id=Pdawn,Pmorning,Pafternoon,Pdusk,Pfirst_watch,Psecond_watch
[/filter_location]
[/filter]
variable=frigid_store
kill=yes
[/store_unit]
{FOREACH frigid_store i}
[set_variable]
name=unit.status.frigid
value=yes
[/set_variable]
[unstore_unit]
variable=frigid_store[$i]
[/unstore_unit]
[unit_overlay]
id=$unit.id
image="misc/frigid_clear.png"
[/unit_overlay]
{NEXT i}
{CLEAR_VARIABLE frigid_store}
[/event]
Also, I just realized that I was treating the side turn event as though it was one of the ''predetermined events with filters" like attacker hits. I'm thinking I may need
to change the side turn event to an "enter_hex" event or "move to" event to use the WML I wanted.
- beetlenaut
- Developer
- Posts: 2827
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: I want to understand
I don't know about that. The reason the event doesn't seem to do anything is because "unit" has no automatic value in a side_turn event, and you didn't give it a value either. However, you don't need "unit" because you stored your units in frigid_store, so you can just use that. You used it with unstore_unit, so I don't know why you didn't use it with the set_variable or unit_overlay.Rodrom wrote:I'm thinking I may need to change the side turn event to an "enter_hex" event or "move to" event to use the WML I wanted.
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
-
- Posts: 41
- Joined: March 4th, 2017, 7:00 am
- Location: Reach me here: Orwell64123@gmail.com
Re: I want to understand
beetlenaut wrote:However, you don't need "unit" because you stored your units in frigid_store, so you can just use that. You used it with unstore_unit, so I don't know why you didn't use it with the set_variable or unit_overlay.
Code: Select all
[event]
name=side turn
first_time_only=no
[store_unit]
[filter]
side=$side_number
[filter_wml]
[status]
frigid=yes
[/status]
[/filter_wml]
[/filter]
variable=frigid_store
kill=yes
[/store_unit]
{FOREACH frigid_store i}
# So the first set_variable tag should look like this?
[set_variable]
name=frigid_store[$i].status.frigid
value=yes
[/set_variable]
[unstore_unit]
variable=frigid_store[$i]
[/unstore_unit]
[unit_overlay]
id=$frigid_store.id
image="misc/frigid_clear.png"
[/unit_overlay]
{NEXT i}
{CLEAR_VARIABLE frigid_store}
[/event]
[event]
name=attacker hits
first_time_only=no
[filter_attack]
special=TLOBH_arcana_activate_p
[/filter_attack]
[time_area]
x,y=$unit.x,$unit.y
radius=50
{POLAR_SCHEDULE}
[/time_area]
{POLAR_SIGNAL}
[set_variable]
name=second_unit.status.frigid
value=yes
[/set_variable]
[unstore_unit]
variable=second_unit
[/unstore_unit]
[unit_overlay]
id=$frigid_store.id
image="misc/frigid_clear.png"
[/unit_overlay]
[/event]
# The [unit_overlay] tags work with the variable when I tested it.
- beetlenaut
- Developer
- Posts: 2827
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: I want to understand
That looks right.Rodrom wrote:# So the first set_variable tag should look like this?
No, you have to use the array index. Using no index is the same as using [0], so it will only work for the first stored unit.Rodrom wrote:# The [unit_overlay] tags work with the variable when I tested it.
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
-
- Posts: 41
- Joined: March 4th, 2017, 7:00 am
- Location: Reach me here: Orwell64123@gmail.com
Re: I want to understand
Code: Select all
[event]
name=side turn
first_time_only=no
[store_unit]
[filter]
side=$side_number
[filter_wml]
[status]
frigid=yes
[/status]
[/filter_wml]
[/filter]
variable=frigid_store
kill=yes
[/store_unit]
{FOREACH frigid_store i}
[set_variable]
name=frigid_store[$i].status.frigid
value=yes
[/set_variable]
[unstore_unit]
variable=frigid_store[$i]
[/unstore_unit]
[unit_overlay]
id=frigid_store[$i].id
image="misc/frigid_clear.png"
[/unit_overlay]
{NEXT i}
{CLEAR_VARIABLE frigid_store}
[/event]
[event]
name=attacker hits
first_time_only=no
[filter_attack]
special=TLOBH_arcana_activate_p
[/filter_attack]
[time_area]
x,y=$unit.x,$unit.y
radius=50
{POLAR_SCHEDULE}
[/time_area]
{POLAR_SIGNAL}
[set_variable]
name=second_unit.status.frigid
value=yes
[/set_variable]
[unstore_unit]
variable=second_unit
[/unstore_unit]
[unit_overlay]
id=frigid_store[$i].id
image="misc/frigid_clear.png"
[/unit_overlay]
[/event]
EDIT:
[unit_overlay]
id=frigid_store[$i].id
image="misc/frigid_clear.png"
[/unit_overlay]
is wrong. I think it should be
[unit_overlay]
id=$frigid_store[$i].id
image="misc/frigid_clear.png"
[/unit_overlay]
- beetlenaut
- Developer
- Posts: 2827
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: I want to understand
Your edit is right. The other $ is necessary. So, is it working now?
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
-
- Posts: 41
- Joined: March 4th, 2017, 7:00 am
- Location: Reach me here: Orwell64123@gmail.com
Re: I want to understand
No, unfortunately. The overlay works fine, but the "frigid" status is only being applied by the attacker hits event (so just one or two units depending).beetlenaut wrote:Your edit is right. The other $ is necessary. So, is it working now?
The side turn event doesn't change the status at all. I feel like I'm close to getting it but I'm unsure how to proceed.
- beetlenaut
- Developer
- Posts: 2827
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: I want to understand
Probably because you've gone back to storing only the units that already have the status applied. And then you apply it to them. I didn't notice.Rodrom wrote:The side turn event doesn't change the status at all.
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