YesNoOk
avatar

How to turn varadd off? (Read 518 times)

Started by Zankai99, January 25, 2014, 06:24:03 pm
Share this topic:
How to turn varadd off?
#1  January 25, 2014, 06:24:03 pm
  • *
    • Bangladesh
    • death.shadow1234@yahoo.com
So basically my var add on code for a sharingan mode is :
[State 0, VarAdd] ;Sharingan on
type = VarAdd
trigger1 = !var(10)
v = 10    ;fv =
value = 1
so how do i turn it off now?
Re: How to turn varadd off?
#2  January 25, 2014, 06:29:57 pm
  • ****
  • play more SNK games
    • South Africa
    • www.trinitymugen.net/

  • Online
Well you can't exactly "turn it off", you can however have it stop adding. I'm not sure how your move works, or what it's supposed to do but you can change the trigger to "time = 0". Maybe that'll help?
Re: How to turn varadd off?
#3  January 25, 2014, 06:35:09 pm
  • *
    • Bangladesh
    • death.shadow1234@yahoo.com
Well you can't exactly "turn it off", you can however have it stop adding. I'm not sure how your move works, or what it's supposed to do but you can change the trigger to "time = 0". Maybe that'll help?

I was trying to learn vars and all and the moves pretty simple like when i press "x" sasuke turns to his sharingan form and when i press "x" again he goes back to normal
but i pretty much screwed it up.
Re: How to turn varadd off?
#4  January 25, 2014, 06:39:24 pm
  • ****
  • play more SNK games
    • South Africa
    • www.trinitymugen.net/

  • Online
I suggest using Varset rather than Varadd for that.
Re: How to turn varadd off?
#5  January 26, 2014, 11:25:42 am
  • *
    • Bangladesh
    • death.shadow1234@yahoo.com
Re: How to turn varadd off?
#6  January 26, 2014, 12:08:42 pm
  • ****
  • English fluency I am swear!
    • Canada
What you want is basically a variable that turns on and off depending on the form right?

Use "VarSet" to set your variable to 1, thus turning it "on".
Use it again when you want, to set your variable to 0, thus turning it "off".
Quote
And "Reality" is unveiled.
What did it want . . .
What did it see . . .
What did it hear . . .
What did it think . . .
What did it do . . .
Re: How to turn varadd off?
#7  January 26, 2014, 12:23:09 pm
  • ******
  • Limited time to use Infinite power !
    • France
    • network.mugenguild.com/cybaster/
Turn off what ? A variable ? THat doesn't make any sense.

All variables have a certain value, that usually starts at 0.
Then, through a bunch of varsets and varadds, depending on moves and triggers, the value of the variable can change.

For example, a varset can set var(30) to 5 :
Code:
type = varset
trigger1 = !time
var(30) = 5

And a varadd can add 1 to var(27) each tick, until var(27)=50
Code:
type = varadd
trigger1 = var(27) < 50
var(27) = 1

So basically, you change the values of the variables, but you can't "destroy" them or "turn them off".
You can set their value back to 0 though.
Re: How to turn varadd off?
#8  January 26, 2014, 04:22:07 pm
  • *
    • Bangladesh
    • death.shadow1234@yahoo.com
You can set their value back to 0 though.
Thats what i meant
but the problem is i tried turning the value to 0
and in mugen when i activate var(10) = 1 it stays like that and i cant make it var(10) = 0 :\
Re: How to turn varadd off?
#9  January 26, 2014, 05:00:37 pm
  • ****
    • Skype - DaInfinite
    • infiniteff.forumotion.com/
Post the var's and triggers you are using.
Re: How to turn varadd off?
#10  January 26, 2014, 05:18:06 pm
  • *
    • Bangladesh
    • death.shadow1234@yahoo.com
[Statedef 1100]
type = S
ctrl = 0
velset = 0,0
anim = 1100
movetype = I
physics = S
sprpriority = 2

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 3
helpertype = normal ;player
name = "Sharingan"
ID = 556
stateno = 556
pos = 4,-58
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermove
pausemove
size.xscale = 0.4
size.yscale = 0.4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1
value = S4,7
volume = 0
channel = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = S4,6
volume = 0
channel = -1

[State 1, VarAdd]
type = VarAdd
trigger1 = !var(1)
v = 1    ;fv = 10
value = 1

[State 1100, 1]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
so when ever i do this move it goes to var(1) = 1
but i can get var(1) = 0 when i press the same button again
Sorry for bothering all you because im just that dump :\
Re: How to turn varadd off?
#11  January 26, 2014, 05:30:59 pm
  • ****
    • Skype - DaInfinite
    • infiniteff.forumotion.com/
[Statedef 1100]
type = S
ctrl = 0
velset = 0,0
anim = 1100
movetype = I
physics = S
sprpriority = 2

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 3
helpertype = normal ;player
name = "Sharingan"
ID = 556
stateno = 556
pos = 4,-58
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermove
pausemove
size.xscale = 0.4
size.yscale = 0.4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1
value = S4,7
volume = 0
channel = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = S4,6
volume = 0
channel = -1

[State 1, VarAdd]
type = VarAdd
trigger1 = !var(1)
v = 1    ;fv = 10
value = 1

[State 1100, 1]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
so when ever i do this move it goes to var(1) = 1
but i can get var(1) = 0 when i press the same button again
Sorry for bothering all you because im just that dump :\
That  is because of your trigger on the varadd
trigger1 = !var(1)

!var(1)=not equal to var(1) or no var(1). var(1)=0 is not equal to var(1)
so even if you had you var(1) set to =0 it would always add to that var(1) because of your trigger !var(1).

Is the purpose of your var(1) for your Sharingan helper?
Last Edit: January 26, 2014, 05:34:18 pm by Infinite Crisis
Re: How to turn varadd off?
#12  January 26, 2014, 05:40:45 pm
  • *
    • Bangladesh
    • death.shadow1234@yahoo.com


!var(1)=not equal to var(1) or no var(1). var(1)=0 is not equal to var(1)
so even if you had you var(1) set to =0 it would always add to that var(1) because of your trigger !var(1).

Is the purpose of your var(1) for your Sharingan helper?

well no, a friend of mine was gonna teach me sharingan transformation so that i could use different attacks when im in the sharingan mode and when i press the transforming button again he would deactivate his sharingan and go back to normal
Re: How to turn varadd off?
#13  January 26, 2014, 05:55:29 pm
  • ****
    • Skype - DaInfinite
    • infiniteff.forumotion.com/
So is var(1) your sharingan mode?
Re: How to turn varadd off?
#14  January 26, 2014, 06:37:47 pm
  • *
    • Bangladesh
    • death.shadow1234@yahoo.com
Re: How to turn varadd off?
#15  January 26, 2014, 07:16:36 pm
  • ****
    • Skype - DaInfinite
    • infiniteff.forumotion.com/
Do you have a varset for the var(1) and a var(1) countdown set for him in his -2 statedef or something?
Re: How to turn varadd off?
#16  January 26, 2014, 07:18:27 pm
  • *
    • Bangladesh
    • death.shadow1234@yahoo.com
Re: How to turn varadd off?
#17  January 26, 2014, 08:08:37 pm
  • ****
    • Skype - DaInfinite
    • infiniteff.forumotion.com/
So is this the move that is supposed to activate/deactivate his Sharingan?
Re: How to turn varadd off?
#18  January 27, 2014, 04:05:22 am
  • ****
    • Skype - DaInfinite
    • infiniteff.forumotion.com/
I think this is what you are trying to do...
[State 0, VarSet]
type = VarSet ;Use a varadd when you want to add or subtract to an existing var otherwise you should use a varset.
trigger1 = !time ;or whatever animelem you want the var to start
var(1)=Ifelse(var(1)=1,0,1) ; basically if var(1)/ sharingan mode is already active it will deactivate, if it is not active it will activate. 
ignorehitpause=1
Re: How to turn varadd off?
#19  January 27, 2014, 04:54:24 pm
  • *
    • Bangladesh
    • death.shadow1234@yahoo.com
I think this is what you are trying to do...
[State 0, VarSet]
type = VarSet ;Use a varadd when you want to add or subtract to an existing var otherwise you should use a varset.
trigger1 = !time ;or whatever animelem you want the var to start
var(1)=Ifelse(var(1)=1,0,1) ; basically if var(1)/ sharingan mode is already active it will deactivate, if it is not active it will activate. 
ignorehitpause=1

Thnx bro it worked ^__^
if i could rep+ you i would
and another help bro
can you show me an example for coding a move in sharingan form as in like the hitdef part like trigger = what?
Re: How to turn varadd off?
#20  January 27, 2014, 05:58:25 pm
  • *****
    • Venezuela
    • Blacksight22@Yahoo.Com.Ve
    • Skype - sebastian.osio
You mean damage increased by the sharingan?
Thanks Watta for the sig and avi.