coding
Moderator: Forum Moderators
You can't trigger a level-up with WML. What you can do is simply change the unit's type to another one, but in this case the player can't have a choice between level-up options and you must also know the unit's current type beforehand so you know what unit type to change into. For most campaign uses I can think of this is probably enough, however. So yes, what the original poster wanted to do is very likely possible.romnajin wrote:You can just do that with WML, you don't need to code it.
-
- Posts: 23
- Joined: January 26th, 2006, 11:26 pm
- Location: on my computer, at school, and asleep
Iwant to give the person playing the campaign of the type of unit he is. (Possible choices: Swordsman, Archer, Horseman, Mage.)zookeeper wrote:You can't trigger a level-up with WML. What you can do is simply change the unit's type to another one, but in this case the player can't have a choice between level-up options and you must also know the unit's current type beforehand so you know what unit type to change into. For most campaign uses I can think of this is probably enough, however. So yes, what the original poster wanted to do is very likely possible.romnajin wrote:You can just do that with WML, you don't need to code it.
Romnajin: yes, I mean WML.
Here's a bit of code from one of my scenarios, where you choose your hero, and the keep is on 37,2. Ignore the "begin with gold" bits. Unit-description is the name of the guy....
You might need to tweak it (alot maybe) to get this working... So I suggest you use this as example, not template.
You might need to tweak it (alot maybe) to get this working... So I suggest you use this as example, not template.
Code: Select all
[event]
name=start
first_time_only=no
[filter]
side=1
[/filter]
[message]
speaker=narrator
message=_ "What kind of Hero are you?"
[option]
message=_ "Commander (begins with 100 gold)"
[command]
[unit]
type=Commander
description=Player1
x=37
y=2
side=1
user_description=Hero
upkeep=full
moves=1
[/unit]
[/command]
[/option]
[option]
message=_ "Longbowman (begins with 130 gold)"
[command]
[unit]
type=Longbowman
description=Player1
x=37
y=2
side=1
user_description=Hero
upkeep=full
moves=1
[/unit]
[/command]
[/option]
[option]
message=_ "Red Mage (begins with 50 gold)"
[command]
[unit]
type=Red Mage
description=Player1
x=37
y=2
side=1
user_description=Hero
upkeep=full
moves=1
[/unit]
[/command]
[/option]
[option]
message=_ "White Mage (begins with no gold)"
[command]
[unit]
type=White Mage
description=Player1
x=37
y=2
side=1
user_description=Hero
upkeep=full
moves=1
[/unit]
[/command]
[/option]
[option]
message=_ "Swordsman (begins with 100 gold)"
[command]
[unit]
type=Swordsman
description=Player1
x=37
y=2
side=1
user_description=Hero
upkeep=full
moves=1
[/unit]
[/command]
[/option]
[option]
message=_ "Pikeman (begins with 110 gold)"
[command]
[unit]
type=Pikeman
description=Player1
x=37
y=2
side=1
user_description=Hero
upkeep=full
moves=1
[/unit]
[/command]
[/option]
[/message]
[/event]
Why did the fish laugh? Because the sea weed.