Modme Forums
Menu:

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

Game Modding | Call of Duty: Black Ops 3 | Scripting


ModmeBot:

Thread By: FrankXu225
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. And 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!


ModmeBot:

Reply By: Wild
Nate Smith wrote up a good beginner tutorial on his website.

You can find it here: http://natesmithzombies.com/wiki.html

I don't know how much it will help you with what you're trying to do but at least it gives you a better understanding of it I'd assume.


ModmeBot:

Reply By: Scorpiolo
My best advice would be to read the treyarch scripts and those created by people like NateSmithZombies, it will give you a better understanding gradually


ModmeBot:

Reply By: FrankXu225
Thanks AGC and Scorpiolo!! Nate's website looks really helpful! I will try to learn from that!

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!!!


ModmeBot:

Reply By: Dan9977

FrankXu225
Thanks AGC and Scorpiolo!! Nate's website looks really helpful! I will try to learn from that! 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!!!

I dont know about your specific spawner example but this is how you use triggers in scripts.
my_trigger = GetEnt ("whatever","targetname");
//set the target name of your trigger in radiant to whatever
while(1)
{
  my_trigger waittil ("trigger",player);
  //what you want to happen
}


ModmeBot:

Reply By: Abnormal202
MakeCents has a series of tutorials on how scripting interacts with radiant.

You can also ask me any questions


ModmeBot:

Reply By: FrankXu225

Dan9977
FrankXu225 Thanks AGC and Scorpiolo!! Nate's website looks really helpful! I will try to learn from that! 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!!! I dont know about your specific spawner example but this is how you use triggers in scripts. my_trigger = GetEnt ("whatever","targetname"); //set the target name of your trigger in radiant to whatever while(1) { my_trigger waittil ("trigger",player); //what you want to happen }

Thanks Dan! It works for me! I think I got the idea how to get an object from the editor then do things to it!


ModmeBot:

Reply By: FrankXu225

Abnormal202
MakeCents has a series of tutorials on how scripting interacts with radiant. You can also ask me any questions


Hi Abnormal202! Thanks for the link, MakeCents's videos are really helpful!

Can I ask you a specific question? I'm trying to force spawn a zombie at a certain location, I used

guy=SpawnActor("actor_spawner_zm_factory_zombie",(-372,-624,156),(0, 0, 0));

but after the zombie spawned at the location, he just stands still. I think that's because he does not have the zombie AI. Is there any way to add AI to the zombie after spawning them? And from the doc I see SpawnActor() takes an argument of AIType, is there any way to check all AIType data in the game? I found in Radiant there are "actor_spawner_zm_factory_zombie" and "actor_spawner_zm_factory_dog", but are there more? Like those flying wizards in Shadow of Evil map.

Thank you very much Abnormal202!!


ModmeBot:

Reply By: Abnormal202
yeah spawning zombies is one of the less convenient things to do. I got it working in my map, but I only had them spawn in the same zone as the player, not a specific point. Maybe you could get it working but I used the function found in zombie_utility.gsc :

function spawn_zombie( spawner,target_name,spawn_point,round_number) 
so since you're using a function from another script you have to put a:
#using scripts\shared\ai\zombie_utility;
at the top of your GSC and use the function like:
zombie = zombie_utility::spawn_zombie( spawner );


ModmeBot:

Reply By: FrankXu225

Abnormal202
yeah spawning zombies is one of the less convenient things to do. I got it working in my map, but I only had them spawn in the same zone as the player, not a specific point. Maybe you could get it working but I used the function found in zombie_utility.gsc : function spawn_zombie( spawner,target_name,spawn_point,round_number) so since you're using a function from another script you have to put a: #using scripts\shared\ai\zombie_utility; at the top of your GSC and use the function like: zombie = zombie_utility::spawn_zombie( spawner );

Thanks Abnormal! I will try your solution!