Design Questions

Discussion and development of scenarios and campaigns for the game.

Moderator: Forum Moderators

Post Reply
peet
Posts: 238
Joined: October 30th, 2006, 4:38 am
Location: Toronto
Contact:

Design Questions

Post by peet »

Hi, guys.

I've been playing BfW for a month now and I now want to try some tinkering. The system looks pretty simple, but I have some questions.

1. Can a unit have the same trait more than once?

I am looking at having lots of interesting magical equipment but I don't want the same character being able to use mutiple magic swords, for example - you can only get the bonus from one weapon type at a time.

So I was thinking I would add traits like SWORD and BOW to indicate those units have those weapon types, then use a filter to prevent a unit with the same weapon type from picking it up.

Would this work? Or is there a better way of doing it?

I also want to make sure the same unit doesn't get 6 potions of strength and have them all stack.

2. Can one attack have more than one special? Like an attack that is both Magical and Slow.

Some of the ideas for magic equipment would grant a weapon special power and still need to be able to be used by someone who already had one. Like for example, an Elvish Marksman picks up some poison arrows. Hos bow attack becomes both poison and marksman. Would that cause an error?

3. Can I use side=1 as a filter?

In a campaign I'd like to make sure that only the human player can pick up magic items.

4. Is there a way to add an attack to a character and have that attack increase as the character levels up? Is there some sort of level variable I can use?

Existing items are pretty powerful but always stay the same regardless of level, because they add an attack that isn't part of the unit's profile. I'd like to include items that aren't such a big deal but they improve with the character's skill.

5. Why does an object have an id= tag?

This confused me because there is also a name= tag. But since it's part of the object statement I gather it's important.

Thanks in advance for your help!

Regards,
Peet
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Design Questions

Post by zookeeper »

Yes on the first three. Some will be a bit tricky to do (if you're a beginner), but all are certainly doable.
peet wrote: 4. Is there a way to add an attack to a character and have that attack increase as the character levels up? Is there some sort of level variable I can use?

Existing items are pretty powerful but always stay the same regardless of level, because they add an attack that isn't part of the unit's profile. I'd like to include items that aren't such a big deal but they improve with the character's skill.
Well, there isn't a way of doing this in an easy and simple way, but it is doable in a complicated and messy way. I'd suggest leaving items like this for later, to be done once you have done most of the rest (and not rely on being able to do this in a smooth manner or maybe even at all either, since it might get very messy).
peet wrote: 5. Why does an object have an id= tag?

This confused me because there is also a name= tag. But since it's part of the object statement I gather it's important.
My personal opinion is that the id= of objects is mostly a relic from the old days when things were done in a much simpler manner, and it isn't really required for anything. What it does is prevent the object from being picked up twice in the same scenario (when an [object] with id=foo is given to a unit in a scenario, no other units in that scenario can get either the same or another [object] with id=foo). Nowadays, you should have a dialogue option for letting the unit that stepped on the hex pick the item up or not, which requires another kind of check, which at the same time invalidates the need to use id= to do the job.
peet
Posts: 238
Joined: October 30th, 2006, 4:38 am
Location: Toronto
Contact:

Post by peet »

Thanks for your help, Zookeeper!

I did notice that in the WML wiki it said that an attack cannot have more than one special. Is that out of date?

As for #4, it occurred to me that I could do it based on unit type, since each time a unit levels up it changes its name. But you're right... I'll leave it for later. I might not bother, since I've come up with a simple way of adjusting "compatible" units.

Peet
User avatar
JW
Posts: 5046
Joined: November 10th, 2005, 7:06 am
Location: Chicago-ish, Illinois

Post by JW »

peet wrote:Thanks for your help, Zookeeper!

I did notice that in the WML wiki it said that an attack cannot have more than one special. Is that out of date?
Yes it is. It has been possible since 1.1.8 or so.
peet
Posts: 238
Joined: October 30th, 2006, 4:38 am
Location: Toronto
Contact:

Post by peet »

Cool. That will be nice.

Now, here's a question I'm having trouble with.
How do I add a trait to an existing unit?

Note that I don't want to just change the stats... I want the trait name to show up.

It looks like I have to save a unit as a variable, then mess with the variable. From the wiki it looks like you need to use [modifications] but there's nothing in there about the syntax of using [modifications] within the [set_variable] function.

Also, how do I use a filter to detect if a unit has a particular trait?

Thanks in advance...

Peet
Oreb
Posts: 1278
Joined: September 9th, 2005, 12:30 am
Location: Queensland, Australia

Post by Oreb »

Example from a Campaign in Progress:

Code: Select all

[side]
side=1
controller=human
team_name=good
{GOLD 200 180 160}
type=Wild Elf Veiledblade
[modifications]
{TRAIT_STRONG}
{TRAIT_QUICK}
[/modifications]
description=Vaniyera
canrecruit=1
{NAME_UNIT Leithan (Wild Elf Thunderblade) 1 15 16 ({TRAIT_RESILIENT}) ({TRAIT_INTELLIGENT})}
[/side]
I am Oreb, Lord of the Darthien
Give your comments to the World of Orbivm
peet
Posts: 238
Joined: October 30th, 2006, 4:38 am
Location: Toronto
Contact:

Post by peet »

Wow, that was quick!

OK, Oreb, I appreciate the help, but I don't think you understand my problem.

I know how to add a trait when defining or creating a unit. But simply using [modifications] within an [effect] tag does not work. Trust me, I've tried it. There needs to be an apply_to= and there is no apply_to=traits or apply_to=unit.

Essentially I want to have a potion that permanently confers the trait 'quick' on a unit when they drink it. So it needs to not work on units that are already 'quick' and it needs to make 'quick' show up under traits.

Peet
Oreb
Posts: 1278
Joined: September 9th, 2005, 12:30 am
Location: Queensland, Australia

Post by Oreb »

peet wrote:Essentially I want to have a potion that permanently confers the trait 'quick' on a unit when they drink it. So it needs to not work on units that are already 'quick' and it needs to make 'quick' show up under traits.

Peet
Ahh. Then I am not able to help you.
I am Oreb, Lord of the Darthien
Give your comments to the World of Orbivm
nightcrawler
Posts: 99
Joined: September 17th, 2006, 3:59 pm
Location: the skies of atlantis

Post by nightcrawler »

peet wrote:Wow, that was quick!

OK, Oreb, I appreciate the help, but I don't think you understand my problem.

I know how to add a trait when defining or creating a unit. But simply using [modifications] within an [effect] tag does not work. Trust me, I've tried it. There needs to be an apply_to= and there is no apply_to=traits or apply_to=unit.

Essentially I want to have a potion that permanently confers the trait 'quick' on a unit when they drink it. So it needs to not work on units that are already 'quick' and it needs to make 'quick' show up under traits.

Peet
You should be able to store the unit and manually poke its values. I have long since forgotten exactly how. Also, please delete your animated avatar.
"Then I'd prefer you refer to it as 'The Midlands'"

If I'm supposed to fight creeping biggerism, then why is it a game feature?
peet
Posts: 238
Joined: October 30th, 2006, 4:38 am
Location: Toronto
Contact:

Post by peet »

nightcrawler wrote:You should be able to store the unit and manually poke its values. I have long since forgotten exactly how.
Any chance someone knows how to do this? Perhaps someone could post an example of some code that does this. I'd appreciate it!
nightcrawler wrote:Also, please delete your animated avatar.
OK, Done. Are they not allowed?

Peet
User avatar
Eleazar
Retired Terrain Art Director
Posts: 2481
Joined: July 16th, 2004, 1:47 am
Location: US Midwest
Contact:

Post by Eleazar »

peet wrote:
nightcrawler wrote:Also, please delete your animated avatar.
OK, Done. Are they not allowed?
We generally consider them to be in bad taste. Since having them will annoy the many of the regulars, it's in everybody's interest that people seeking help here don't use them.
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
User avatar
Eleazar
Retired Terrain Art Director
Posts: 2481
Joined: July 16th, 2004, 1:47 am
Location: US Midwest
Contact:

Post by Eleazar »

peet wrote:
nightcrawler wrote:Also, please delete your animated avatar.
OK, Done. Are they not allowed?
We generally consider them to be in bad taste. Since having them will annoy the many of the regulars, it's in everybody's interest that people seeking help here don't use them.
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
Darth Fool
Retired Developer
Posts: 2633
Joined: March 22nd, 2004, 11:22 pm
Location: An Earl's Roadstead

Post by Darth Fool »

peet wrote:
nightcrawler wrote:You should be able to store the unit and manually poke its values. I have long since forgotten exactly how.
Any chance someone knows how to do this? Perhaps someone could post an example of some code that does this. I'd appreciate it!
Well, one way to do this is to have an event where you give an object to the unit. For example here: http://www.wesnoth.org/forum/viewtopic. ... 535#194535
I made an object which adds an effect which changes the color of the unit's hair. Look at items.cfg or effect WML in the wml reference for more ideas of things that you can do, or look through other campaigns scenarios to find how they do things. Also, scenario-test.cfg has a whole bunch of these examples for testing purposes. You can start it by running wesnoth with a -t option.

I am sure that there are other ways to add modifications to units as well, but I am not one of the WML masters. If you really need help on a particular problem, and can't find it in the WML reference or by looking at other examples, post to the WML workshop.
peet
Posts: 238
Joined: October 30th, 2006, 4:38 am
Location: Toronto
Contact:

Post by peet »

Darth Fool wrote:Well, one way to do this is to have an event where you give an object to the unit. For example here: http://www.wesnoth.org/forum/viewtopic. ... 535#194535
I made an object which adds an effect which changes the color of the unit's hair.
OK, right now I am using objects but I am only able to add the effect of the trait, not the trait itself. Such as adding one point of damage to attacks... that's easy. But I want to give the unit the trait "strong," not just add a point of damage, because then I will (probably) be able to make sure that the unit cannot collect the same trait multiple times.
Darth Fool wrote:If you really need help on a particular problem, and can't find it in the WML reference or by looking at other examples, post to the WML workshop.
OK, I'll do that!

Peet
Post Reply