Coding

Avatar
TheDarkness73
14 Posts
Posted Jun 06, 2011
Is there any specific program in the editor for coding, because I don't see any. So that leaves the question, how do we code it and import it? Is there any place where they have tutorials for coding, or coding in portla 2?
Advertisement
Registered users don’t see ads! Register now!
Avatar
ChickenMobile
2,460 Posts
Posted Jun 06, 2011
Replied 5 minutes later
Coding would be the same for any source game, and it would be called 'scripting' rather than coding. The most native scripts come in a .cfg file which is just a text file with its' extension renamed.

You can find a TF2 example here: http://www.tf2wiki.net/wiki/Scripting

Portal 2 comes with scripts with a .nut extension rather than .cfg extension as they can execute more complex scripting, with the added feature of functions (similar to any type of coding).

Avatar
TheDarkness73
14 Posts
Posted Jun 06, 2011
Replied 10 minutes later
Okay, thanks. So I can open the files with like notepad or along those lines?
Avatar
TheDarkness73
14 Posts
Posted Jun 06, 2011
Replied 1 minute later
And, how would I import it. Like, I wanna make a gel, but I have to script it, and then make a model for it. How would I put all of this into Portal 2?
Avatar
ChickenMobile
2,460 Posts
Posted Jun 06, 2011
Replied 16 minutes later
You can look at the scripts Valve has made by looking in the appropriate folders: common/portal 2/portal2/scripts/vscripts. This might give you a better example on how to make it yourself.

And by reading another thread, gels just use a texture on a particle. You might want to have a look at it: mapping-help/changing-gel-colours-t3208.html

Avatar
TheDarkness73
14 Posts
Posted Jun 06, 2011
Replied 7 minutes later
Okay thanks. After I posted, I thought about just changing the gel color. So, how would I include the script in though? Just put it in a folder? I'm gonna check the valve scripts just to see if it's individual for each script or not, not sure yet though
Avatar
TheDarkness73
14 Posts
Posted Jun 06, 2011
Replied 3 minutes later
Notepad does work with nut files, alright, part of the way there :biggrin: Now need to figure out the rest of how to make the gel. Is there any scripting or anything for allowing gel or portals to bounce, kinda like in pool, where the bounce off at the same angle and what not?
Avatar
ChickenMobile
2,460 Posts
Posted Jun 06, 2011
Replied 5 minutes later

TheDarkness73 wrote:
Is there any scripting or anything for allowing gel or portals to bounce, kinda like in pool, where the bounce off at the same angle and what not?

I personally haven't messed around with this. There probably is a script somewhere inside the script folders that manages the different gels.

Advertisement
Registered users don’t see ads! Register now!
Avatar
TheDarkness73
14 Posts
Posted Jun 06, 2011
Replied 30 minutes later
Okay, thanks alot for the help.