how do i change the sides around?
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: 127
- Joined: November 11th, 2005, 9:06 am
- Location: California
Re: cannot find scenario
I believe that passive_leader goes inside a [ai] tag... along with recruitment pattern:
Code: Select all
[side]
side=2
controller=ai
team_name=2
user_team_name= _ "Prisoners"
type=Rogue
id=Burak
name=Burak
unit_description=Burak
gender=male
canrecruit=yes
unrenamable=true
[ai]
passive_leader=yes
#ifdef EASY
recruitment_pattern=fighter
#endif
#ifdef MEDIUM
recruitment_pattern=fighter,fighter,fighter,scout,scout
#endif
#ifdef HARD
recruitment_pattern=fighter,fighter,archer,fighter,archer,scout,scout
#endif
[/ai]
x=5
y=5
{GOLD 100 125 150}
{INCOME -1 1 3}
shroud=yes
[/side]
Mac OS X 10.5.7
Wesnoth 1.6.2
Wesnoth 1.6.2
- CountPenguin
- Posts: 132
- Joined: May 25th, 2007, 1:13 am
- Location: USA
Re: cannot find scenario
Oh... Ok thanks. I probably should have figured that out.
CountPenguin
Currently working on Siege of Soradoc. Except not anymore, but you can take over if you want!
Currently working on Siege of Soradoc. Except not anymore, but you can take over if you want!
- CountPenguin
- Posts: 132
- Joined: May 25th, 2007, 1:13 am
- Location: USA
Re: cannot find scenario
How do I make a unit on a stored location, instead of an x,y value.
Here's the last breath event for one enemy leader. You can see that when he dies, a walking corpse is made, but right now, I have it appearing in his keep, not where he died. I put the [store_locations] tag in to get the location of his death, but how do I use that to determine where the zombie is made?
Code: Select all
[event]
name=last breath
[filter]
id=Ulgor
[/filter]
[message]
speaker=Ulgor
message= _ "You may have killed me, but you'll never get out of this accursed cave!"
[/message]
[store_locations]
variable=zombieland
[filter]
id=Ulgor
[/filter]
[/store_locations]
[kill]
id=Ulgor
animate=yes
[/kill]
[if]
[variable]
name=burak_dead
boolean_equals=no
[/variable]
[then]
[message]
speaker=Burak
message= _ "Rise, fool!"
[/message]
[unit]
type=Walking Corpse
side=2
x,y=19,22
name=Ulgor
animate=yes
[/unit]
[/then]
[/if]
[/event]
CountPenguin
Currently working on Siege of Soradoc. Except not anymore, but you can take over if you want!
Currently working on Siege of Soradoc. Except not anymore, but you can take over if you want!
-
- Posts: 127
- Joined: November 11th, 2005, 9:06 am
- Location: California
Re: cannot find scenario
Last breath automatically stores both the unit who died (in the variable "unit") and the unit that killed him (in the variable "second_unit"). You can access the variables like so:
Code: Select all
[event]
name=last breath
[filter]
id=Ulgor
[/filter]
[message]
speaker=Ulgor
message= _ "You may have killed me, but you'll never get out of this accursed cave!"
[/message]
# Totally unnecessary.
[store_locations]
variable=zombieland
[filter]
id=Ulgor
[/filter]
[/store_locations]
#
[kill]
id=Ulgor
animate=yes
[/kill]
[if]
[variable]
name=burak_dead
boolean_equals=no
[/variable]
[then]
[message]
speaker=Burak
message= _ "Rise, fool!"
[/message]
[unit]
type=Walking Corpse
side=2
x,y=$unit.x,$unit.y # This uses the location of the dying unit
name=Ulgor
animate=yes
[/unit]
[/then]
[/if]
[/event]
Mac OS X 10.5.7
Wesnoth 1.6.2
Wesnoth 1.6.2
Re: cannot find scenario
$unit is stored when it's first used. So if you kill the primary unit first, then try to access $unit, it might not work.
- CountPenguin
- Posts: 132
- Joined: May 25th, 2007, 1:13 am
- Location: USA
Re: question about [message]
New question: How can I make the speaker of a message be the unit closest to a location/set of locations?
CountPenguin
Currently working on Siege of Soradoc. Except not anymore, but you can take over if you want!
Currently working on Siege of Soradoc. Except not anymore, but you can take over if you want!
Re: question about [message]
Code: Select all
<my_variable "">
<my_radius 1>
<while my_variable is empty>
<do>
<store units within my_radius from my_location to variable my_variable>
<increase my_radius>
</do>
</while>
<message with id=$my_variable[0].id says something>
Somewhere, between the sacred silence and sleep.
Disorder.
Disorder.
- CountPenguin
- Posts: 132
- Joined: May 25th, 2007, 1:13 am
- Location: USA
Re: question about [message]
Ok, I think I sort of understand, here's what I tried (though you can see it's not finished or even playable). I put my questions inside the code:
Does this look at all right? (beside my ?'s)
Code: Select all
[event]
name=turn 6
[set_variable]
name=flood_radius
value=0
[/set_variable]
[store_locations]
variable=flood
terrain=Ww,Wwf,Chw,Ww^Vm
[/store_locations]
[store_unit]
variable=flood_speaker
[filter_location]
find_in=flood
[/filter_location]
[/store_unit]
[while]
##how do i say flood is empty?
[do]
[store_unit]
variable=flood_speaker
[filter_location]
find_in=flood
radius=flood_radius + 1 ##(I know this won't work, what can I do so it does?)
[/filter_location]
[/store_unit]
[/do]
[/while]
[message]
speaker=flood_speaker[0] ##will this work, or do I need a different tag?
message= _ "Uh oh, I think the water is rising. We'd better get away from the river before it washes us away..."
[/message]
[/event]
CountPenguin
Currently working on Siege of Soradoc. Except not anymore, but you can take over if you want!
Currently working on Siege of Soradoc. Except not anymore, but you can take over if you want!
Re: question about [message]
Code: Select all
[event]
name=turn 6
[set_variable]
name=flood_radius
value=0
[/set_variable]
[store_locations]
variable=flood
terrain=Ww,Wwf,Chw,Ww^Vm
[/store_locations]
[store_unit]
variable=flood_speaker
[filter]
[filter_location]
find_in=flood
[/filter_location]
[/filter]
[/store_unit]
[while]
[variable]
name=flood_speaker.length
numerical_equals=0
[/variable]
[do]
[set_variable]
name=flood_radius
add=1
[/set_variable]
[store_unit]
variable=flood_speaker
[filter]
[filter_location]
find_in=flood
radius=$flood_radius
[/filter_location]
[/filter]
[/store_unit]
[/do]
[/while]
[message]
id=$flood_speaker.id
message= _ "Uh oh, I think the water is rising. We'd better get away from the river before it washes us away..."
[/message]
[/event]
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Re: question about [message]
[store_unit] doesn't take a [filter_location].
Re: question about [message]
true, didn't spot that one... I have edited my post abovezookeeper wrote:[store_unit] doesn't take a [filter_location].
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
- CountPenguin
- Posts: 132
- Joined: May 25th, 2007, 1:13 am
- Location: USA
Re: question about [message]
ok thank you so much. it works perfectly!
and now i need to add something so that the ai will go away from the river too, otherwise they'll die. so can i make something like this?:
[ai]
[avoid]
x,y=$flood.x,$flood.y
[/avoid]
[/ai]
and is there a way to only put this in effect starting on the 6th turn?
thanks!
and now i need to add something so that the ai will go away from the river too, otherwise they'll die. so can i make something like this?:
[ai]
[avoid]
x,y=$flood.x,$flood.y
[/avoid]
[/ai]
and is there a way to only put this in effect starting on the 6th turn?
thanks!
CountPenguin
Currently working on Siege of Soradoc. Except not anymore, but you can take over if you want!
Currently working on Siege of Soradoc. Except not anymore, but you can take over if you want!
- CountPenguin
- Posts: 132
- Joined: May 25th, 2007, 1:13 am
- Location: USA
Re: question about [message]
How do I fire an event after player one takes their 7th turn? Do I use something with side turn or new turn?
CountPenguin
Currently working on Siege of Soradoc. Except not anymore, but you can take over if you want!
Currently working on Siege of Soradoc. Except not anymore, but you can take over if you want!
Re: question about [message]
Use a side turn event and check [if] side_number equals 2 and turn_number equals 7.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
- CountPenguin
- Posts: 132
- Joined: May 25th, 2007, 1:13 am
- Location: USA
Re: question about [message]
Ok thanks. Now I want a new side to come into the scenario on turn eleven. I tried just putting the [side] tag inside an event, but it didn't work (I didn't think it would, but it's worth a try):
I'm assuming I just have to put the side tag in with the rest of the scenario, but how do I hide their units until turn 11?
Spoiler:
CountPenguin
Currently working on Siege of Soradoc. Except not anymore, but you can take over if you want!
Currently working on Siege of Soradoc. Except not anymore, but you can take over if you want!