Dialogue between characters
Moderator: Forum Moderators
Dialogue between characters
There is a scenario, where a player fights against 2 enemy leaders.
I try to make the dialogue between MyLeader and Unit, that killed the second enemy leader (additional condition: after the death of first enemy leader)
The code:
So, how can I do it properly?
An additional question is: "What IDE should I use for WML?" I use notepad, but I can't see the colored syntax.
I try to make the dialogue between MyLeader and Unit, that killed the second enemy leader (additional condition: after the death of first enemy leader)
The code:
Code: Select all
[event]
name="last breath"
first_time_only=no
[filter]
id=EnemyLeader
id=EnemyLeader2
[/filter]
[filter_second]
side=2
[/filter_second]
[message]
speaker=second_unit
message= _ "Message"
[/message]
[message]
speaker=MyLeader
message= _ "Message."
[/message]
[/event]
An additional question is: "What IDE should I use for WML?" I use notepad, but I can't see the colored syntax.
Re: Dialogue between characters
Code: Select all
[event]
name=die
first_time_only=no
[filter]
id=EnemyLeader
[or]
id=EnemyLeader2
[/or]
[/filter]
# I guess you are side=1
[filter_second]
side=1
[/filter_second]
[message]
speaker=second_unit
message= _ "Message"
[/message]
[message]
speaker=MyLeader
message= _ "Message."
[/message]
[/event]
viewtopic.php?t=44392
I recommend Notepad++ instead of Notepad
Last edited by Straff on November 22nd, 2021, 6:15 pm, edited 1 time in total.
Re: Dialogue between characters
Straff wrote: ↑November 22nd, 2021, 4:49 pmThank you very much.Code: Select all
[event] name=die first_time_only=no [filter] id=EnemyLeader [or] id=EnemyLeader2 [/or] [/filter] # I guess yo are side=1 [filter_second] side=1 [/filter_second] [message] speaker=second_unit message= _ "Message" [/message] [message] speaker=MyLeader message= _ "Message." [/message] [/event]
viewtopic.php?t=44392
I recommend Notepad++ instead of Notepad
- Spannerbag
- Posts: 535
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: Dialogue between characters
I don't know how you have set up the game but the following should work whether the enemy leaders are on the same or different sides.Kadel_007 wrote: ↑November 22nd, 2021, 4:27 pm There is a scenario, where a player fights against 2 enemy leaders.
I try to make the dialogue between MyLeader and Unit, that killed the second enemy leader (additional condition: after the death of first enemy leader)
The code:So, how can I do it properly?Code: Select all
[event] name="last breath" first_time_only=no [filter] id=EnemyLeader id=EnemyLeader2 [/filter] [filter_second] side=2 [/filter_second] [message] speaker=second_unit message= _ "Message" [/message] [message] speaker=MyLeader message= _ "Message." [/message] [/event]
An additional question is: "What IDE should I use for WML?" I use notepad, but I can't see the colored syntax.
The logic should also work if the enemies are killed by an ai (non-player) unit and for 1 or more enemy leaders; the last enemy leader to die will always fire this event. (If you want, say, the second leader to die to fire this event just alter
count
in [have_unit]
accordingly.)You can extend the logic if you want to, e.g. to issue different messages depending on the side of the unit that killed the enemy leader.
Here, regardless of which unit kills the (only remaining) enemy leader:
- the second (killing) unit always says "
Killing_Unit_Message
"- the player leader always says "
Player_Leader_Message
"There are many variations and different ways to do what you want so doubtless other folk will post other examples.
Just choose which one works best for you
<<enemy_sides>>
is the list of sides containing the enemy leader(s) you want to include in this event (e.g. 2,3
).Code: Select all
[event]
name="last breath"
[filter_condition]
[have_unit]
side=<<enemy_sides>>
canrecruit=yes
count=0
[/have_unit]
[/filter_condition]
[message]
speaker=second_unit
message= _ "Killing_Unit_Message"
[/message]
[message]
speaker=MyLeader
message= _ "Player_Leader_Message"
[/message]
[/event]
Edit: under some circumstances this might not work as you want it to, e.g. if the death of the last leader spawns/reveals another.
I'm assuming this isn't the case here.
Cheers!
--Spannerbag
Re: Dialogue between characters
Hah, Thank You too. I managed on my own with another code, but I will try this tooSpannerbag wrote: ↑November 23rd, 2021, 2:33 pmI don't know how you have set up the game but the following should work whether the enemy leaders are on the same or different sides.Kadel_007 wrote: ↑November 22nd, 2021, 4:27 pm There is a scenario, where a player fights against 2 enemy leaders.
I try to make the dialogue between MyLeader and Unit, that killed the second enemy leader (additional condition: after the death of first enemy leader)
The code:So, how can I do it properly?Code: Select all
[event] name="last breath" first_time_only=no [filter] id=EnemyLeader id=EnemyLeader2 [/filter] [filter_second] side=2 [/filter_second] [message] speaker=second_unit message= _ "Message" [/message] [message] speaker=MyLeader message= _ "Message." [/message] [/event]
An additional question is: "What IDE should I use for WML?" I use notepad, but I can't see the colored syntax.
The logic should also work if the enemies are killed by an ai (non-player) unit and for 1 or more enemy leaders; the last enemy leader to die will always fire this event. (If you want, say, the second leader to die to fire this event just altercount
in[have_unit]
accordingly.)
You can extend the logic if you want to, e.g. to issue different messages depending on the side of the unit that killed the enemy leader.
Here, regardless of which unit kills the (only remaining) enemy leader:
- the second (killing) unit always says "Killing_Unit_Message
"
- the player leader always says "Player_Leader_Message
"
There are many variations and different ways to do what you want so doubtless other folk will post other examples.
Just choose which one works best for you
<<enemy_sides>>
is the list of sides containing the enemy leader(s) you want to include in this event (e.g.2,3
).
Hope this helps/makes sense!Code: Select all
[event] name="last breath" [filter_condition] [have_unit] side=<<enemy_sides>> canrecruit=yes count=0 [/have_unit] [/filter_condition] [message] speaker=second_unit message= _ "Killing_Unit_Message" [/message] [message] speaker=MyLeader message= _ "Player_Leader_Message" [/message] [/event]
Edit: under some circumstances this might not work as you want it to, e.g. if the death of the last leader spawns/reveals another.
I'm assuming this isn't the case here.
Cheers!
--Spannerbag