News:

MFG's Character of the Month: September 2026 Voting

Main Menu

Variable reading issue

Started by Liero, August 27, 2007, 11:13:11 AM

Previous topic - Next topic

Liero

Is there a way to read one of player 2's variables?

For example, I want an attack to do a certain amount of damage depending on player2's variable value. 

So..

if player2's var(10) = 0  then do 5 damage
if player2's var(10) = 1  then do 10 damage

etc.

Is this possible?

Cybaster

Yes, it's possible, though I've never done it, therefore I can't remember the code exactly.

Nevertheless, you'd be wise to do it only :
- in a full game, where you can keep track of all variables of any character
OR
- if you add another trigger that specifies that this rule will apply only to a certain character.

Because, you know, creators use variables for whatever they want, so a character will have var(10) to enable AI, another one to display an explod, another one for damage dampening, etc.
So it's good to do something like this only against other characters you've coded yourself.

BTW, you may want to move this topic to the development section rather than the help one.