Checkpoints give rewards SA2 Style?

Status
Not open for further replies.

Theqmayn

Member
Is there a way I can make it so that I can have it where if you touch a star post (SA2 style) if you have x rings, then you can get a super ring or a shield?




Example of what I mean:


So like if you have 20 rings.... you get a super ring
Or if you have 50 rings... you get a super sneaker
Or if you have 90 rings... you get a shield
 
All of these things you've been making topics about are possible, and they'd be fairly easy for you to do with some basic knowledge of Lua. I'd advise reading the tutorials and documentation on the wiki to try and figure these things out yourself first, and only posting on the MB if you're really stuck.
 
addHook("TouchSpecial", function(mo, toucher) P_SpawnShieldOrb(toucher.player, 10) end, MT_STARPOST)


So like this?
 
I did notice a problem. P_SpawnShieldOrb gives the player the appropriate visual effect for "toucher.player.powers[pw_shield]", and doesn't take a second argument. Before doing that, you should set "toucher.player.powers[pw_shield]" to the shield constant desired, such as "SH_PITY" for the pity shield. Here is a link to the SRB2 wiki page for the different shield constants.

In addition, you should look into conditional statements like "if" if you want to do the stuff where there are different rewards for different numbers of rings- specifically, you can check the health of the player through the structure "toucher.health" - which is equivalent to the number of rings they have, plus one.
 
Last edited:
Sorry, please read my post again- I posted it too early and was still editing it when you read it.
 
toaster meant to use the "if"s to check the ammount of Rings the player has, so you can give different reward to him by checking "toucher.player.health" and "toucher.health", I believe.

Also, don't forget to add 1 to the number, because 1 health is considered as a Player with 0 Ring, as stated in toaster's post.
 
Status
Not open for further replies.

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

Back
Top