Is this possible?

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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.
Post Reply
Kairo Duo
Posts: 3
Joined: April 2nd, 2005, 6:17 am
Location: Hiding in your closet. Seriously, check.

Is this possible?

Post by Kairo Duo »

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".
"What would you do if you knew you could not fail?"
"Take advantage of Anime Physics Rule # 39 - 'Sword always beats Gun.'"
Disto
Posts: 2039
Joined: November 1st, 2004, 7:40 pm
Location: Cambridge, UK

Post by Disto »

This would possibly fit in the ideas topic but still, i don't personally know. But if the devs wanted it i'm sure it would be possible.
Creator of A Seed of Evil
Creator of the Marauders
Food or Wesnoth? I'll have Wesnoth
Burnsaber
Posts: 322
Joined: August 1st, 2004, 6:10 pm
Location: Kuopio, finland

Post by Burnsaber »

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?
Kairo Duo
Posts: 3
Joined: April 2nd, 2005, 6:17 am
Location: Hiding in your closet. Seriously, check.

Post by Kairo Duo »

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?
"What would you do if you knew you could not fail?"
"Take advantage of Anime Physics Rule # 39 - 'Sword always beats Gun.'"
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

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
Burnsaber
Posts: 322
Joined: August 1st, 2004, 6:10 pm
Location: Kuopio, finland

Post by Burnsaber »

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?
No you`re not.
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?
romnajin
Posts: 1067
Joined: February 26th, 2005, 7:26 pm
Contact:

Post by romnajin »

Or just add on to game.cfg. that's what I did for my shapechanger, my incredibly unbalanced unit that is fun to blast the ai with.
Sorry for the meaningless post
Invisible Philosopher
Posts: 873
Joined: July 4th, 2004, 9:14 pm
Location: My imagination
Contact:

Post by Invisible Philosopher »

Kairo Duo wrote:am I limited to the movement types and races defined in GAME.CFG?
No, you can make your own in campaigns (or if everyone gets the same cfg files, in multiplayer).

Code: Select all

#somewhere within your campaign ifdef
[+units]
	[movement_type]
	#...
	[/movement_type]
	[race]
	#...
	[/race]
#...
[/units]
Play a Silver Mage in the Wesvoid campaign.
CyberJack
Posts: 161
Joined: November 25th, 2004, 2:50 pm
Location: UK

Re: Is this possible?

Post by CyberJack »

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".
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.

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.
User avatar
Elvish_Pillager
Posts: 8129
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

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'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.
CyberJack
Posts: 161
Joined: November 25th, 2004, 2:50 pm
Location: UK

Post by CyberJack »

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.
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 ..

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.
Post Reply