Add and sustract 2 custom properties.

Started by Fedx, Sat 02/05/2009 03:17:19

Previous topic - Next topic

Fedx

I'm doing this Yu-Gi-Oh kind of game, and I was wondering how can I make this:
I created a custom property called AttackPower. I have a monster with 8000 of AttackPower and another with 6000. I also have a bool global variable called IsMonsterAtk set to False. I know I have to put in the rep_exec a function that checks if IsMonsterAtk is True, and if so, check wich card is atacking and wich is defending, do the sustraction and declare a winner. But how do I do that?

BTW, the cards are inventory items, there's an inventory below the playable field.
- The gamer doesn't dies... he respawns -

Trent R

Well, you can't change properties at run-time (I assume you used the built in schema).. but there's many ways to so this. Structs, arrays, local vars, and my personal fav-extender functions.

I'd suggest creating another script (as if doing a module) and creating variables (or a dynamic array-see manual entry) in the module script. Create Get and Set (and Mod, if you want) functions that change and return those variables. Add the import declarations in the module header and you should be done.


~Trent
PS-Yeah I know that didn't explain much, but I'm tired now. I'll probably come back later with a script or something, or someone else may explain a better way.
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

Fedx

Ok! Thanks, I will at least try to do that.
- The gamer doesn't dies... he respawns -

SMF spam blocked by CleanTalk