New SOC problems.

Status
Not open for further replies.

WellDoneSnake

Yoko Shimomura
Yep the title says it all, except the fact that I'm also going to ask some other questions.

I made a new sprite which is like a small energy capsule (as seen in SA2/B & STH360/STHPS3). I want it to act like the Wing Logo like the one in NiGHTs mode but I made the soc act more like the a ring that doesn't give a ring.
That might sound confusing so let me say it like this: when you touch the item you hear the ring sound but it disappears. I want to make it work like the NiGHTs wing logo since it's suppose to spawn when you destroy an enemy.
If any of you wanted to see the soc or a wad version then take this

Questions:
1) How do you make the A_SpawnObjectAbsolute/A_SpawnObjectRelative spawn a object?
It might sound silly but I don't know if I should either use the painchance, raisestate, the manual parameters in the state config or the meleestate/missilestate.
2) How do you get A_RandomState/A_RandomStateRange to work?
Whenever I try to use it to pick random states it backfires; it either ignores the soc action or crashes the game.
 
I don't know what you mean by "making it work like the wing logo". How exactly do you want it to behave?

1) How do you make the A_SpawnObjectAbsolute/A_SpawnObjectRelative spawn a object?
It might sound silly but I don't know if I should either use the painchance, raisestate, the manual parameters in the state config or the meleestate/missilestate.
You put the number of the object to spawn in the lower 16 bits of Var2. This article tells you the rest.

2) How do you get A_RandomState/A_RandomStateRange to work?
Whenever I try to use it to pick random states it backfires; it either ignores the soc action or crashes the game.
I don't know what you did wrong because you didn't use the action in the SOC that you linked, but you basically just have to put the state numbers to choose from in Var1 and Var2. Again, more in this article.
 
I don't know what you mean by "making it work like the wing logo". How exactly do you want it to behave?
Sorry, I forgot to say that I want the item to be added to your score when collected. E.g. If you collect one you get 100 on your score.
You put the number of the object to spawn in the lower 16 bits of Var2.
This article tells you the rest.
Thank you.
I don't know what you did wrong because you didn't use the action in the SOC that you linked, but you basically just have to put the state numbers to choose from in Var1 and Var2. Again, more in this article.
Sorry for any misleading information but the second question wasn't referring to this soc, I just wanted to know how to properly use the A_RandomState action because I was trying to create a soc for npcs and I looked into other socs to see how they made their npcs until I came upon SF94's soc, and I saw how it used the random state to make a npc have a random colour pick or movement (even the way the look would come into this).
I'll post that problem if it comes back again.
 
Double Post:

I forgot to give a proper item explanation,

Information:

Item - Power Core (as seen in Sonic Adventure 2 and Sonic the Hedgehog 2006)

Action - It is supposed to be collected by the player, when the player touches it, it will add 100 points to the score.

Origin - Its main origin is supposed to be from a bot (enemy), when the enemy is destroyed it drops a power core (instead of spawning a little animal), although this is not seen in this soc. Mainly for the reason that right now I just want to know if I can successfully create this item before making it be dropped by an enemy.

Dilemma - I do not know how to make it add points to the score when collected, I'm also wondering if it is possible to configure this by SOC-ing.

(Note: And the sprite was made by me.)

Also here are the flags I used: "MF_SPECIAL", "MF_NOGRAVITY", "MF_COUNTITEM" and "MF_SLIDEME".
 
Last edited:
I don't think it's possible to make an object directly give a certain amount of points to the player when just collected, sorry. Could involve that Award Score linedef exec, but otherwise I haven't any ideas.

Oh, and "MF_COUNTITEM" is actually supposed to be "MF_NOCLIPHEIGHT", SOCEdit just displays the completely wrong name. (After all, it still hasn't been, and may never be, updated for 2.0)
 
2.0.6 doesn't provide any simple ways of making an object do something when collected. All custom collectables go to ring sparkle states and give nothing.

The way around this, demonstrated in the OLDC version of Toxic Plateau, is to create a dead man's switch. The basic concept of a dead man's switch(one which doesn't originate from SOC, or SRB2 at all) is that, in contrast with a switch that does something when pressed, a dead man's switch is already pressed and held down(or pressed constantly) and does something when let go. A collectible can't be told to do something when collected, but by being collected it can be interrupted from something it was already doing.

An example of this setup(with the goal of playing a sound, for this example) is to make your collectible spawn an invisible "helper object" which, all things being left alone, will do nothing for a short period and then use A_PlaySound before dying.

The trick here is that we won't be leaving it alone; instead, your collectible will constantly be using A_RemoteAction to tell the helper object to revert back to its first state, preventing it from using A_PlaySound. When the collectible is collected, this stops happening and the helper object, thus freed, plays the sound.

You can replace A_PlaySound from this example with any action, or series of states and actions that you please. The core is simply that the helper object is prevented from getting there by the collectible, which is why we refer to the setup as a dead man's switch.

As for how you'll award points, I'm drawing a blank along with MonsterIestyn. I might look into it later.
 
2.0.6 doesn't provide any simple ways of making an object do something when collected. All custom collectables go to ring sparkle states and give nothing.

The way around this, demonstrated in the OLDC version of Toxic Plateau, is to create a dead man's switch. The basic concept of a dead man's switch(one which doesn't originate from SOC, or SRB2 at all) is that, in contrast with a switch that does something when pressed, a dead man's switch is already pressed and held down(or pressed constantly) and does something when let go. A collectible can't be told to do something when collected, but by being collected it can be interrupted from something it was already doing.

An example of this setup(with the goal of playing a sound, for this example) is to make your collectible spawn an invisible "helper object" which, all things being left alone, will do nothing for a short period and then use A_PlaySound before dying.

The trick here is that we won't be leaving it alone; instead, your collectible will constantly be using A_RemoteAction to tell the helper object to revert back to its first state, preventing it from using A_PlaySound. When the collectible is collected, this stops happening and the helper object, thus freed, plays the sound.

You can replace A_PlaySound from this example with any action, or series of states and actions that you please. The core is simply that the helper object is prevented from getting there by the collectible, which is why we refer to the setup as a dead man's switch.

As for how you'll award points, I'm drawing a blank along with MonsterIestyn. I might look into it later.
I understand what you are telling me, but I might as well replace the wing logo thing with this sprite since it already allows points to be added to the gameplay when collecting the item (also there will not be a NiGHTs mode in my mod). But I'll still use what you've said for more complicated socs in future.

EDIT:
Where are my manners?
Thanks again you guys.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top