Forum breadcrumbs - You are here:ForumCommunity Boards: Hammer and ModdingCoding
Please or Register to create posts and topics.

Coding

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?

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).

?????????????????????????????TWP Releases | My Workshop

Okay, thanks. So I can open the files with like notepad or along those lines?

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?

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

?????????????????????????????TWP Releases | My Workshop

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

Notepad does work with nut files, alright, part of the way there :D 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?

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.

?????????????????????????????TWP Releases | My Workshop

Okay, thanks alot for the help.