UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Is there a complete 0 to 1 scripting doc or tutorial?

broken avatar :(
Created 7 years ago
by frankxu225
0 Members and 1 Guest are viewing this topic.
5,187 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 5 May 2017
Last active: 6 years ago
Posts
3
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
frankxu225's Groups
frankxu225's Contact & Social Links
Hi guys! I'm a newbie to BO3 mod tool and I haven't touch Radiant or GSC before. I have some experiences with C#(unity), LUA (LOVE2D) scripting. But when I'm trying to learn GSC in BO3, I'm kinda blocked and confused. I watched many scripting tutorials on YouTube from JBird, Uptown and many other awesome YouTubers. But most of those tutorials were using a pre-made prefab/scripts to achieve things. They didn't explain how each line work and why. Thus it's really hard for me to guess all the APIs and how to use them. Is there any doc, wiki or tutorial series teaching people how to do GSC from 0 to 1? Like write the first "hello-world" script then later use a trigger to start a lock-down zombie event?
 
I'm trying to do the similar event from Shaow of Evil: after the player using a trigger, all doors lock and spawn ghost wizards. After the player kills all wizards, all doors unlock. Right now I can think the logic of this event, but I don't know how to use GSC and Radiant to implement my logic. I don't know how to use triggers to spawn enemies. Or how to add those wizards into my level. So if you guys can help me out, you are much appreciated. :D
 
Anyway, BO3 Mod tools with GSC looks really powerful. To me it looks like a simplified unity, if there is a complete scripting tool, I'm pretty sure it will be really helpful!
 
Thank you all in advance! :)
broken avatar :(
×
broken avatar :(
Location: usSouth Florida
Date Registered: 10 July 2016
Last active: 12 months ago
Posts
106
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
Signature
Let he who has not sinned cast the first stone.
×
Archaicvirus's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Archaicvirus's Contact & Social Links
In your black ops 3 root folder, look for a folder named 'docs_modtools'. In there, read the GSC_language file. You'll see other docs in there that will help with the basics. Now as far as the api goes, all the functions (or most of) are defined with examples  in the bo3_scriptapifunctions pdf in that same folder. If you already have coding experience, in my opinion this won't be that difficult for you. If I were you I would set up sublime with the syntax highlighting package - included in the docs_modtools folder. Once you have that set up, in sublime hit view > syntax > GSC on any scripts you're working on. This will help get you started - https://confluence.ugx-mods.com/display/UGXMODS/Black+Ops+3+Modtools.

You can find existing scripts in root>raw>share>scripts to read and learn from. This is mostly how I learned gsc between reading ugx communnity scripts, and the ones included in the game. Also, feel free to use the help forums for any specific topics you're having issues with. When I started out, one of my brothers was starting out at the same time, so we sort of had this back and forth collab where we shared problems and solutions in scripting and helped each other learn where the other succeeded. It definitely helps to have someone to work with if that's an option for you. Anyways, hope this info helps, I don't mind answering any questions you have, If I don't know the answer I'm sure someone else will, and if all else fails just use the help forums and usually someone will reply within a day or so.
Last Edit: May 07, 2017, 06:01:50 pm by Archaicvirus
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 5 May 2017
Last active: 6 years ago
Posts
3
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
frankxu225's Groups
frankxu225's Contact & Social Links
Thank you very much! I will follow your advice and read those docs!! This is really helpful!

And is there any doc or tutorial teaching how to interact a game object with functions? Like if I have a spawner and a trigger multiple in the game, how can I connect these two with a function? So I use the trigger, then the game calls the function, and the function makes the spawner spawn a zombie. Are there any examples like this?

Meanwhile, is there any way I can read some scripts from the map Shadow of Evil? It looks like this map has the most complicated mechanics in all zombie modes. It's also possible this map is hard coded, but I really wish it's not...

Anyway, thank you for the good advice!! I will try to discover more things and share with the community! You guys are awesome!!! :D
broken avatar :(
×
broken avatar :(
Location: usSouth Florida
Date Registered: 10 July 2016
Last active: 12 months ago
Posts
106
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
×
Archaicvirus's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Archaicvirus's Contact & Social Links
Glad to help man.

Quote
and is there any doc or tutorial teaching how to interact a game object with functions? Like if I have a spawner and a trigger multiple in the game, how can I connect these two with a function? So I use the trigger, then the game calls the function, and the function makes the spawner spawn a zombie. Are there any examples like this?

In radiant, objects you want to be available to script need to be entities, which include triggers, player volumes, script_model, script_brushmodel, script_origin, script_struct and some others. You can acquire them as a variable in script a few different ways. It depends on what you're doing. For triggers though, first how are you activating the trigger? This needs to be set up in the trigger's kvp's. So if you want the trigger to activate when a player enters the area (inside the trigger), then trigger_multiple is already set up by default to only trigger on players, I believe. Check the kvp's on a new trigger_multiple to verify that. The kvp's you're looking for are at the top of the list.

Anyways you can easily find a trigger in a script by giving the trig a kvp script_noteworthy: some_variable, or targetname: some_name. Other kvp's work too you just have to experiment.

Code Snippet
Plaintext
//In your mapname.gsc, add this at the top with the others:
#using scripts\zm\my_custom_script;

//Then add this line in the main() function at the bottom:
level thread my_custom_script::initialize();

//Then in your mapname.zone file, add this line in there with the others:
scriptparsetree,scripts/zm/my_custom_script.gsc

//Now in usermaps/mapname/scripts/zm folder create a new text file, hit save as - my_custom_script.gsc
//So now you have a file you where you can experiment with scripts. In that file, paste all the "#using scripts\blahblah;" lines from your
//mapname.gsc file just to get you started. Some of the default functions you might use could need some of these scripts for the functions to work.
//So paste these at the top, you can figure it out. Just look at some of the other scripts.
//Then add the function you called earlier:

function initialize(){
level flag:wait_till("all_players_connected");
thread my_custom_function();
}

//If you want to press a button to activate the trigger, it needs to be a trigger_use, instead of a trigger_multiple
//Then add something like:
function my_custom_function(){
my_trig = GetEnt("custom_name", "targetname");
while(true){
my_trig waittill("trigger", player);
IPrintLnBold("Hello world");
//I'm not sure how to spawn a zombie, you'll have to look that up in the forums or make a help topic, sorry.
wait(1);
}
}
Last Edit: May 12, 2017, 11:57:14 pm by Archaicvirus

 
Loading ...