Is this possible?
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.
-
- Posts: 3
- Joined: April 2nd, 2005, 6:17 am
- Location: Hiding in your closet. Seriously, check.
Is this possible?
I came up with a few ideas that might be possible, but here's the first:
- Would it be possible to write something like an if-statement in a scenario or character file that would, for instance, create a dwarven fighter who only berserk-attacked trolls, or an elf who only had marksman against orcs, or a wizard who's so afraid of the undead that he can't even damage them?
It might be that this question would fit better in another topic, but I didn't really see anything along the lines of "Creating Character Quirks".
- Would it be possible to write something like an if-statement in a scenario or character file that would, for instance, create a dwarven fighter who only berserk-attacked trolls, or an elf who only had marksman against orcs, or a wizard who's so afraid of the undead that he can't even damage them?
It might be that this question would fit better in another topic, but I didn't really see anything along the lines of "Creating Character Quirks".
"What would you do if you knew you could not fail?"
"Take advantage of Anime Physics Rule # 39 - 'Sword always beats Gun.'"
"Take advantage of Anime Physics Rule # 39 - 'Sword always beats Gun.'"
Man i`d love to see something like that happen...
Read about the adventurers of my pen & paper RPG group
"How could drops of water know themselves to be a river? Yet the river flows on." - Guess who?
"How could drops of water know themselves to be a river? Yet the river flows on." - Guess who?
-
- Posts: 3
- Joined: April 2nd, 2005, 6:17 am
- Location: Hiding in your closet. Seriously, check.
Okay, so maybe that's not possible yet.
Second question: am I limited to the movement types and races defined in GAME.CFG? I know I could be all sacreliegious and write in new types, but then if I wanted to distribute a campaign with those new types, then that part wouldn't work in other people's computers. Can I define stuff like that inside a unit's file?
Second question: am I limited to the movement types and races defined in GAME.CFG? I know I could be all sacreliegious and write in new types, but then if I wanted to distribute a campaign with those new types, then that part wouldn't work in other people's computers. Can I define stuff like that inside a unit's file?
"What would you do if you knew you could not fail?"
"Take advantage of Anime Physics Rule # 39 - 'Sword always beats Gun.'"
"Take advantage of Anime Physics Rule # 39 - 'Sword always beats Gun.'"
I believe you can, but I don't know exactly how.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
And I hate stupid people.
The World of Orbivm
No you`re not.Kairo Duo wrote:Okay, so maybe that's not possible yet.
Second question: am I limited to the movement types and races defined in GAME.CFG? I know I could be all sacreliegious and write in new types, but then if I wanted to distribute a campaign with those new types, then that part wouldn't work in other people's computers. Can I define stuff like that inside a unit's file?
Make an empty cfg.file and put your movetype there inside units File.
Read about the adventurers of my pen & paper RPG group
"How could drops of water know themselves to be a river? Yet the river flows on." - Guess who?
"How could drops of water know themselves to be a river? Yet the river flows on." - Guess who?
-
- Posts: 873
- Joined: July 4th, 2004, 9:14 pm
- Location: My imagination
- Contact:
No, you can make your own in campaigns (or if everyone gets the same cfg files, in multiplayer).Kairo Duo wrote:am I limited to the movement types and races defined in GAME.CFG?
Code: Select all
#somewhere within your campaign ifdef
[+units]
[movement_type]
#...
[/movement_type]
[race]
#...
[/race]
#...
[/units]
Play a Silver Mage in the Wesvoid campaign.
Re: Is this possible?
Not quite, but you might fake some of the effects just using some sufficiently bizarre WML hackery. For example, you can trigger an event on a particular type of attack, see who's involved, and then fiddle with (some of) the characteristics of the units involved. For example, for the wizard, you might remember the undead target's HP, give it lots more HP to guarantee it won't be killed, and after the attack, reset it back to its original HP. Or for the elf, maybe you can find the selected attack, give it the marksman special just for the duration of the attack, and catch another event to remove the special at the end of the attack, or the start of the next turn. See http://wesnoth.slack.it/?EffectWML for some of the things you can fiddle with.Kairo Duo wrote:I came up with a few ideas that might be possible, but here's the first:
- Would it be possible to write something like an if-statement in a scenario or character file that would, for instance, create a dwarven fighter who only berserk-attacked trolls, or an elf who only had marksman against orcs, or a wizard who's so afraid of the undead that he can't even damage them?
It might be that this question would fit better in another topic, but I didn't really see anything along the lines of "Creating Character Quirks".
Disclaimer: I haven't checked whether the game engine will take any notice of changes made to units inside event handlers; it's possible they won't be noticed, if the engine has already evaluated probabilities & such. But you can try it and see
"As for the future, your task is not to foresee it, but to enable it" -- Antoine de-Saint Exupery.
- Elvish_Pillager
- Posts: 8137
- Joined: May 28th, 2004, 10:21 am
- Location: Everywhere you think, nowhere you can possibly imagine.
- Contact:
Changing attacks is all well and good, but there is no event to change it back. That's right, there's no "after_attack" event, which is the one WML feature I have found myself wishing for most often.
It is possible to change it soon enough that no actual effect happens, but it will still confuse the AI.
It is possible to change it soon enough that no actual effect happens, but it will still confuse the AI.
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
Maybe change it back at the start the next side's turn? Not quite what you want, and it means keeping track of stuff from each event that might have triggered so that the next-turn event knows what to clean up, but it might suffice. Or use a moveto event, which are probably the most frequent of all ..Elvish Pillager wrote:Changing attacks is all well and good, but there is no event to change it back. That's right, there's no "after_attack" event, which is the one WML feature I have found myself wishing for most often.
These tricks might have the interesting effect of showing the player what the attack used really was; for example, the marksman special would show up when the user moused over the unit that had made the attack.
"As for the future, your task is not to foresee it, but to enable it" -- Antoine de-Saint Exupery.