Game Modding | Call of Duty: Black Ops 3 | Scripting
ModmeBot:
Thread By: Wild
Hello, over the past few days I have been learning how to script. I successfully made a script that added little credits in the bottom corner of the screen. I decided to test myself and try and put together something a bit more difficult. I am trying to create a script that allows me to shoot an object, and in return I would get Jugg. Again I am new to scripting and I am just trying to learn so please be nice lol.
Basically since I am trying to learn I don't need people to actually make the script the for me, rather I would like them to help explain to me what I did wrong and what needs to be changed. If it not a problem it would be great if you guys could explain why what I have is wrong and why the other ways are correct. I am not trying to make this script to actually use, it's just simply to help me learn and understand how to script so again, I am looking for explanations, not someone to make a script.
Here is what I did.
1) First I added "#insert scripts\zm\_zm_perks.gsh;" with the other #using lines of text at the top of my mapname.gsc.
2) Underneath "zm_usermap::main();" I added "level shoot_for_jugg();"
3) Finally, this is the script I wrote at the bottom of my mapname.gsc:
Before I added the last function (function give_jugg()) I was getting an error that stopped the linking process. After I added in this function the errors got fixed but whenever I launched the map it crashes before it fully loads in (during the blackscreen after you click run).
Once again I am looking for people to explain to me why this script isn't working, as well as explain to me what should be written and why. Thank you guys so much. I really appreciate it!
Remember, I am new to script and I am just trying to learn!
EDIT: I also added a scriptmodel with the targetname "give_jug_model" and surrounded it with a damage trigger with the targetname "trigg_for_jugg" incase you were wondering.
EDIT#2: Also if you're wondering, I wrote this based off of the basic stuff I learned, looking at a script for a shootable door and looking at a script used to give players multiple weapons at the start of the game. I looked at those and used the basics of scripting that I learned and wrote this. So just incase you need to know, that's what i wrote this based off of.
ModmeBot:
Reply By: Abnormal202
The problem is in how you referenced it. You typed:
when you should've threaded it:
because you didn't thread it, it would be causing the game to get stuck on that script, before anyone has even loaded in.
ModmeBot:
Reply By: Wild
Abnormal202
The problem is in how you referenced it. You typed: level shoot_for_jugg(); when you should've threaded it: level thread shoot_for_jugg(); because you didn't thread it, it would be causing the game to get stuck on that script, before anyone has even loaded in.
ModmeBot:
Reply By: Wild
FIXED:
Huge thanks to Abnormal and Jerri for helping me to get this working. Looking at it now I kind of understand how it works. Thanks guys