Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Coding Question  (Read 450 times)

Offline aa250

  • CC Staff
  • *
  • Posts: 6750
  • Country: 00
  • retired
  • Referrals: 0
Coding Question
« on: December 03, 2009, 11:22:56 AM »
I am working on an update on Magneto, I was able to get his 8 air dash to work correctly. I know this can be done, but what is the code that make the air dashes un spammable meaning when I air dash I can only do it once meaning I can't push the command over and over while he already done the air dash. :watchmen:

For example here is a picture of his air dash forward


if I keep pressing the air dash command repeatably he won't stop. I want to make it where I can only push it once.

Offline BlizzardTora

  • CC In Absentia
  • ****
  • Posts: 3562
  • Country: us
  • Whatever ,( GTFA >_>d
  • Referrals: 0
Re: Coding Question
« Reply #1 on: December 03, 2009, 11:26:28 AM »
I have a question about that too. I havent play any of the marvel games in a while but arent the characters that are able to fly able to do air dash at least 2 times, like storm?


Offline bdc

  • The best looking
  • CC Staff
  • *
  • Posts: 4285
  • Country: 00
  • Referrals: 0
Re: Coding Question
« Reply #2 on: December 03, 2009, 11:36:44 AM »
Well there are multiple ways. if you want him to only perform 1 airdash per jump I would use a var we will call this var(x).
Basically set this var(X) to 0 if the var(x)!= 0 and his statetype == S || statetype == C
add a trigger to the command that does the airdash that checks if the var(x) == 0
set var(x) = 1 in the airdash state with a trigger !Time.

Offline aa250

  • CC Staff
  • *
  • Posts: 6750
  • Country: 00
  • retired
  • Referrals: 0
Re: Coding Question
« Reply #3 on: December 03, 2009, 12:45:50 PM »
Quote
I have a question about that too. I havent play any of the marvel games in a while but arent the characters that are able to fly able to do air dash at least 2 times, like storm?

Not sure how many air dash Storm has, but Magneto has 8. :whaaa:

Quote
Well there are multiple ways. if you want him to only perform 1 airdash per jump I would use a var we will call this var(x).
Basically set this var(X) to 0 if the var(x)!= 0 and his statetype == S || statetype == C
add a trigger to the command that does the airdash that checks if the var(x) == 0
set var(x) = 1 in the airdash state with a trigger !Time.
Can you show me an example
This is one of code in the air dash for the command
;Air Dash
[State -1, Air Dash Forward]
type = ChangeState
value = 1340
triggerall = !var(59)
triggerall = statetype = A
triggerall = ctrl
trigger1 = command = "x" && command = "y"

and this is the code for the air dash in the cns file
; Air Dash Forward
[Statedef 1340]
type    = A
physics = N
anim = 1333
ctrl = 1

[State 1340]
type = PlaySnd
trigger1 = AnimElem = 3
value = 100,6


[State 1340]
type = VelSet
trigger1 = time >= 0
x = 8
y = 0


[State 1340] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn


[State 1340]
type = ChangeState
trigger1 = AnimTime = 0 && var(54)
value = 1335
ctrl = 1

[State 1340]
type = ChangeState
trigger1 = AnimTime = 0 && !var(54)
value = 1332
ctrl = 1

Offline BlizzardTora

  • CC In Absentia
  • ****
  • Posts: 3562
  • Country: us
  • Whatever ,( GTFA >_>d
  • Referrals: 0
Re: Coding Question
« Reply #4 on: December 03, 2009, 12:48:50 PM »
 LOL I meant in the real game. so they can be modeled to be the same.


Offline aa250

  • CC Staff
  • *
  • Posts: 6750
  • Country: 00
  • retired
  • Referrals: 0
Re: Coding Question
« Reply #5 on: December 03, 2009, 01:33:13 PM »
Never mind I figured it out :)

Offline bdc

  • The best looking
  • CC Staff
  • *
  • Posts: 4285
  • Country: 00
  • Referrals: 0
Re: Coding Question
« Reply #6 on: December 03, 2009, 11:43:54 PM »
Quote
Never mind I figured it out

Cool.

Quote
I have a question about that too. I havent play any of the marvel games in a while but arent the characters that are able to fly able to do air dash at least 2 times, like storm?

for multiple air dashes you just need to alter the logic a little
Basically set this var(X) to 0 if the var(x)!= 0 and his statetype == S || statetype == C (basically set this under statedef -2)
add a trigger to the command that does the airdash that checks if the var(x) <= 2
add 1 to var(x) in the airdash state with a trigger !Time.