How to do event that spawns units and then units speak?
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.
How to do event that spawns units and then units speak?
okey so lets say two peasant spawn to the game and then they say something and then my leader answers to them.
So how to do it?
ps. i tried to copy somekind of thing from under burning sun but cannot make it work:(
So how to do it?
ps. i tried to copy somekind of thing from under burning sun but cannot make it work:(
"This game cured me of my real life addiction."
-Flameslash
-Flameslash
Re: How to do event that spawns units and then units speak?
use http://wiki.wesnoth.org/SingleUnitWML in http://wiki.wesnoth.org/ScenarioWML and then http://wiki.wesnoth.org/InterfaceActionsWML.
Jazz is not dead, it just smells funny - Frank Zappa
Current projects: Internet meme Era, The Settlers of Wesnoth
Current projects: Internet meme Era, The Settlers of Wesnoth
Re: How to do event that spawns units and then units speak?
[event]
name=turn 4
[fire_event]
name=Peasants
[/fire_event]
[/event]
[event]
name=Peasants
type=Peasant
side=1
x,y=1,1
experience=15
[/event]
what goes wrong whit this one?
name=turn 4
[fire_event]
name=Peasants
[/fire_event]
[/event]
[event]
name=Peasants
type=Peasant
side=1
x,y=1,1
experience=15
[/event]
what goes wrong whit this one?
"This game cured me of my real life addiction."
-Flameslash
-Flameslash
- Ken_Oh
- Moderator Emeritus
- Posts: 2178
- Joined: February 6th, 2006, 4:03 am
- Location: Baltimore, Maryland, USA
Re: How to do event that spawns units and then units speak?
Most of those tags in the second event don't go inside of [event]. You want [unit], which is in the first link Dixie gave.
Re: How to do event that spawns units and then units speak?
Yeah, basically you use an event to create the units (which are defined into an [unit] tag), and then, in the same event, you can make them speak with Interface Actions. You can make them move about and stuff too if you look at Direct Actions WML in the wiki.
And by the way, you probably don't need that fire event stuff. Just put everything into your "name=turn 4" event.
And by the way, you probably don't need that fire event stuff. Just put everything into your "name=turn 4" event.
Jazz is not dead, it just smells funny - Frank Zappa
Current projects: Internet meme Era, The Settlers of Wesnoth
Current projects: Internet meme Era, The Settlers of Wesnoth
-
- Posts: 1549
- Joined: June 18th, 2009, 1:45 am
Re: How to do event that spawns units and then units speak?
Code: Select all
[event]
name=turn 4
{NAMED_GENERIC_UNIT 1 (Peasant) 1 1 (Peasants) ( _ "Peasants")}
[message]
speaker=Peasants
message= _ "The macro above explained: NAMED_GENERIC_UNIT side (type) x y (id) ( _ 'name')"
[/message]
[/event]

Re: How to do event that spawns units and then units speak?
Well, of course there's that macro, but I think it's more profitable for him to do it the longer way, so he learns WML a bit. It's always helpful to know what is thw whole spectrum of your options, not just the simplified macroselvish_sovereign wrote:Another wayCode: Select all
[event] name=turn 4 {NAMED_GENERIC_UNIT 1 (Peasant) 1 1 (Peasants) ( _ "Peasants")} [message] speaker=Peasants message= _ "The macro above explained: NAMED_GENERIC_UNIT side (type) x y (id) ( _ 'name')" [/message] [/event]

Jazz is not dead, it just smells funny - Frank Zappa
Current projects: Internet meme Era, The Settlers of Wesnoth
Current projects: Internet meme Era, The Settlers of Wesnoth
Re: How to do event that spawns units and then units speak?
Well thank you you both. Hopefully soveireign macro does it:D
ps. thnx for trying to teach me dixie:D
actually unit spawsn right but i dont see it says any message
ps. thnx for trying to teach me dixie:D
actually unit spawsn right but i dont see it says any message
"This game cured me of my real life addiction."
-Flameslash
-Flameslash
Re: How to do event that spawns units and then units speak?
Done the interface action right? Read it carefully, it's pretty straightforward and understandable.Dixie wrote:use http://wiki.wesnoth.org/SingleUnitWML in http://wiki.wesnoth.org/ScenarioWML and then http://wiki.wesnoth.org/InterfaceActionsWML.
Jazz is not dead, it just smells funny - Frank Zappa
Current projects: Internet meme Era, The Settlers of Wesnoth
Current projects: Internet meme Era, The Settlers of Wesnoth