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

Plutonium

  1. Home
  2. BO1 Client Support
  3. GSC API Guide

GSC API Guide

Scheduled Pinned Locked Moved BO1 Client Support
6 Posts 4 Posters 488 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • sjakedudeundefined Offline
    sjakedudeundefined Offline
    sjakedude
    wrote on last edited by
    #1

    Hello,

    So I am pretty new to this Plutonium stuff, but I have been messing around with console commands and I have some 'big' plans for a custom Gun Game server for me and my gf but in order to do that I need some knowledge gaps filled in.

    I am aware that there are these scripts called "gsc scripts" that we can add to our /storage/t5/scripts directory, and these will run as soon as a game is launched (like running map mp_nuked). I made this simple test_script.gsc that looks like this:

    main()
    {
        print("YO");
        self thread MessagePrinter();
    }
    
    MessagePrinter()
    {
    
    	while (1)
    	{
    	  if(self MeleeButtonPressed())
    	  {
    		print("IN MESSAGE PRINTER!!!");
                    wait 1;
    	  }
    	wait 0.05;
    	}
    }
    

    With this, I get many log messages in the console like this:

    alt text

    Pretty exciting huh? Well... I have bigger goals than this. And also, the log message prints whether or not I am pressing the melee button so there's that. I guess for some reason self MeleeButtonPressed() is resolving to True even though I have not pressed anything.

    1. What is the purpose of this github repo? It seems to be a TON of scripts for T5, but are we supposed to have all of these downloaded and put into our local script directory? Or are these just examples to reference?

    2. Where can I find an API for all the different listener methods there are in gsc scripts? For instance, I have seen some scripts with functions like this:

    OnPlayerSpawned()
    {
       self thread GiveMoney();
    }
    

    I assume this method will be called when any player spawns into the game? Where can I find the docs on what exactly these key words mean?

    I have a lot of programming experience as I code full time for a living, so I will just need a bit of direction here and I will be off scripting away!

    Maybe if someone is willing to explain this over a discord call that would be better. Let me know.

    Thanks!

    JezuzLizardundefined 1 Reply Last reply
    0
    • hindercanrunundefined Offline
      hindercanrunundefined Offline
      hindercanrun
      wrote on last edited by
      #2

      You can do a lot with GSC.

      1 Reply Last reply
      0
      • sjakedudeundefined Offline
        sjakedudeundefined Offline
        sjakedude
        wrote on last edited by
        #3

        so is there any API guides out there for gsc?

        1 Reply Last reply
        0
        • JezuzLizardundefined Offline
          JezuzLizardundefined Offline
          JezuzLizard Plutonium Staff
          replied to sjakedude on last edited by
          #4

          sjakedude https://www.3dmappers.com/kunena/tutorials-and-helpful-information/1517-gsc-language-reference This is for T7 but most of it will apply to T5.

          The purpose of the t5-scripts repo is to make easily accessible all the scripts the base game uses. You do not need to have them installed as they are just dumped from the game's files so they are always available to be referenced in your scripts.

          I recommend perusing the t5-scripts repo to make it easier to learn the syntax and structure of scripts by example.

          As for your script you made a mistake in that self does not exist or rather it references the level entity instead of any player entity. You can get the players in a server with the getPlayers() function and it returns an array of players you can call functions on.

          If you have further questions you can ask here or dm me on discord JezuzLizard#7864

          sjakedudeundefined 1 Reply Last reply
          1
          • sjakedudeundefined Offline
            sjakedudeundefined Offline
            sjakedude
            replied to JezuzLizard on last edited by
            #5

            JezuzLizard Hey thank you so much, this is super helpful information. I will add you on discord, but I probably wont bother you a ton as you have given me a lot to work with. Thanks again

            1 Reply Last reply
            0
            • Resxtundefined Offline
              Resxtundefined Offline
              Resxt Plutonium Staff
              wrote on last edited by
              #6

              The best would be to use the modding channels on our Discord, which is meant for real time chat and has some useful resources pinned and people who can help as well. Most of them only look at the Discord server and rarely/never talk about modding on the forum

              1 Reply Last reply
              0

              • Login

              • Don't have an account? Register

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