Jump to content
  • 0

Teleporting Issues


ApolloAvalon

Question

I can't seem to Code Infinite-Crisis' Deadpool's move correctly. It's not a simple copy and paste job. I'm trying to code them separately as you can see below.

Weak means behind
Medium means in front
Hard means away
EX means behind with state 220 on the end.

;-------------------------------------------------------------
;Afterimage (weak)
[Statedef 1200]
type = S
movetype = I
physics = N
anim = 1200
ctrl = 0
velset = 0,0
poweradd = 72 * !var(20)
sprpriority = 1
facep2 = 1

[State 1200, Voice]
type = PlaySnd
trigger1 = animelem=1
value = 1300,0
channel =0

[State 1200, Teleport Snd]
type = PlaySnd
trigger1 = animelem=3
value = 1300,1
channel=3

[State 1200, Turn]
type = Turn
trigger1 = time = 14

[State 1300, PosSet]
type = Posset
trigger1 =animelem=4
x = Ifelse(!var(10),-200,Ifelse(var(10)=1,0,200))

[State 1200, Helper]
type = Helper
trigger1 =animelem=4
helpertype = normal ;player
name = "Teleport-FX"
ID = 1200
stateno = 1240
pos = 0,0
postype = p1
facing = 1
ownpal = 1
size.xscale =.5
size.yscale =.5
persistent=0

[State 1200, End]
type = ChangeState
trigger1 =!AnimTime
value = 0
ctrl = 1
;-------------------------------------------------------------
;Afterimage (medium)
[Statedef 1210]
type = S
movetype = I
physics = N
anim = 1210
ctrl = 0
velset = 0,0
poweradd = 72 * !var(20)
sprpriority = 1
facep2 = 1

[State 1210, Voice]
type = PlaySnd
trigger1 = animelem=1
value = 1300,0
channel =0

[State 1210, Teleport Snd]
type = PlaySnd
trigger1 = animelem=3
value = 1300,1
channel=3

[State 1210, Turn]
type = Turn
trigger1 = time = 14

[State 1210, PosSet]
type = Posset
trigger1 =animelem=4
x = Ifelse(!var(10),-200,Ifelse(var(10)=1,0,200))

[State 1210, Helper]
type = Helper
trigger1 =animelem=4
helpertype = normal ;player
name = "Teleport-FX"
ID = 1200
stateno = 1240
pos = 0,0
postype = p1
facing = 1
ownpal = 1
size.xscale =.5
size.yscale =.5
persistent=0

[State 1210, End]
type = ChangeState
trigger1 =!AnimTime
value = 0
ctrl = 1
;-------------------------------------------------------------
;Afterimage (strong)
[Statedef 1220]
type = S
movetype = I
physics = N
anim = 1220
ctrl = 0
velset = 0,0
poweradd = 72 * !var(20)
sprpriority = 1
facep2 = 1

[State 1220, Voice]
type = PlaySnd
trigger1 = animelem=1
value = 1300,0
channel =0

[State 1220, Teleport Snd]
type = PlaySnd
trigger1 = animelem=3
value = 1300,1
channel=3

[State 1220, Turn]
type = Turn
trigger1 = time = 14

[State 1220, PosSet]
type = Posset
trigger1 =animelem=4
x = Ifelse(!var(10),-200,Ifelse(var(10)=1,0,200))

[State 1220, Helper]
type = Helper
trigger1 =animelem=4
helpertype = normal ;player
name = "Teleport-FX"
ID = 1200
stateno = 1240
pos = 0,0
postype = p1
facing = 1
ownpal = 1
size.xscale =.5
size.yscale =.5
persistent=0

[State 1220, End]
type = ChangeState
trigger1 =!AnimTime
value = 0
ctrl = 1
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Coding a teleport (like you want) is coding a state with a PosAdd and a changestate to state 0. Cosmetic stuff too, but that's not important.

If you want three versions, you could:
- make three states in which the PosAdds x values are different (like in your case)
- make only one state and with a variable that detects the pressed button the PosAdds have different x values.

I know, I'm not being helpful enough...

I want to ask though, what does this:

x = Ifelse(!var(10),-200,Ifelse(var(10)=1,0,200))

mean?
Do you know what the variable 10 stands for?

Ifelse is a parameter that tells you: "if A is true, then B, if not C"
In your case:
x equals to Ifelse (if var 10 doesn't work (value 0), then the x value is -200, if not Ifelse (if var 10 is equal to 1, then 0, if not 200))

To put it simple:
!var(10), then x=-200
var(10)= 1, then x=0
var(10)!=1, then x=200

Well, I explained what Ifelse means. You have three different states that do the same thing, in fact if you look at the PosAdds they are the same.

But the topic title tells me "Issues"; I should have asked before, but I shall now: what's the problem, what's the issue you're having?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...