Design Questions
Moderator: Forum Moderators
Design Questions
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
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
Re: Design Questions
Yes on the first three. Some will be a bit tricky to do (if you're a beginner), but all are certainly doable.
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: 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.
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 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.
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
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
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
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
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
Give your comments to the World of Orbivm
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
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
Ahh. Then I am not able to help you.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
I am Oreb, Lord of the Darthien
Give your comments to the World of Orbivm
Give your comments to the World of Orbivm
-
- Posts: 99
- Joined: September 17th, 2006, 3:59 pm
- Location: the skies of atlantis
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.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
"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?
If I'm supposed to fight creeping biggerism, then why is it a game feature?
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:You should be able to store the unit and manually poke its values. I have long since forgotten exactly how.
OK, Done. Are they not allowed?nightcrawler wrote:Also, please delete your animated avatar.
Peet
- Eleazar
- Retired Terrain Art Director
- Posts: 2481
- Joined: July 16th, 2004, 1:47 am
- Location: US Midwest
- Contact:
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.peet wrote:OK, Done. Are they not allowed?nightcrawler wrote:Also, please delete your animated avatar.
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
-> What i might be working on
Attempting Lucidity
- Eleazar
- Retired Terrain Art Director
- Posts: 2481
- Joined: July 16th, 2004, 1:47 am
- Location: US Midwest
- Contact:
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.peet wrote:OK, Done. Are they not allowed?nightcrawler wrote:Also, please delete your animated avatar.
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
-> What i might be working on
Attempting Lucidity
-
- Retired Developer
- Posts: 2633
- Joined: March 22nd, 2004, 11:22 pm
- Location: An Earl's Roadstead
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#194535peet wrote: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:You should be able to store the unit and manually poke its values. I have long since forgotten exactly how.
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.
"you can already do that with WML"
Fight Creeeping Biggerism!
http://www.wesnoth.org/forum/viewtopic. ... 760#131760
http://www.wesnoth.org/forum/viewtopic. ... 1358#11358
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: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, I'll do that!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.
Peet