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
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
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.
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.
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
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
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
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
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.
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
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).
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
"Deleted code is debugged code." - Jeff Sickel "Mathematicians stand on each others' shoulders and computer scientists stand on each others' toes." - Richard Hamming
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
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
Thanks guys, all these sites will help me out greatly 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
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