Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO1 Modding Support & Discussion
  3. T5 GSC script command listener stops listening after dying in zombies (sometimes)

T5 GSC script command listener stops listening after dying in zombies (sometimes)

Scheduled Pinned Locked Moved BO1 Modding Support & Discussion
1 Posts 1 Posters 16 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • callmejafundefined Offline
    callmejafundefined Offline
    callmejaf
    wrote last edited by callmejaf
    #1

    So I use this format in pretty much all of my GSC scripts to listen to commands.
    Below is an example for my easteregg song script.

    init()
    {
        if (GetDvar("mapname") == "frontend")
            return;
    
        level thread jf_ee_on_connect();
    }
    
    jf_ee_on_connect()
    {
    	level endon("game_ended");
        for (;;)
        {
            level waittill("connected", player);
            player thread jf_ee_listener();
        }
    }
    
    jf_ee_listener()
    {
        self endon("disconnect");
        level endon("game_ended");
        self notifyOnPlayerCommand("jf_easteregg_cmd", "jf_easteregg");
        for (;;)
        {
            self waittill("jf_easteregg_cmd");
    
            self iPrintlnBold("^5Playing Easter Egg song...");
    
            self thread jf_play_easteregg_song();
        }
    }
    

    And I am trying to work out why exactly it will work perfectly fine, but after dying and clicking "restart level", I will get hit with
    "Unknown command: jf_easteregg" when I try it again...

    The fix is just to click restart again.. and it fixes..

    To make matters worse, i can't even replicate the bug consistently. It doesn't happen every time you go down and click restart, but it has never happened mid game and is always during that edge case.
    What am i doing wrong?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Donate