Flameslash's Questions - Is it possible to define the traits of recruits?
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.
- Flameslash
- Posts: 633
- Joined: December 21st, 2008, 12:29 pm
Flameslash's Questions - Is it possible to define the traits of recruits?
Okay so I decided to make one thread for my questions from now on, rather than making loads over and over.
Today I'm wondering whether it's possible to define the traits of recruits. I'm making a chase scenario, and I was wondering if I could make it so that all units recruited by the side doing the chasing have the 'Quick' trait.
Today I'm wondering whether it's possible to define the traits of recruits. I'm making a chase scenario, and I was wondering if I could make it so that all units recruited by the side doing the chasing have the 'Quick' trait.
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Flameslash's Questions - Is it possible to define the traits of recruits?
Not exactly, but it's easy to create a unit with whatever traits you want. So, you can check all recruited units to see if they have quick. If one of them doesn't, you can kill it and manually replace it with a [unit] that does. (If you define a unit with only one trait, the other trait will be filled in automatically.)
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
- Flameslash
- Posts: 633
- Joined: December 21st, 2008, 12:29 pm
Re: Flameslash's Questions - Is it possible to define the traits of recruits?
Hmm, that seems a pretty convoluted way of doing it. It could work, sure, but I think I'll go with something simpler and just give the chaser more distance to catch up over. Thanks anyway.
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Flameslash's Questions - Is it possible to define the traits of recruits?
Okay, if you say so. Mainline campaigns include some far more convoluted code than that though. Sometimes WML doesn't leave you a lot of options. That said, giving the quick trait might not be a good idea anyway because it would just seem like good luck to the player. You might consider having the leader hand out a potion that increases speed for the scenario or something like that. (There's precedent for that with holy water on undead scenarios.) Changing the map would still be the easiest solution.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
- Flameslash
- Posts: 633
- Joined: December 21st, 2008, 12:29 pm
Re: Flameslash's Questions - Is it possible to define the traits of recruits?
A bit convoluted is my way of saying that it's probably beyond my ability-level at the moment. Just look at the amount of threads I've made in this forum recently, clearly I'm not very good.
Worth noting that the chaser is AI-controlled, so I'm not sure if the AI could handle the potion option.
I suppose a third option could be to create a custom unit that's simply a clone of the base unit, but with an additional MP.
Worth noting that the chaser is AI-controlled, so I'm not sure if the AI could handle the potion option.
I suppose a third option could be to create a custom unit that's simply a clone of the base unit, but with an additional MP.
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Flameslash's Questions - Is it possible to define the traits of recruits?
That's probably the simplest one actually. I didn't test this, but it would be something like:Flameslash wrote: ↑April 15th, 2018, 8:17 pmWorth noting that the chaser is AI-controlled, so I'm not sure if the AI could handle the potion option.
Code: Select all
[event]
name=recruit
first_time_only=no
[filter]
side=2
[/filter]
[object]
silent=yes
[effect]
apply_to=movement
increase=1
[/effect]
[/object]
[/event]
...
[message]
speaker=leader_of_side_1
message= _ "Uh, oh. That stuff they are drinking is called coffee. It makes you run faster, so we'd better hurry!"
[/message]
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
- Flameslash
- Posts: 633
- Joined: December 21st, 2008, 12:29 pm
Re: Flameslash's Questions - Is it possible to define the traits of recruits?
Ah, when you said a potion I was picturing a pick-up on the map that the AI units would have to move to. That solution could work very elegantly, actually, thank you.
Re: Flameslash's Questions - Is it possible to define the traits of recruits?
A version which also lets the player see that these units have drunk a quickness potion in the right-hand-side status bar.
Code: Select all
[event]
name=recruit
first_time_only=no
[filter]
side=2
[/filter]
[object]
silent=yes
duration=forever
[effect]
apply_to=movement
increase=1
[/effect]
# the second effect just adds text to the unit's stats on the
# right-hand side of the screen
[effect]
apply_to=new_ability
[abilities]
[dummy]
id=example_quick_potion
name="magic quickness"
description="All of Big Bad's recruits have drunk a magic potion which makes them chase you faster"
[/dummy]
[/abilities]
[/effect]
[/object]
[/event]
[code]