Transferring special units from one scenario to another

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

Post Reply
quartex
Inactive Developer
Posts: 2258
Joined: December 22nd, 2003, 4:17 am
Location: Boston, MA

Transferring special units from one scenario to another

Post by quartex »

I see examples on how to make a unit disseappear at the end of one scenario and bring him back in another, such as is done with the Morimeru (sorry, the white mage in Hero to the Throne).

But I noticed that while the [unit] tag in scenarios allows you to set a unit's HP, it doesn't allow you to set their experience. If I [kill] a special unit then create him again in another scenario, he'll lose his experience. Would it be possible to record his current experience and then create him again in another scenario with that experience?

I know the obvious solution is to let the player just recall the unit, but I want to be able to have the unit leave and come back later in the campaign and retain his experience. Is this possible?
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

You can achieve this effect using [store_unit] and [unstore_unit]

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
quartex
Inactive Developer
Posts: 2258
Joined: December 22nd, 2003, 4:17 am
Location: Boston, MA

Post by quartex »

Thanks! Very cool functionality!
Shade
Posts: 1111
Joined: April 18th, 2004, 11:17 pm

Post by Shade »

quartex wrote:Thanks! Very cool functionality!
What makes it doubly cool is that once the unit is stored you can easily manipulate it's variables. . . If you're wondering what all of those variables are, store a unit, save the game, and look over the save in a text editor. . . Fun, fun, fun.
Note to forum users: You are in a maze of twisty little passages
Invisible Philosopher
Posts: 873
Joined: July 4th, 2004, 9:14 pm
Location: My imagination
Contact:

Post by Invisible Philosopher »

SingleUnitWML in the wiki (which [unit] uses) is also the syntax for stored units (including ones in savefiles) and should include experience. I'll add it to the wiki now.
Play a Silver Mage in the Wesvoid campaign.
Post Reply