Its me again with a new question:-)
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.
Its me again with a new question:-)
I have a little problem - in my scenario, there are a few loyal subheroes who are optional. And I want them to be recalled automatically on the first turn.. However, it somehow doesn't work properly.. Here is the code I used:
Subheor Drogan (from campaign 3:
This event is for getting Drogan to join your team:
[event]
name=moveto
[filter]
x,y=9,21
[/filter]
[unit]
id=Drogan
side=1
canrecruit=no
type=Vampmage
name= _ "Drogan"
gender=male
x=8.x
y=20.y
[/unit]
#Defining the variable for Drogan to decide if he can be recalled or not:
[set_variable]
name=Drogan_alive
value=yes
[/set_variable]
[message]
speaker=Drogan
message= _ "Hey Patruk, what are you doing here? Are you searching for that strange suspicious Man who ran across me a few minutes ago? I can help you searching for him if you want"
[/message]
[/event]
#If Drogan dies (in any scenario besides the last one where everyone might die)
[event]
name=die
[filter]
id=Drogan
[/filter]
[message]
speaker=Drogan
message= _ "I wish I could have finished my research"
[/message]
[set_variable]
name=Drogan_alive
value=no
[/set_variable]
[/event]
#The recall event in each scenario (later on without the maessage as it might get annoying each scenario)
[event]
[if]
[variable]
name=Drogan_alive
equals=yes
[/variable]
[then]
[unit]
id=Drogan
canrecruit=no
name= _ "Drogan"
gender=male
x=43.x
y=3.y
[/unit]
[/then]
[else]
[message]
speaker=Jacky
message= _ "I wish Drogan was here"
[/message]
[/else]
[/if]
[/event]
I really don't get what is wrong.. I would appreciate each help,
Thank you
Subheor Drogan (from campaign 3:
This event is for getting Drogan to join your team:
[event]
name=moveto
[filter]
x,y=9,21
[/filter]
[unit]
id=Drogan
side=1
canrecruit=no
type=Vampmage
name= _ "Drogan"
gender=male
x=8.x
y=20.y
[/unit]
#Defining the variable for Drogan to decide if he can be recalled or not:
[set_variable]
name=Drogan_alive
value=yes
[/set_variable]
[message]
speaker=Drogan
message= _ "Hey Patruk, what are you doing here? Are you searching for that strange suspicious Man who ran across me a few minutes ago? I can help you searching for him if you want"
[/message]
[/event]
#If Drogan dies (in any scenario besides the last one where everyone might die)
[event]
name=die
[filter]
id=Drogan
[/filter]
[message]
speaker=Drogan
message= _ "I wish I could have finished my research"
[/message]
[set_variable]
name=Drogan_alive
value=no
[/set_variable]
[/event]
#The recall event in each scenario (later on without the maessage as it might get annoying each scenario)
[event]
[if]
[variable]
name=Drogan_alive
equals=yes
[/variable]
[then]
[unit]
id=Drogan
canrecruit=no
name= _ "Drogan"
gender=male
x=43.x
y=3.y
[/unit]
[/then]
[else]
[message]
speaker=Jacky
message= _ "I wish Drogan was here"
[/message]
[/else]
[/if]
[/event]
I really don't get what is wrong.. I would appreciate each help,
Thank you
Last edited by alex23 on November 6th, 2012, 5:18 pm, edited 2 times in total.
Re: AUtorecall units/dependence if the unit stills lives
In this case, it seems you need: in his die event, instead of this one:
Then store him to recall him back in the game after [if] + [variable] tags
Something like:
Then when you need him back: They should be in an [event] with an event-name, though.
If you just need to recall him from the beginning of the next scenario, you don't really need what I said. You only need: in the prestart event usually (to show him on the map).
Code: Select all
[clear_variable]
name=Drogan_alive
[/clear_variable]
Code: Select all
[set_variable]
name=Drogan_alive
value=no
[/set_variable]
Something like:
Code: Select all
[store_unit]
[filter]
id=Drogan
[/filter]
variable=drogan_store
kill=yes
[/store_unit]
Code: Select all
[unstore_unit]
variable=drogan_store
x,y=43,3
[/unstore_unit]
{CLEAR_VARIABLE drogan_store}
If you just need to recall him from the beginning of the next scenario, you don't really need what I said. You only need:
Code: Select all
[recall]
id=Drogan
x,y=43,3
[/recall]
Fate of a Princess/feedback thread: "What is in own heart that is the most important, not who you are."
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
Re: AUtorecall units/dependence if the unit stills lives
Code: Select all
[event]
name=prestart
[recall]
id=Drogan
x,y=43,3 ### if you dont set coordinates, then Drogan appears next to the leader
[/recall]
[/event]
[event]
name=start ### or what event you want
[if]
[have_unit]
id=Drogan
[/have_unit]
[then]
### do nothing
[/then]
[else]
[message]
speaker=Jacky
message= _ "I wish Drogan was here"
[/message]
[/else]
[/if]
[/event]
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR
Re: AUtorecall units/dependence if the unit stills lives
thx haha so its much easier than i thought^^ however i just noticed that my code (although beeing pretty long) would still work, i just forgot to say when the event had to start^^
Re: AUtorecall units/dependence if the unit stills lives
hmm ok new question: I want to constantly change the side of a whole enemy team to be allied with me or even fight directly for me(I would prefer that)..
I tried this however without luck:
Please help
I tried this however without luck:
Code: Select all
[event]
name=turn 2
[message]
speaker=Poseidon
message= _ "What are you doing here Strangers?"
[/message]
[message]
speaker=Jacky
message= _ "We are on the journey to defeat the Deamon. "
[/message]
[message]
speaker=Poseidon
message= _ "Hahaha you have an evil Necropath with you and some other strange creatures and undead and you really think I will believe you this?"
[/message]
[message]
speaker=Necropath
message= _ "Only because I decided to live longer doesn't mean that I am evil"
[/message]
[message]
speaker=Poseidon
message= _ "To become a Necropath you must have an extremely dark soul, you can't fool me.. however I might really need some help, so we might make a treaty for the next few days"
[/message]
[message]
speaker=Kerin
message= _ "Don't ally with those stupid mermen. They are week here, on the sand.. However, we could help you fighting those lava-creatures and desert animals, if you fight the Mermen. In our area, we are the strongest"
[option]
message= _ "Ally with the desert-elves"
[command]
[message]
speaker=Poseidon
message= _ "Than die you evil scum"
[/message]
[filter]
side=4
[/filter]
[set_variable]
name=side.team_name
value=1
[/set_variable]
[/command]
[/option]
[option]
message= _ "Ally with the Mermen"
[command]
[message]
speaker=Kerin
message= _ "Hahaha you have chosen the wrong"
[/message]
[filter]
side=5
[/filter]
[set_variable]
name=side.team_name
value=1
[/set_variable]
[/command]
[/option]
[/message]
[/event]
Re: AUtorecall units/dependence if the unit stills lives
Use [modify_side]
This makes team 4 allie with team 1
Simple?
Code: Select all
[modify_side]
side=4
team_name=1
[/modify_side]
Simple?
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR
Re: hmm ok new question: I want to constantly change the sid
wow thanks!!!! Is it possible to make all units side 1 as well? (not only allied but under my direct control (so that I can recall them later?))
Re: hmm ok new question: I want to constantly change the sid
This macro change all units of team 4 to team 1
Code: Select all
{MODIFY_UNIT (side=4) side 1}
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR
Re: Its me again with a new question:-)
yes now its somethingelse: I want a subhero to be able to recruit only One certain unit , but the main hero a few others.. thats my code atm (not working^^)
Code: Select all
[event]
name=moveto
[filter]
id=Diana
[/filter]
[message]
speaker=Diana
message= _ "By the way, thank you for letting me study a few of your magic books Derak. I think I know now how sumoning works. But I think I'll try to create an own unit"
[/message]
[modify_unit]
[filter]
id=Diana
[/filter]
canrecruit=yes
recruit=Icy_sandmaid
[/modify_unit]
[/event]
Re: Its me again with a new question:-)
recruit is not a property of a unit, it is the property of an entire side. Check out the usage of extra_recruit on UnitWML.
Re: Its me again with a new question:-)
Correction: SingleUnitWML.Dugi wrote:UnitWML
Re: Its me again with a new question:-)
Thx!! There were also a few other very interesting things
Re: Its me again with a new question:-)
So while working (more thinking about than doin something) on my campaign a new question appeared: how can i let my leader (or any other unit) move (not teleport) to a certein place taking a certain way? I couldnt find any possibly working code/make my own...
Re: Its me again with a new question:-)
There is a tag named [move_unit_fake] for it. Use the {MOVE_UNIT id=blablabla x y} macro, that will make it even easier.