SRB2 Message Board

SRB2 Message Board (https://mb.srb2.org/index.php)
-   Editing Help (https://mb.srb2.org/forumdisplay.php?f=64)
-   -   Help on soccing a char ability (https://mb.srb2.org/showthread.php?t=35123)

PHCC 12-07-2010 11:31 PM

Help on soccing a char ability
 
Ok,first off, I'm beginner with soccing, so, try to don't laugh when you see what I did XP.And second, yes, I read the morph's soccing tutorial, but it only gave some basics, like creating a simple enemy.

So, Let's start. I've messed around a bit, and I saw that, to make a char ability, I have to make a thing that will be the thokitem later.Then, I saw that some character ability socs have a state with A_FindTarget action as it spawnstate,so, I put this there too. And now, I'm trying to make the player hide in the ground(like the minus enemy) and after a while, pop-up from the ground.And then I've messed up with all, and it becomes into this:

Spoiler:

FRAME 1992
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 1995
ACTION A_FindTarget
VAR1 = 1
VAR2 = 0


FRAME 1995
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 100
NEXT = 1993
ACTION A_MinusCheck
VAR1 = 0
VAR2 = 0


FRAME 1994
SPRITENUMBER = 0
SPRITESUBNUMBER = 1
DURATION = 100
NEXT = 0
ACTION A_MinusPopup
VAR1 = 0
VAR2 = 0

Thing 400
MAPTHINGNUM = -1
SPAWNSTATE = 1992
SPAWNHEALTH = 100
SEESTATE = 1993
SEESOUND = 0
REACTIONTIME = 32
ATTACKSOUND = 0
PAINSTATE = 0
PAINSOUND = 0
MELEESTATE = 1993
MISSILESTATE = 1994
DEATHSTATE = 0
DEATHSOUND = 0
XDEATHSTATE = 0
ACTIVESOUND = 0
RAISESTATE = 0
FLAGS = 9

FRAME 1993
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 100
NEXT = 1994
ACTION A_MinusDigging
VAR1 = 0
VAR2 = 0


AND WELL DONE!!! I tested it in a character and it does..... nothing. (_")
What should I do to make this thing work?

D00D64 12-08-2010 01:53 AM

I havent tried this SOC myself yet, but does the S_SKIN have "ghostthokitem = 0" in it anywhere?

PHCC 12-08-2010 10:14 AM

yes, and thokitem = 400, the SOC was in the MAINCFG too.I think I just did something(or all) wrong in the SOC.

EDIT: I changed the SEESTATE to the frame 1995, and now, everytime that I try to perform the ability(thoking), the game crashes.

Morph 12-08-2010 11:09 PM

Well there are two crucial mistakes you made:


1).
Quote:

Originally Posted by wiki - object flags
2147483648 MF_RUNSPAWNFUNC
Normally a Object can not perform actions during its SpawnState, this flag makes it able to. The SOC editor does not list this flag, and will crash if an Object with this flag is viewed.

So your object will not do anything when it calls its first state UNLESS you add this flag.
You could create a new 1 tic lasting spawnstate that does absolutely nothing and is followed by your current spawnstate, too.
I guess this is something that should be mentioned in the current object creation tutorial...

2.)
You want the player to dig BUT what you are actually doing is you command the socitem object to perform the digging. If the player should perform the digging the player object itself has to be calling a state that contains these actions. This is, however, not possible because the state call of a player object is hardcoded for obvious reasons.
You could use srb2Morphed.exe to make use of A_SetObjectState and force the player object into a state with the specific action. This unfortunatelly won't work either because sending players into long (lasting a few seconds) state cycles is prevented by the hardcoded state calls that will break any cycle.


The ability you want to create can be implemented with source code modification and if I recall correctly something similar has already been done. I think there was a modification in the 1.08 era that made Knuckles go into digging mode if you pressed spinning while gliding.

PHCC 12-09-2010 12:20 AM

So.... The ability that I wanted to perform is actually impossible to do. But I think it was a good start(even if it doesn't actually works). =)

Prime 2.0 12-09-2010 07:32 AM

Morph, what would happen if the SOC'd object used A_RemoteAction to force the player to call A_MinusDigging constantly, regardless of state? If a second timer object was spawned to use A_RandomStateRange on the previously mentioned object, you wouldn't even have to make a hundred states for it.

I haven't worked with the minus actions, so I wouldn't know the result of this; but, it seems like it would be worth a shot.

PHCC 12-09-2010 04:35 PM

Well, messed up a bit more,and I made the player hides in the ground as I wanted(Thx to Prime 2.0 and Morph). But the problem now is that, when I call the function to the player object, it makes all the players hides in the ground. And one more problem, I can't stop the action, so, when I press the jump button, I go out from the ground, but after a while, I automatically hide in the ground again.

Here is the SOC:

Spoiler:

FRAME 1997
SPRITENUMBER = 0
SPRITESUBNUMBER = 1
DURATION = 100
NEXT = 1995
ACTION A_RandomStateRange
VAR1 = 1996
VAR2 = 1993

FRAME 1996
SPRITENUMBER = 0
SPRITESUBNUMBER = 1
DURATION = 100
NEXT = 1997
ACTION A_RemoteAction
VAR1 = 0
VAR2 = 1993


FRAME 1992
SPRITENUMBER = 0
SPRITESUBNUMBER = 1
DURATION = 1
NEXT = 1995
ACTION A_FindTarget
VAR1 = 1
VAR2 = 0

FRAME 1995
SPRITENUMBER = 0
SPRITESUBNUMBER = 1
DURATION = 35
NEXT = 1993
ACTION A_MinusCheck
VAR1 = 0
VAR2 = 0


FRAME 1994
SPRITENUMBER = 0
SPRITESUBNUMBER = 1
DURATION = 100
NEXT = 0
ACTION A_MinusPopup
VAR1 = 0
VAR2 = 0

Thing 400
MAPTHINGNUM = -1
SPAWNSTATE = 1992
SPAWNHEALTH = 100
SEESTATE = 1996
SEESOUND = 0
REACTIONTIME = 32
ATTACKSOUND = 0
PAINSTATE = 0
PAINSOUND = 0
MELEESTATE = 0
MISSILESTATE = 0
DEATHSTATE = 0
DEATHSOUND = 0
XDEATHSTATE = 0
ACTIVESOUND = 0
RAISESTATE = 0
FLAGS = 2147483657

FRAME 1993
SPRITENUMBER = 193
SPRITESUBNUMBER = 1
DURATION = 1
NEXT = 1994
ACTION A_MinusDigging
VAR1 = 0
VAR2 = 0


EDIT:One question: If I had to use A_RemoteAction to call the player object to dig, wouldn't I need to use A_RemoteAction to make the player pop-up from the ground(and then stop the action)?

EDIT2:Well, I removed some states, and it turned into this:

Spoiler:
FRAME 1996
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 100
NEXT = 1995
ACTION A_RemoteAction
VAR1 = 0
VAR2 = 1993

FRAME 1995
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 100
NEXT = 0
ACTION A_RemoteAction
VAR1 = 0
VAR2 = 1994


FRAME 1992
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 1996
ACTION A_FindTarget
VAR1 = 1
VAR2 = 0

Thing 400
MAPTHINGNUM = -1
SPAWNSTATE = 1992
SPAWNHEALTH = 100
SEESTATE = 1996
SEESOUND = 0
REACTIONTIME = 32
ATTACKSOUND = 0
PAINSTATE = 0
PAINSOUND = 0
MELEESTATE = 0
MISSILESTATE = 0
DEATHSTATE = 0
DEATHSOUND = 0
XDEATHSTATE = 0
ACTIVESOUND = 0
RAISESTATE = 0
FLAGS = 2147483657

FRAME 1993
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 0
NEXT = 0
ACTION A_MinusDigging
VAR1 = 0
VAR2 = 0

FRAME 1994
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 0
NEXT = 0
ACTION A_MinusPopup
VAR1 = 0
VAR2 = 0


Now, for an odd reason, it isn't affecting the others players, but it's affecting the crawlas(they can't detect you if you're underground, but can't detect the others players too).And it isn't working correctly, sometimes that I thok, it just doesn't work correct.And I don't know how to change the sprites when digging. I'll post a link with a wad that I usually don't use, that is using the SOC.

http://www.4shared.com/file/zr_hoBgT/Lari2.html

Well, the SOC is almost done!! =)

EDIT3: Another problem, how do I make the player doesn't jump or spin while underground??

PHCC 12-09-2010 09:09 PM

Sorry for double posting but I didn't find a way to make the player not spin and jump while performing the dig. But I think there is a way to move for a certain direction, in a straight line, to the direction that you're aiming. Maybe A_MoveAbsolute or A_MoveRelative should do something like this.Or there are other ways to do this?

EDIT:

Here's my last SOC for this ability:

Spoiler:
FRAME 1999
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 100
NEXT = 1995
ACTION None
VAR1 = 0
VAR2 = 0

FRAME 1998
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 50
NEXT = 1999
ACTION A_RemoteAction
VAR1 = 0
VAR2 = 1997

FRAME 1997
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 50
NEXT = 0
ACTION A_MoveRelative
VAR1 = 0
VAR2 = 120

FRAME 1996
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 100
NEXT = 1998
ACTION A_RemoteAction
VAR1 = 0
VAR2 = 1993

FRAME 1995
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 100
NEXT = 0
ACTION A_RemoteAction
VAR1 = 0
VAR2 = 1994


FRAME 1992
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 1996
ACTION A_FindTarget
VAR1 = 1
VAR2 = 0

Thing 400
MAPTHINGNUM = -1
SPAWNSTATE = 1992
SPAWNHEALTH = 100
SEESTATE = 1996
SEESOUND = 0
REACTIONTIME = 32
ATTACKSOUND = 0
PAINSTATE = 0
PAINSOUND = 0
MELEESTATE = 0
MISSILESTATE = 0
DEATHSTATE = 0
DEATHSOUND = 0
XDEATHSTATE = 0
ACTIVESOUND = 0
RAISESTATE = 0
FLAGS = 2147483657

FRAME 1993
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 0
NEXT = 0
ACTION A_MinusDigging
VAR1 = 0
VAR2 = 0

FRAME 1994
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 0
NEXT = 0
ACTION A_MinusPopup
VAR1 = 0
VAR2 = 0


I'm stopping because:

*Sometimes that the ability is used, they do this in another player, not me.
*I can't pop monitors once I use this ability.
*Players can jump on the player, and happens something strange....
*When the player dies, he becomes a rabbit(like an enemy).

What If everything were right?

I would add A_CustomPower and set VAR1 = 27 and VAR2 = the time that is used to dig and pop up and the SOC would be done.

Prime 2.0 12-21-2010 01:55 AM

If you want to make sure that it only happens to the player that used it, try making the custom object use Target for A_RemoteAction instead of looking for the nearest player; it'll already be set to the player that spawned it since it's the spin item. As for the rest of the stuff you've described, I'm interested in taking a look at it; could you send me a copy of the wad so I can mess with it?

Princess Draykon 12-25-2010 10:33 PM

As Prime said, Var1 for your A_RemoteAction states should be -1. That should make it so that it targets the specific player using it, rather than just 'the nearest player'

In general, what you'll find is that the player will handle most actions in unusual ways.

I'm not sure everything that A_PopUp does, but there's a good chance that it's not enough to return the player to 'normal.' It might help to reset the player's flags after using A_Popup. To do that, add another A_RemoteAction call, this time calling A_SetObjectFlags, to return the player's flags to their defaults. (I don't remember on hand, but I think it's '6'?) That'll have the side effect of making the player flash green, but it MIGHT fix the other problems.

That's what I'd try anyway.

PHCC 12-26-2010 12:01 AM

Ok, but there's another problem, that is: When the player is "digging", he can jump and spin as well, and obviously, I don't want this to happen.As for the other problems, I'll mess up more with the SOC to see what I can do.
And Prime 2.0, the link for the testwad is here:

http://www.4shared.com/file/Piw3k10l/Lari2_2.html

Also, I tried to add the digging sprite in this testwad, and make it appear when the player is performing the action, but it didn't work. =(

PHCC 12-29-2010 11:53 AM

Now, the ability is working almost perfectly:

Spoiler:
FRAME 2003
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 100
NEXT = 1998
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 2002

FRAME 2002
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 0
ACTION A_CustomPower
VAR1 = 27
VAR2 = 300

FRAME 2001
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 0
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 2000

FRAME 2000
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 0
ACTION A_SetObjectFlags
VAR1 = 6
VAR2 = 0

FRAME 1999
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 100
NEXT = 1995
ACTION None
VAR1 = 0
VAR2 = 0

FRAME 1998
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 50
NEXT = 1999
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1997

FRAME 1997
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 50
NEXT = 0
ACTION A_Thrust
VAR1 = 120
VAR2 = 0

FRAME 1996
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 2003
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1993

FRAME 1995
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 100
NEXT = 2001
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1994


FRAME 1992
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 1996
ACTION A_FindTarget
VAR1 = 1
VAR2 = 0

Thing 400
MAPTHINGNUM = -1
SPAWNSTATE = 1992
SPAWNHEALTH = 100
SEESTATE = 1996
SEESOUND = 0
REACTIONTIME = 32
ATTACKSOUND = 0
PAINSTATE = 0
PAINSOUND = 0
MELEESTATE = 0
MISSILESTATE = 0
DEATHSTATE = 0
DEATHSOUND = 0
XDEATHSTATE = 0
ACTIVESOUND = 0
RAISESTATE = 0
FLAGS = 2147483657

FRAME 1993
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 0
NEXT = 0
ACTION A_MinusDigging
VAR1 = 0
VAR2 = 0

FRAME 1994
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 0
NEXT = 0
ACTION A_MinusPopup
VAR1 = 0
VAR2 = 0


But there are two problems:

*The first time that you try to do the ability, it doesn't work (Fixed);

*I noticed that the player have to do a complete jump to the ability work properly, if you press jump and then press jump again quickly, the ability won't work.

Draykon, can I ask you a question? How did you make Rosy's ability works only when she's almost touching the ground?

Ah, and a new link for the testwad:

http://www.4shared.com/file/E_p7C6sG/Lari2.html

EDIT: I made some adjustments in the SOC:

Spoiler:
FRAME 2003
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 48
NEXT = 1998
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 2002

FRAME 2002
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 0
ACTION A_CustomPower
VAR1 = 27
VAR2 = 168

FRAME 2001
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 0
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 2000

FRAME 2000
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 0
ACTION A_SetObjectFlags
VAR1 = 6
VAR2 = 0

FRAME 1999
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 48
NEXT = 1995
ACTION None
VAR1 = 0
VAR2 = 0

FRAME 1998
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 48
NEXT = 1999
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1997

FRAME 1997
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 48
NEXT = 0
ACTION A_Thrust
VAR1 = 64
VAR2 = 0

FRAME 1996
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 2003
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1993

FRAME 1995
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 48
NEXT = 2001
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1994


FRAME 1992
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 1996
ACTION A_FindTarget
VAR1 = 1
VAR2 = 0

Thing 400
MAPTHINGNUM = -1
SPAWNSTATE = 1992
SPAWNHEALTH = 100
SEESTATE = 1996
SEESOUND = 0
REACTIONTIME = 32
ATTACKSOUND = 0
PAINSTATE = 0
PAINSOUND = 0
MELEESTATE = 0
MISSILESTATE = 0
DEATHSTATE = 0
DEATHSOUND = 0
XDEATHSTATE = 0
ACTIVESOUND = 0
RAISESTATE = 0
FLAGS = 2147483657

FRAME 1993
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 0
NEXT = 0
ACTION A_MinusDigging
VAR1 = 0
VAR2 = 0

FRAME 1994
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 0
NEXT = 0
ACTION A_MinusPopup
VAR1 = 0
VAR2 = 0



EDIT2: I don't know what I did here, but yeah, there's only one problem lasting:

Spoiler:
FRAME 2007
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 48
NEXT = 1998
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 2006

FRAME 2006
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 0
ACTION A_MinusDigging
VAR1 = 0
VAR2 = 0

FRAME 2005
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 2003
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 2004

FRAME 2004
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 0
ACTION A_SetObjectFlags
VAR1 = 6
VAR2 = 0


FRAME 2003
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 2007
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 2002

FRAME 2002
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 0
ACTION A_CustomPower
VAR1 = 27
VAR2 = 168

FRAME 2001
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 0
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 2000

FRAME 2000
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 0
ACTION A_SetObjectFlags
VAR1 = 6
VAR2 = 0

FRAME 1999
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 48
NEXT = 1995
ACTION None
VAR1 = 0
VAR2 = 0

FRAME 1998
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 48
NEXT = 1999
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1997

FRAME 1997
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 48
NEXT = 0
ACTION A_Thrust
VAR1 = 64
VAR2 = 0

FRAME 1996
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 2005
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1993

FRAME 1995
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 48
NEXT = 2001
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1994


FRAME 1992
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 1996
ACTION A_FindTarget
VAR1 = 1
VAR2 = 0

Thing 400
MAPTHINGNUM = -1
SPAWNSTATE = 1992
SPAWNHEALTH = 100
SEESTATE = 0
SEESOUND = 0
REACTIONTIME = 32
ATTACKSOUND = 0
PAINSTATE = 0
PAINSOUND = 0
MELEESTATE = 0
MISSILESTATE = 0
DEATHSTATE = 0
DEATHSOUND = 0
XDEATHSTATE = 0
ACTIVESOUND = 0
RAISESTATE = 0
FLAGS = 2147483657

FRAME 1993
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 0
ACTION A_MinusDigging
VAR1 = 0
VAR2 = 0

FRAME 1994
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 0
ACTION A_MinusPopup
VAR1 = 0
VAR2 = 0


The problem that is lasting is the second one.

Prime 2.0 12-30-2010 04:40 AM

So after working with it for a bit, I found that the issue with the ability not working was because the thok item had MF_Special on; that turns it into a collectible, which meant that it was being "collected" most of the time instead of actually doing anything useful.

...while I was figuring that out, I did a bit of housekeeping in the SOC since it was an unreadable mess previously. Besides organizing and commenting it, I removed the useless A_FindTarget(You can't call targeting actions in the first tic no matter what, and it was set up to find a blue crawla for some reason), took out the "spawn actions" flag, adjusted the timing so I could test different stuff with it more rapidly, removed the delay between A_MinusPopup and A_SetObjectFlags so that being killed the first tic out wouldn't spawn a bunny, and tossed in an A_RandomState for show.

Code:

# MT_LariDig - Thok item for Lari Shadehunt.
#  Makes Lari dig in the ground
Thing 400
MAPTHINGNUM = -1
SPAWNSTATE = 2101
SPAWNHEALTH = 100
SEESTATE = 0
SEESOUND = 0
REACTIONTIME = 32
ATTACKSOUND = 0
PAINSTATE = 0
PAINSOUND = 0
MELEESTATE = 0
MISSILESTATE = 0
DEATHSTATE = 0
DEATHSOUND = 0
XDEATHSTATE = 0
ACTIVESOUND = 0
RAISESTATE = 0
FLAGS = 8
# [Flags: NoSector]


# Ref1 - Initiates digging
FRAME 1992
ACTION A_MinusDigging

# Ref2 - Ends digging and pops actor out of the ground
FRAME 1993
ACTION A_MinusPopup

# Ref3 - Sets flags MF_Solid and MF_Shootable
FRAME 1994
ACTION A_SetObjectFlags
VAR1 = 6
VAR2 = 0

# Ref4 - Temporarily removes movement control from the player
FRAME 1995
ACTION A_CustomPower
VAR1 = 27
VAR2 = 47

# Ref5 - Thrusts forward
FRAME 1996
ACTION A_Thrust
VAR1 = 64
VAR2 = 0

# Ref6 - Changes state to S_PLAY_PLG1
FRAME 1997
ACTION A_RandomState
VAR1 = 16
VAR2 = 16




# LariDig_1 - [Spawn] This is a thok item, so it doesn't need A_FindTarget
FRAME 2101
SPRITENUMBER = 193
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 2102
ACTION None

# LariDig_2 - Tells Lari to start digging
FRAME 2102
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 2103
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1992
# [RemoteAction: Ref1(MinusDigging)->Target]

# LariDig_3 - Sets Lari's flags to prevent glitchy deaths
FRAME 2103
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 2104
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1994
# [RemoteAction: Ref3(SetObjectFlags)->Target]

# LariDig_4 - Makes it so Lari can turn, but not move
FRAME 2104
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 2105
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1995
# [RemoteAction: Ref4(CustomPower)->Target]

# LariDig_5
FRAME 2105
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 20
NEXT = 2106
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1992
# [RemoteAction: Ref1(MinusDigging)->Target]

# LariDig_6 - Thrusts Lari forward
FRAME 2106
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 20
NEXT = 2107
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1996
# [RemoteAction: Ref5(Thrust)->Target]

# LariDig_7 - Makes Lari pop out of the ground
FRAME 2107
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 0
NEXT = 2108
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1993
# [RemoteAction: Ref2(MinusPopup)->Target]

# LariDig_8 - Sets Lari's flags to prevent glitchy deaths(again)
FRAME 2108
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 2109
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1994
# [RemoteAction: Ref3(A_SetObjectFlags)->Target]


# LariDig_9 - Makes Lari go into spring animation
FRAME 2109
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 0
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1997
# [RemoteAction: Ref6(A_RandomState)->Target]
#  {Next: S_NULL}

That said, I found two additional issues that I'm not sure can be fixed: If you use the ability while flashing, you can move while it's in progress every use after, and if you use it on spikes or special stage damage, you'll be permanently stuck in a pseudo-flashing mode where you can't be hurt or pick up rings, but don't actually flash.


...anywho, when you've figured out where you want all the states to be, you can use this to move them easily, though you'll have to update the info table and RemoteAction references manually.

Senku Niola 12-30-2010 07:50 AM

Quote:

Originally Posted by Prime 2.0 (Post 697446)
That said, I found two additional issues that I'm not sure can be fixed: If you use the ability while flashing, you can move while it's in progress every use after, and if you use it on spikes or special stage damage, you'll be permanently stuck in a pseudo-flashing mode where you can't be hurt or pick up rings, but don't actually flash.

Oh hey I know this one, it's the Senku Diamond Cracker bug, I call it the "No Pain No Gain" bug.

PHCC 12-30-2010 11:59 AM

Quote:

Originally Posted by Prime_2.0
That said, I found two additional issues that I'm not sure can be fixed: If you use the ability while flashing, you can move while it's in progress every use after, and if you use it on spikes or special stage damage, you'll be permanently stuck in a pseudo-flashing mode where you can't be hurt or pick up rings, but don't actually flash.

I didn't test it yet, but I have an idea. What about if I add a frame with A_CustomPower With var1=2 and var2=0(sure, it'll be called by A_RemoteAction),before the dig happens, so that it will override the actual player's flashing time(when you get hurt) to 0 tics of duration, so, even if you get hurt, every time that you perform the dig, the flash will disappear.And I think that this MAYBE can fix the other problem. =P

Now, I'm going to test it.

EDIT: I'll travel today, tomorrow I'll be here with the last SOC for this ability.

EDIT2:Well, I don't know why it isn't working. See the SOC, isn't it right?

Code:

# MT_CharDig - Thok item for the character.
# Makes the character dig in the ground
Thing 400
MAPTHINGNUM = -1
SPAWNSTATE = 2100
SPAWNHEALTH = 100
SEESTATE = 0
SEESOUND = 0
REACTIONTIME = 32
ATTACKSOUND = 0
PAINSTATE = 0
PAINSOUND = 0
MELEESTATE = 0
MISSILESTATE = 0
DEATHSTATE = 0
DEATHSOUND = 0
XDEATHSTATE = 0
ACTIVESOUND = 0
RAISESTATE = 0
FLAGS = 8
# [Flags: NoSector]


# Ref1 - Makes the character's flashing time becomes to 0 tics to prevent glitches
FRAME 1991
ACTION A_CustomPower
VAR1 = 2
VAR2 = 0

# Ref2 - Initiates digging
FRAME 1992
ACTION A_MinusDigging

# Ref3 - Ends digging and pops actor out of the ground
FRAME 1993
ACTION A_MinusPopup

# Ref4 - Sets flags MF_Solid and MF_Shootable
FRAME 1994
ACTION A_SetObjectFlags
VAR1 = 6
VAR2 = 0

# Ref5 - Temporarily removes movement control from the player
FRAME 1995
ACTION A_CustomPower
VAR1 = 27
VAR2 = 47

# Ref6 - Thrusts forward
FRAME 1996
ACTION A_Thrust
VAR1 = 64
VAR2 = 0

# Ref7 - Changes state to S_PLAY_PLG1
FRAME 1997
ACTION A_RandomState
VAR1 = 16
VAR2 = 16




# CharDig_1 - Spawn
FRAME 2100
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 2101
ACTION None

# CharDig_2 - Sets the character's flashing time to 0 tics to prevent glitches
FRAME 2101
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 2102
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1991
# [RemoteAction: Ref1(CustomPower)->Target]

# CharDig_2 - Tells the character to start digging
FRAME 2102
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 2103
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1992
# [RemoteAction: Ref2(MinusDigging)->Target]

# CharDig_3 - Sets the character's flags to prevent glitchy deaths
FRAME 2103
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 2104
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1994
# [RemoteAction: Ref4(SetObjectFlags)->Target]

# CharDig_4 - Makes it so the character can turn, but not move
FRAME 2104
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 2105
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1995
# [RemoteAction: Ref5(CustomPower)->Target]

# CharDig_5
FRAME 2105
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 20
NEXT = 2106
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1992
# [RemoteAction: Ref2(MinusDigging)->Target]

# CharDig_6 - Thrusts the character forward
FRAME 2106
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 20
NEXT = 2107
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1996
# [RemoteAction: Ref6(Thrust)->Target]

# CharDig_7 - Makes the character pop out of the ground
FRAME 2107
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 0
NEXT = 2108
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1993
# [RemoteAction: Ref3(MinusPopup)->Target]

# CharDig_8 - Sets the character's flags to prevent glitchy deaths(again)
FRAME 2108
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 2109
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1994
# [RemoteAction: Ref4(A_SetObjectFlags)->Target]


# CharDig_9 - Makes the character go into spring animation
FRAME 2109
SPRITENUMBER = 0
SPRITESUBNUMBER = 0
DURATION = 1
NEXT = 0
ACTION A_RemoteAction
VAR1 = -1
VAR2 = 1997
# [RemoteAction: Ref7(A_RandomState)->Target]
#  {Next: S_NULL}



All times are GMT. The time now is 01:38 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.