News:

MFG's Character of the Month: September 2026 Voting

Main Menu

P2 Variable Trouble

Started by Liero, November 10, 2007, 01:34:34 AM

Previous topic - Next topic

Liero

I've got a set of characters that are all a part of a full game.  They all have a variable set that when changed it causes certain effects.  What I want to do is to have a move where player1 does an attack and if it successfully hits player2's variable will be modified.

How do I do this?

FerchogtX

OK, this is quite simple, you need to force P2 to adopt a custom state, the best way is using TargetState SCtrl. How to use it? Suppose that if hit, the P2 has to be in a custom state:

[State 3000, P2 state]
type = TargetState
trigger1 = movehit
value = 3001
ignorehitpause = 1
persistent = 0

Now, in that 3001 state you can set P2 variables, but be carefull what are you doing, unless you are coding a complete game, this can affect vital variables used by P2, causing stange behaviors... the example can be like:

[Statedef 3001]
type = "Any type, can be A = Aerial, S = Standing... depends on what you want"
ctrl = 0
physics = "Same as above"
anim = "anim you want to set for P2"

[State 3001, varset]
type = varset
trigger1 = time = 0
var(whatever) = whatever value you want to set
ignorehitpause = 1
persistent = 0

...

This will override P2 vars, which is rather rude (where did I have seen this before?) be carefull with this...

See ya!!!! :D
This is the era in which we will see reason triumphing against brutality... May be better to open your mind to the future.
------------------------------------------------------
<- [Clicky - Clicky]
Current Universal War Official Artwork

Liero

Hey thanks a lot! 
By the way it is a complete game.  Im not quite ready to release anything yet but I will soon.