Different Starting points for different characters?

Status
Not open for further replies.

Theqmayn

Member
Could I make it so that with lua, you can select your character on the character select screen, then it take you to an assigned stage?


An example:


Character Select Screen: You pick Sonic ----- you start in Greenflower Zone


Character Select Screen: You pick Knuckles ----- you start in Arid Canyon Zone
 
You can't do this 'directly' by activating a Lua script immediately upon selecting a character, but you can use a workaround. Add a ThinkFrame hook containing an if statement that triggers only on the first tic of gameplay if the current level is the default single-player starting level. (I'd recommend making an empty-room map that isn't accessible by any other means for this purpose, since otherwise the hook would trigger whenever players selected the default level in a level select.) Next, program the hook to call G_ExitLevel with the nextmap parameter dependent on the player's current skin and the skipstats parameter set to true so the player won't see the 'act clear' screen. That way, which character the player selected in the character select will determine which level they get immediately sent off to. Note that you can't use a MapLoad hook for this purpose because you need a player's mobj to exist before you can determine their skin, and player mobjs don't exist yet when MapLoad is called.

Example: http://pastebin.com/eVNAJGGQ
 
Last edited:
Status
Not open for further replies.

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

Back
Top