Adding Xp as an Event

The place to post your WML questions and answers.

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.
Post Reply
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Adding Xp as an Event

Post by turin »

i have a problem with one of the scenarios i am making. i want to make it so that every time you get in combat or kill someone, you get double experience. i also want you to get xp when something else happens. is there a way to give a unit xp during an eveny, such as:

[effect]
experience=+8
[/effect]

specifying what unit recieves the xp and how much is recieved. is there any way to do this?
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
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

There is currently no way to do this.

We may have a modifier that allows you to specify that all units in a scenario get more experience sometime in the future.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
Nyxl
Posts: 25
Joined: February 12th, 2006, 6:21 pm
Contact:

Post by Nyxl »

Greetings. I hope I am not resurrecting a thread whereas the same topic has been discussed elsewhere (the searches I made all led here).

I was interested in the experience issue, for I think one character might gain experience not only during fights, but also when performing some other "task", such as finding secret passage, finding treasures, disarming traps, etc.

I have written the following macro to add experience to a character at a given location (to associate it to a "moveto" event) :

Code: Select all

#define ADD_XP X Y AMOUNT
	[store_unit]
		[filter]
			x={X}
			y={Y}
		[/filter]
		variable="stored_unit"
	[/store_unit]
	[set_variable]
		name=stored_unit.experience
		add={AMOUNT}
	[/set_variable]
	[unstore_unit]
		variable="stored_unit"
	[/unstore_unit]
#enddef
It works fine, but now I'm facing a trap in the experience adding stuff : this code does not trigger the advancement condition.

I've explored a few pists to perform this operation "manually", without success so far. I may have missed something, but is it possible to retrieve the experience attribute from a <unit>.cfg file ? Or to trigger the advancement in a cleaner way ?

Thank you in advance for any contribution.
Post Reply