TheGameCreators / GameGuruRepo

The GameGuru Repository For Community Collaboration
http://www.game-guru.com
137 stars 56 forks source link

GG Max - How do we send character to next level after it kills a boss at end of level ? #2506

Open Tum1370 opened 2 years ago

Tum1370 commented 2 years ago

As the title says, How do we send the player to then next level after it kills a final boss on a level ? I can see win zones, but they only activate when you enter the zone.

Is it possible to have the boss drop a key or object on death, so we can use that object to enter new level ?

dllllllllllb commented 2 years ago

@Tum1370 I believe features like this will come to Max when we'll work on the RPG genre :]

Tum1370 commented 2 years ago

So really the only way currently to do this is for the player to enter the win zone?

thecyrus commented 2 years ago

I did this in GG by adding a line of code in the boss AI, but it would be a great feature to have Win conditions.

Tum1370 commented 2 years ago

@thecyrus How do we add a line of code please to do this ? And what line of code do you add ?

thecyrus commented 2 years ago

Just add the key command to finish a level, JumpToLevelIfUsed(e) in the exit procedure of an enemy. For example: function ai_ENEMY_exit(e) module_combatcore.releasecover(e) JumpToLevelIfUsed(e) end

And then you put the level name in the "IfUsed" property of the character.

In this case you win the level right when its health reaches zero, you don't even see it dying and win the level straight away.

Tum1370 commented 2 years ago

Thanks a lot, I will give that a try. Wouldn't changing that though make all enemy ai think exit game, or do they have separate scripts per character ?

It would be much better though if the devs add simple options for different scenarios though. Especially if they want this it be the really easy game creator.

I think i am going to try to learn bit of LUA so i can start to figure stuff out though.

thecyrus commented 2 years ago

What I wrote above was a GG Classic example. But if you put in the main function:

if g_Entity[e]['health'] == 0 then JumpToLevelIfUsed(e) end

It should go for your purpose.

Of course, you will have to use a separate script only for the boss.