YesNoOk
avatar

Projectile Questions? (Read 1339 times)

Started by MUGENforever, February 11, 2008, 03:32:13 am
Share this topic:
Projectile Questions?
#1  February 11, 2008, 03:32:13 am
  • avatar
  • ***
Is there a line of code I can add to restrict my character from launching another of the same fireball if there is one already in the air?

Is there a line of code I can add to restrict my character from launching a different fireball if there is one already in the air?
Last Edit: February 12, 2008, 05:31:33 am by MUGENforever
Re: Restrict prohectile to one?
#2  February 11, 2008, 03:40:56 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Yes

Yes

Check out mugen\docs\triggers.html and read up on ANYTHING with proj in it. You'll find the one you're after.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Restrict prohectile to one?
#3  February 11, 2008, 04:20:34 am
  • **
lol

lol

basically what you have to do is to put an id to the projectil... and denny the projectil to be trigged usind a projectil with that id... as [C]yanide told you check the docs for more info
Re: Restrict prohectile to one?
#4  February 11, 2008, 05:25:51 am
  • avatar
  • ***
I got this from the ID
Returns the ID number of the player. The ID number is unique for every player throughout the course of a match. Any helper that is created during this time will also receive its own unique ID number. This trigger may be useful for getting opponents' ID numbers, to be later used with the "playerID" redirection keyword (see exp docs). Do not confuse playerID with targetID.

 

Format:

  ID

 

Arguments:

  none

 

Return type:

  int

 

Error conditions:

  none

 

Example:

  value = ID

    This sets value to the ID number of the current player.

  value = EnemyNear, ID

    This sets value to the ID number of the nearest opponent.



I got his for a projectile count
NumProj

------------------------------------------------------------

 

Returns the total number of projectiles currently owned by the player.

 

Format:

  NumProj

 

Arguments:

  none

 

Return type:

  int

 

Error conditions:

  none

 

Example:

  trigger1 = NumProj = 0

    Triggers if the player has no currently active projectiles.


I understand the givign an Id thing I just add it as

ID = ####

That goes under the statedef.

I can't figure out how to do what I want though, I read up on the projectile parts but I couldn't understand most of it, the mojority of them under the projectiles wer trigger effects.

Would I add

trigger1 = NumProj = 1

under [state ####, #]

I found triggers, but I can't find the effects



Could someone just post one they have that allows only one of it to be fired at a time?
Re: Restrict prohectile to one?
#5  February 11, 2008, 06:45:43 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
I told you the document to look in. I said look at all the ones with proj in them. These are the results syou SHOULD have gotten

Quote
------------------------------------------------------------
NumProj
------------------------------------------------------------

Returns the total number of projectiles currently owned by the player.

Format:
  NumProj

Arguments:
  none

Return type:
  int

Error conditions:
  none

Example:
  trigger1 = NumProj = 0
    Triggers if the player has no currently active projectiles.

Quote
NumProjID
------------------------------------------------------------

This trigger takes an ID number as a required argument. It returns the number of projectiles currently owned by the player and having the specified ID number.

Format:
  NumProjID(exprn)

Arguments:
  exprn
    Expression evaluating to an ID number.

Return type:
  int

Error conditions:
  If a negative ID is specified, then the ID defaults to 0. Returns
  SFalse if exprn evaluates to SFalse.

Example:
  trigger1 = NumProjID(1234) = 1
    Triggers if there the player currently owns exactly 1 projectile
    with the ID number 1234.

Quote
  - ProjCancelTime
  - ProjContact(*,***)
  - ProjContactTime
  - ProjGuarded(*,***)
  - ProjGuardedTime
  - ProjHit(*,***)
  - ProjHitTime

And we're ignoring the last 7 as pasting them in would make this post too long, and your first 2 results give you the answer.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Restrict prohectile to one?
#6  February 11, 2008, 07:09:02 am
  • avatar
  • ***
So I would add lines of code looking like this?

NumProjId = ####
trigger1 = NumProjID(####) = 1
ProjectContact[ID] = ####
trigger1 = ProjContact#### = 1
ProjCancelTime = #
trigger1 = ProjCancelTime(####) = 1
NumProj
Re: Restrict prohectile to one?
#7  February 11, 2008, 07:48:43 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
No. Fine you're getting the answer. Dunno WHERE i said you need projcontact, possibly because i didn't.

In your cmd

trigger1 = numproj = 0

Means there should be no projectiles on the screen.

trigger1 = numprojID(10) = 0

means there must be no projectiles with projID 10 on the screen.

Now, how hard, seeing what i've just written, was it to understand from whats in the docs? I mean really. It's like you skimmed over it and didn't attempt to apply the OBVIOUS bits.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Restrict prohectile to one?
#8  February 11, 2008, 05:46:56 pm
  • avatar
  • ***
So I add to the CNS

ID = ####   ;This goes uner the projectile I wan to limit?

and

trigger1 = numprojID(####) = 0    ;This goes in the cmd under the projectile I want to limit?
Re: Restrict prohectile to one?
#9  February 11, 2008, 05:52:00 pm
  • ******
  • Limited time to use Infinite power !
    • France
    • network.mugenguild.com/cybaster/
How about trying ?

Spoiler, click to toggle visibilty
Re: Restrict prohectile to one?
#10  February 11, 2008, 06:07:53 pm
  • avatar
  • ***
I did that, it doesn't work.

;Floor Fire
[StateDef 1005]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 201
poweradd = 30
ID = 10

[State 1005, 1]
type = Projectile
trigger1 = AnimElem = 2
projanim = 1005
projhitanim = 1006
projpriority = 1
projheightbound = -240, 100
projedgebound = 100
projscreenbound = 100
projshadow = -1
offset = 47,-41
velocity = .5
attr = S, SP
damage   = 50
animtype = heavy
guardflag = MA
hitflag = MAFDP
pausetime = 10,10
hitsound   = 5,2
sparkxy = 500,500
guardsound = S6,0
ground.type = Low
ground.slidetime = 25
ground.hittime  = 25
ground.velocity = -6
air.animtype = Back
air.velocity = -4,-6
air.juggle = 3
air.fall = 1
down.velocity = -4,-6
down.hittime = 30
down.bounce = 0

[State 1005, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;Floor Fire
[State -1, Floor Fire]
type = ChangeState
value = 1005
triggerall = command = "Floor Fire"
trigger1 = (statetype = s) && ctrl
trigger1 = numprojID(10) = 0
Re: Restrict prohectile to one?
#11  February 11, 2008, 08:04:26 pm
  • ******
  • [E]
    • Mexico

  • Online
the ID goes in the projectile sctrl not in the statedef
Re: Restrict prohectile to one?
#12  February 11, 2008, 08:33:34 pm
  • avatar
  • ***
[State 1005, 1]
type = Projectile
trigger1 = AnimElem = 2
projanim = 1005
projhitanim = 1006
projpriority = 1
projheightbound = -240, 100
projedgebound = 100
projscreenbound = 100
projshadow = -1
ID = 10
offset = 47,-41
velocity = .5
attr = S, SP
damage   = 50
animtype = heavy
guardflag = MA
hitflag = MAFDP
pausetime = 10,10
hitsound   = 5,2
sparkxy = 500,500
guardsound = S6,0
ground.type = Low
ground.slidetime = 25
ground.hittime  = 25
ground.velocity = -6
air.animtype = Back
air.velocity = -4,-6
air.juggle = 3
air.fall = 1
down.velocity = -4,-6
down.hittime = 30
down.bounce = 0

Like that?  Sorry if I'm slow with this, I'm more of a visual and do and learn type of person.
Re: Restrict prohectile to one?
#13  February 11, 2008, 09:49:42 pm
  • **
Yes, like that.
Re: Restrict prohectile to one?
#14  February 11, 2008, 10:37:28 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Nothing is goind to explode if you put in some incorrect data. Rather than ask, which is fine if you're having issues, but silly when TESTING will give you a faster answer, why not try and see if it works. If you learn by seeing things then you should do things that help you see them in action.

There is not always a "right" way of doing something. You do not need our approval for any little tweak and change you might make. Try, then ask if it's giving you crap that you can't sort out. Not ask before it gives you crap.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Restrict prohectile to one?
#15  February 11, 2008, 10:42:53 pm
  • avatar
  • ***
I do try it. I've tried many thins, trust me.  I just don't speak l33t so some of its hard for me to understand.  So I put it like I was told, but The character can still fire any number of them, this is my CMD

;Floor Fire
[State -1, Floor Fire]
type = ChangeState
value = 1005
triggerall = command = "Floor Fire"
trigger1 = (statetype = s) && ctrl
trigger1 = numprojID(10) = 0

This is my CNS

;----------------------
;Floor Fire
[StateDef 1005]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 201
poweradd = 30

[State 1005, 1]
type = Projectile
trigger1 = AnimElem = 2
projanim = 1005
projhitanim = 1006
projpriority = 1
projheightbound = -240, 100
projedgebound = 100
projscreenbound = 100
projshadow = -1
ID = 10
offset = 47,-41
velocity = .5
attr = S, SP
damage   = 50
animtype = heavy
guardflag = MA
hitflag = MAFDP
pausetime = 10,10
hitsound   = 5,2
sparkxy = 500,500
guardsound = S6,0
ground.type = Low
ground.slidetime = 25
ground.hittime  = 25
ground.velocity = -6
air.animtype = Back
air.velocity = -4,-6
air.juggle = 3
air.fall = 1
down.velocity = -4,-6
down.hittime = 30
down.bounce = 0

[State 1005, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

Am I missing something?
Re: Restrict prohectile to one?
#16  February 11, 2008, 11:08:07 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Yep, it's meant to be projID which is mentioned in the projectile sctrl.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Restrict prohectile to one?
#17  February 12, 2008, 01:54:54 am
  • avatar
  • ***
Thank you, one quick question, is projpriority the priority it has if it clashes with another projectile or the priority the AI takes for using that attack?
Re: Restrict prohectile to one?
#18  February 12, 2008, 02:06:38 am
  • **
Docs said:
projpriority = proj_priority (int)

    Specifies the projectile priority. If the projectile collides with

    another projectile of equal priority, they will cancel. If it

    collides with another of lower priority, it will cancel the lower-

    priority projectile, and the higher-priority one will have its

    priority decreased by 1.

    Defaults to 1.

The docs are really a great place to check when you have doubts about a paramter.
As you can see it's the priority for colliding with another.
Re: Restrict prohectile to one?
#19  February 12, 2008, 05:31:11 am
  • avatar
  • ***
I'm gonna use this thread for my projectile questions (if I should make a new one say something).

Anyway, I was trying to make my character get pushed back a litlle after using a projectile, so I gave him posadd, but now he crashes and it says "Need at least one state controller." Here is the line of code in the CNS for it.

I go tit to work, but now there si a new issue, the projectile moves back with the character  --;

;Electric Vortex
[StateDef 3001]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1000
poweradd = -3000

[State 3001, 1]                      ;Got it to work, needed a space between State and 3001.
type = posadd
trigger1 = AnimElem = 4
x = -25

[State 3001, 1]
type = Projectile
trigger1 = AnimElem = 4
projanim = 3001
projhitanim = 3001
projpriority = 100
projheightbound = -240, 100
projedgebound = 100
projscreenbound = 100
projshadow = -1
projID = 3001
projremovetime = 200
projscale = .5, .5
projhits = 25
offset = 47,-41
velocity = 0
attr = S, SP
damage   = 5, 5
animtype = heavy
guardflag = MA
hitflag = MAFDP
pausetime = 10,10
hitsound   = 5,2
sparkxy = 500,500
guardsound = S6,0
ground.type = Low
ground.slidetime = -25
ground.hittime  = 25
ground.velocity = -15
air.animtype = Back
air.velocity = -4,-6
air.juggle = 3
air.fall = 1
down.velocity = -4,-6
down.hittime = 30
down.bounce = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

Another problem I'm having is that I made it so they can use the attack on the ground or in the air, but now when he uses it in the air, he gets stuck up there.  This is the line for the code for CMD.  The CNS is above.

[Statedef -1]

;Electric Vortex
[State -1, Electric Vortex]
type = ChangeState
value = 3001
triggerall = command = "Electric Vortex"
triggerall = power >= 3000
trigger1 = (statetype = s) && ctrl
trigger2 = (statetype = a) && ctrl
Last Edit: February 12, 2008, 06:56:37 am by MUGENforever
Re: Projectile Questions?
#20  February 12, 2008, 06:29:23 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
state3001 is your problem, add a spacebar in there.

As for the other one. Well he would get stuck, you've told him to. 0 is standing, standing is not fall.

State 50 is jumping. I suggest you tell him to go to that state if he's not on the ground. Actually cos it's easier and i know you'll get bugs on release without us going into a lot of crap.

recreate the state, number it differently , give it type = A up the top of everything and have that change to state 50 when it's done rather than 0. Then create a new changestate for it.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.