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

Looking for some scripting Basics and training.

HOT
broken avatar :(
Created 8 years ago
by XEcW22
0 Members and 1 Guest are viewing this topic.
5,501 views
broken avatar :(
×
broken avatar :(
Location: usNebraska
Date Registered: 2 January 2016
Last active: 1 year ago
Posts
113
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Custom Map Reviewer
My Groups
More
My Contact & Social Links
More
Signature
"Wourder"
                   - Brad Leone
×
XEcW22's Groups
Custom Map Reviewer Has permission to post map review topics in the Custom Map Reviews section of the forum.
XEcW22's Contact & Social LinksPapa bolsa de culoXEcW22
Hey guys, im pretty new here and was trying to learn some basic scripting with http://ugx-mods.com/wiki/index.php?title=Scripting_Guide. It isn't really making any sense and I was thinking that with the way i learn things the only way for me to get a little knowledge in scripting to to write a little basic script of my own. I was wondering if anyone was willing to help walk me through it and give me little tips and tricks as i go along in real time as im writing the script. I could also work on making scripted functions happen radiant and maybe someone could help me with that too. It would be something as simple as a button to turn a couple lights on( im pretty sure that script is out there somewhere, but I would like to change it up and write my own version to help me learn)or something else basic, but something as little as that will help me to get the hang of things and help me to write some scripts of my own. ;)

If anyone would like to help PM me or comment, Thanks :D
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Hey guys, im pretty new here and was trying to learn some basic scripting with http://ugx-mods.com/wiki/index.php?title=Scripting_Guide. It isn't really making any sense and I was thinking that with the way i learn things the only way for me to get a little knowledge in scripting to to write a little basic script of my own. I was wondering if anyone was willing to help walk me through it and give me little tips and tricks as i go along in real time as im writing the script. I could also work on making scripted functions happen radiant and maybe someone could help me with that too. It would be something as simple as a button to turn a couple lights on( im pretty sure that script is out there somewhere, but I would like to change it up and write my own version to help me learn)or something else basic, but something as little as that will help me to get the hang of things and help me to write some scripts of my own. ;)

If anyone would like to help PM me or comment, Thanks :D

The forums will help you, and there are other tuts and sites available. I don't mind assisting in alternative methods, and helpful tips, time permitting.

Here is a small beginner tut that may help:
http://ugx-mods.com/forum/index.php?topic=4339.0

Here is a site dedicated to scripting in cod:
http://codscript.net/portal/

And here are a few online free course sites that can help you learn object oriented languages:
edX
coursera
Udacity

Don't pay for anything on these sites, unless you want college credit or something.

- edX python courses are my favorite, using videos and interactive testing.

- coursera is more college like, but I liked their beginner C# courses

- Udacity is more fun, and easier, but I don't feel as structured or as long, so I don't think I learned as much, but good for quick intro.
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 3 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
Signature
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
I'd also recommend W3Schools: http://www.w3schools.com/default.asp

This site is only focused on web development stuff (HTML, CSS, JavaScript...), not cod scripts, but I'd recommend you to look some JavaScript stuff there because, in my opinion, JS and the game scripts (gsc) are really similar (I think that's why I got used to them really quickly).

You'd need HTML to run JS but, as it's only for learning the basics of scripting, I think it's a really good web.
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
I'd also recommend W3Schools: http://www.w3schools.com/default.asp

This site is only focused on web development stuff (HTML, CSS, JavaScript...), not cod scripts, but I'd recommend you to look some JavaScript stuff there because, in my opinion, JS and the game scripts (gsc) are really similar (I think that's why I got used to them really quickly).

You'd need HTML to run JS but, as it's only for learning the basics of scripting, I think it's a really good web.
I agree. I came here from previously Javascripting

only thing that screwed me is this :

Code Snippet
Plaintext
array.length // Javascript 
array.size // GSC
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
I wasn't gonna say anything, but I thought that ruby, basically a cross between python and javascript, was the most codscript like language myself. I can see see how people think javascript is more like it though, at least syntax wise.

Only real issue I think for me, is python was a lot more fun than javascript to me. A lot more fun. So that learning path, or transfer was easier for me. So, whichever way you go, have fun, cause that affects how much you "get it".
Last Edit: January 22, 2016, 08:47:49 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
I wasn't gonna say anything, but I thought that ruby, basically a cross between python and javascript, was the most codscript like language myself. I can see see how people think javascript is more like it though, at least syntax wise.

Only real issue I think for me, is python was a lot more fun than javascript to me. A lot more fun. So that learning path, or transfer was easier for me. So, whichever way you go, have fun, cause that affects how much you "get it".
Python has always been recommended to me, but at the time all i could do was javascript, now ive got sorta good at it, i had already moved on to this. Might revisit it one day tho, always hearing good things

as for ruby ive used that before, duno if we used something different coz i found it massivly different lol
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
The UGX scripting tutorial was never finished and what little there is isn't very good, for example:

Quote
To acquire any ent, it MUST BE SET AS A SCRIPT_MODEL (XMODEL) OR SCRIPT_BRUSHMODEL (BRUSH) IN ORDER TO BE SEEN BY SCRIPT.

This isn't entirely true. Yes, getEnt() will get those types of entities but it can also get spawners, triggers, and a few others i can't remember right now.

IMO, Ruby looks NOTHING like GSC/CoDScript. Its more like C in terms of syntax and the fact that it isn't (really) an Object Orientated language(though you do work with "objects").

You could jump right in as I did and learn by looking at the scripts themselves. The problem with that is that Treyarch are very sloppy and make things way harder than they need to even be at times.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Really?

I took a ruby on rails course on codecademy, forgot to mention that one, that was short, but used similar syntax, switch cases and arrays instead of tuples. But maybe I'm missremembering.
Last Edit: January 23, 2016, 12:11:10 am by MakeCents
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Really?

I took a ruby on rails course on codecademy, forgot to mention that one, that was short, but used similar syntax, switch cases and arrays instead of tuples. But maybe I'm missremembering


C definitely looks closer than Ruby to GSC to me. The two biggest differences being:

A. Functions must specify what its returning, while GSC doesn't.

B. Variables must be initialized to the data type that it will be holding(for example, an (int)eger).
Last Edit: January 23, 2016, 12:08:51 am by daedra descent
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha

C definitely looks closer than Ruby to GSC to me. The two biggest differences being:

A. Functions must specify what its returning, while GSC doesn't.

B. Variables must be initialized to the data type that it will be holding(for example, an (int)eger).


I rechecked the documentation and at least the parts I experienced of it was similar. But that's coming from vba, to python, to ruby. Maybe coming from a language that used bracketing more I wouldn't think that. But that was my first experience with arrays and brackets. Switching from python to ruby to codscript (gsc) felt fairly seamless to me. I do see a part of ruby that doesn't look like it at all as well. So I completely understand.

As far as what you posted, sure, I didn't think I said it was or wasn't like C, cause I don't know C. But this brings up an interesting point. I've seen this difference in people who write code for some time. There seems to be two mainly different types of people when it comes to learning programming. Other than those that just don't get it. Those like you, that seem to have more of an understanding of the guts and the structure and could make there own language and write assembly language.Unless this guy is a cs major, planning to be an IT guy, I doubt that's him.  And those of us that don't get that involved, stay at the high level, and don't see the underlying differences at all. While taking some of these courses, the professors even warned us about this difference. I think it might even have to do with learning say c type language first, instead of python type of language first, but who knows.

To the OP, If those that know more disagree, then I would listen to them to start.
Last Edit: January 23, 2016, 12:43:21 am by MakeCents
broken avatar :(
×
broken avatar :(
Location: be
Date Registered: 17 August 2013
Last active: 2 years ago
Posts
369
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
Web & Software Developer and Designer
Signature
"Deleted code is debugged code." - Jeff Sickel
"Mathematicians stand on each others' shoulders and computer scientists stand on each others' toes." - Richard Hamming
×
JR-Imagine's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
It depends if you ever want to use any other language than GSC, honestly. GSC is a TERRIBLE base to learn different languages due to its lax nature. If you just want to be able to script for CoD, I'd read a basic scripting guide and learn from scripts included with the modtools (probably best of with CoD4 ones, Treyarch's scripting for WaW is definitely sub-par to IW's). I wrote some tutorials on scripting basics myself: http://codscript.net/topic/440-beginners-guide-the-index/ Make sure you try things out and modify bits and pieces to see what everything does, it's the way I learn most languages once I know their basic syntax and conventions and it's a rather effective way of learning a language.

If however, you do wish to learn different languages in the future, I'd recommend to start with something other than GSC. My advice would be to learn C#, it's syntactically similar to GSC (both are C-based) and isn't too hard to pick up on. DO NOT learn any language by watching YouTube videos, all you would do is copy, you'd learn nothing. If you're looking for more of a challenge, I'd go with C++ (avoid C itself, it's awfully outdated and isn't object oriented, which is a must for modern day programmers).
Last Edit: January 23, 2016, 01:44:10 am by JR-Imagine
broken avatar :(
×
broken avatar :(
Location: usUnion, Kentucky
Date Registered: 9 September 2013
Last active: 1 year ago
Posts
310
Respect
Forum Rank
Perk Hacker
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
lilrifa's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
lilrifa's Contact & Social Linksskypeuser724lilrifalilrifa
only thing that screwed me is this :
Code Snippet
Plaintext
array.length // Javascript 
array.size // GSC
Same here, Harry. Took time to get used to array.size. I tried to loop through an array and it did not go well.

Double Post Merge: January 23, 2016, 02:01:34 am
If however, you do wish to learn different languages in the future, I'd recommend to start with something other than GSC. My advice would be to learn C#
C# and Java, which I learned at the same time, were my first languages. Definitely good to know when using GSC, helped me out a lot, anyway.
Last Edit: January 23, 2016, 02:01:34 am by lilrifa
broken avatar :(
×
broken avatar :(
Location: usNebraska
Date Registered: 2 January 2016
Last active: 1 year ago
Posts
113
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Custom Map Reviewer
My Groups
More
My Contact & Social Links
More
×
XEcW22's Groups
Custom Map Reviewer Has permission to post map review topics in the Custom Map Reviews section of the forum.
XEcW22's Contact & Social LinksPapa bolsa de culoXEcW22
Thanks guys, all these sites will help me out greatly :D Hope to be learn' some scripting ;)
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Thanks guys, all these sites will help me out greatly :D Hope to be learn' some scripting ;)
if you wanted to learn from treyarchs stuff i would recommend looking through _zombiemode_perks.gsc ( and dlc3_code.gsc for anything you cant find, like the power switch functionality )

I see a lot of people voting against that one as a start point, by was the first thing i came into here, and found it "fairly" easy to read. It clearly defines the functions for turning the induvidual machines on ( alhtough does them each "hard coded" instead of in some "dynamic" way )

Its pretty much a standalone, so anything you need, or relates to it, is pretty much in that file somewhere. Anything that isnt - will be in one of the scripts listed at the top

It covers how and where to properly thread, so that you can "precache" corectly, before moving onto the code to execute "after" load ( so the main functionality ) - precaching is very important, so a good place to see what they did

Its also shows you rought examples of how to use and swap models, use FX, use sounds, use hud elements to show things like the perk icons and interact with a players inventory and points

Id maybe give that a quick read or two, if it seems to confusing then maybe look at something else. youll find the top is the "init" function for geting started, below that is that pack a punch functionality, and below that is the "perks" functionality. So Is quite basically laid out
Last Edit: January 23, 2016, 06:35:59 am by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: usNebraska
Date Registered: 2 January 2016
Last active: 1 year ago
Posts
113
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Custom Map Reviewer
My Groups
More
My Contact & Social Links
More
×
XEcW22's Groups
Custom Map Reviewer Has permission to post map review topics in the Custom Map Reviews section of the forum.
XEcW22's Contact & Social LinksPapa bolsa de culoXEcW22
if you wanted to learn from treyarchs stuff i would recommend looking through _zombiemode_perks.gsc ( and dlc3_code.gsc for anything you cant find, like the power switch functionality )

I see a lot of people voting against that one as a start point, by was the first thing i came into here, and found it "fairly" easy to read. It clearly defines the functions for turning the induvidual machines on ( alhtough does them each "hard coded" instead of in some "dynamic" way )

Its pretty much a standalone, so anything you need, or relates to it, is pretty much in that file somewhere. Anything that isnt - will be in one of the scripts listed at the top

It covers how and where to properly thread, so that you can "precache" corectly, before moving onto the code to execute "after" load ( so the main functionality ) - precaching is very important, so a good place to see what they did

Its also shows you rought examples of how to use and swap models, use FX, use sounds, use hud elements to show things like the perk icons and interact with a players inventory and points

Id maybe give that a quick read or two, if it seems to confusing then maybe look at something else. youll find the top is the "init" function for geting started, below that is that pack a punch functionality, and below that is the "perks" functionality. So Is quite basically laid out
cool man, will defiantly give it a read through or two, thanks for the suggetion ;)

 
Loading ...