Skip to content

Add coop on/off functionality#4575

Open
Endernice61 wants to merge 10 commits into
BEEmod:devfrom
Endernice61:coop_on_off
Open

Add coop on/off functionality#4575
Endernice61 wants to merge 10 commits into
BEEmod:devfrom
Endernice61:coop_on_off

Conversation

@Endernice61
Copy link
Copy Markdown
Contributor

@Endernice61 Endernice61 commented Aug 21, 2025

Added enum for player teams in portal_man.nut
Added PortalGun class to store information about what portals the portal gun can shoot with method to apply it to an actual weapon_portalgun
No longer waits 2.5 seconds to find players as this method does not work for published maps
Added on_blue_spawn() and on_oran_spawn() which gets called when the bots respawn, or shortly after the bots spawn for the first time. Retrieves the handles for the players' portal guns and sets their kevalues appropriately
_find_players() will now call in_hover_phase() and register the callback function on_death(player, dmgtype) for BotDeath
Added in_hover_phase() which waits until bots are able to move, then calls on_blue_spawn() and on_oran_spawn() to set up portal gun keyvalues
Added on_death(player, dmgtype), which calls waitForBlueRespawn() or waitForOrangeRespawn() depending on the bot that died
Added waitForBlueRespawn() and waitForOrangeRespawn(), which waits until the bot no longer has 0 health, then calls on_blue_spawn() or on_oran_spawn(), respectively
init(blue, orange, has_onoff initializes PortalGun classes for both bots and calls waitForPlayers()
Added waitForPlayers(), which waits until the players handles can be retrieved with vscript, then calls _find_players()
return_pgun() will set the bots' portal gun's keyvalues
Added set_gun(pgun, team) to set a bot's portal gun to match pgun
pgun_btn_deact() and pgun_btn_act() now update bots' portal guns
Added set_pgun_keys(gun) to set keyvalues on spawned portal guns in singleplayer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants