Vice Underdogs
Scripting => Scripting Support => Topic started by: Charley on July 25, 2011, 03:46:17 pm
-
Squirrel files are .nut files. They pretty much just text files and thus can be edited by any text editor, though the recommended one is notepad++
You can download it for free here: http://notepad-plus-plus.org/
Once you've downloaded and installed it download the Squirrel for Notepad++ (http://files.iv-multiplayer.co.uk/scripts/boylett/Squirrel%20for%20Notepad++.zip) language file. Extract the .zip and move the file userDefineLang.xml to Notepad++'s AppData directory.
The AppData directory for Notepad++ is either:
C:\Users\your user\AppData\Roaming\Notepad++
or
C:\Users\your user\AppData\Notepad++
depending on the operating system.
When viewing a .nut file, if the program hasn't done it automatically go to the language tab at the top, click it and click Squirrel, which should be near the bottom.
Unlike PAWN, squirrel does not require compiling so you can just save the .nut file and run the server.
As a starting point I would recommend looking at this example: http://liberty-unleashed.co.uk/VCWiki/Scripting/Squirrel/Examples/SQLite
Reading through that a few times and trying it out yourself is one of the best ways to get familiarised with the syntax of both Squirrel and the in built SQLite features.
Another useful tool is the SQLite browser (http://sourceforge.net/projects/sqlitebrowser/). This allows you to create and sort through your databases. It can be easier than always using the SQLite script functions.
-
Sorry for this post being totally irrelevant but...
hey,
is that my brother's voice I'm hearing through the internet??????????
-
Sorry for this post being totally irrelevant but...
hey,
is that my brother's voice I'm hearing through the internet??????????
yes its the
(https://viceunderdogs.com/proxy.php?request=http%3A%2F%2Fwww.treehugger.com%2Fwind-turbines-spain-y001.jpg&hash=cfbe3b0db33d9e88aafdccca2f7536f993e6cf4e)(https://viceunderdogs.com/proxy.php?request=http%3A%2F%2Fblog.loftsatsodo.com%2Ffiles%2F2011%2F06%2Flord-of-rings.jpg&hash=a51b1e8eaff1087cc4e3d26a64933b10cceb7791)
-
Sorry for this post being totally irrelevant but...
hey,
is that my brother's voice I'm hearing through the internet??????????
Indeed it is.
-
Well, the best way to start scripting, in my opinion, is, not only to download a simple gamemode and edit some stuff, but to actually try to make what the author did, in your own way. You will earn lots of logic through this.
A Good way to start:
- Read lots of archives and tutorials - This is my opinion is VERY IMPORTANT. Use google for fuck sake.
- Find functions on the wiki and test them - I believe that this is also very important, this helped me alot to comprehend LUA and Squirrel.
- Make EVERYTHING YOURSELF - Obviously --', Try ALWAYS to make your own functions. Unless it's something mathematical and you don't understand it that well (for example Charley's direction function)
- "ZOMG I HAZ ERROR PLS SCRIPTER HELP MI" - Don't do this. You won't learn if you are asking others to do your own code. If something isn't working, dont give up just yet! Try to fix it, read everything again. If it still doesn't work, rewrite the code again. IF IT STILL doesnt work THEN post it up and we'll see what's wrong.
- Try to keep the code clean and simple - If you are learning how to script it is VERY USEFUL if you comment stuff on everything you do. For example: (A code I didn't test, but I am sure it will work LOL)
function PrintMessage()
{
local Name = "Fred"; //My variable Name will return Fred!
local Age = 1337; //My variable Age will return 1337, Damn he's old!
print("My name is " + Name + " and I am " + Age); //This will print in my console the local variables I assigned :D
}
Doing this will make your life 100000000000000000000x easier to understand.
.
Yey, I might add some moar stuff I dunno. But seriously the stuff I wrote here HELPED ME ALOT while I was learning LUA/Squirrel.
-
Yey, I might add some moar stuff I dunno. But seriously the stuff I wrote here HELPED ME ALOT while I was learning LUA/Squirrel.
And you still suck *runs fast*
-
:'(
-
Yey, I might add some moar stuff I dunno. But seriously the stuff I wrote here HELPED ME ALOT while I was learning LUA/Squirrel.
And you still suck *runs fast*
lol
Btw, thx for the tips. I might start learning scripting since I'm done exploring vc-mp (and it's getting boring...).
My whish is to make a server dedicated to the medieval ages. Where, like they are two territories.
There is a car with a pink market near it. You stand on the market and some constrols pop up to adjust the car at X, Y. Then you press a key to fire the car and the car launches it self to the enemy terrirory while been in flames. Something like a catapult.
That'll be awesome :D
-
Btw, thx for the tips. I might start learning scripting since I'm done exploring vc-mp (and it's getting boring...).
My whish is to make a server dedicated to the medieval ages. Where, like they are two territories.
There is a car with a pink market near it. You stand on the market and some constrols pop up to adjust the car at X, Y. Then you press a key to fire the car and the car launches it self to the enemy terrirory while been in flames. Something like a catapult.
That'll be awesome :D
Hmmm... ok..
Go to the enemy territory and throw a grenade? ???
-
Btw, thx for the tips. I might start learning scripting since I'm done exploring vc-mp (and it's getting boring...).
My whish is to make a server dedicated to the medieval ages. Where, like they are two territories.
There is a car with a pink market near it. You stand on the market and some constrols pop up to adjust the car at X, Y. Then you press a key to fire the car and the car launches it self to the enemy terrirory while been in flames. Something like a catapult.
That'll be awesome :D
Hmmm... ok..
Go to the enemy territory and throw a grenade? ???
No no no, no modern weapons.......
Smth like Knights vs Samurais. The Samurai's weapons could be katanas and........ I dunno if you'll agree, but python as a bow? :D Their will be only 4 players with a "bow", standing on a wall or smth.
The Knight's weapons could be Machete and again - 4 players with a python.
-
I don't want to be hatin' on WindLord, or anything. But after spending 20 minutes watching these tutorials, I consumed very little information and became rather depressed. The video was rather slow and a bit uncoordinated. I also find it weird that he started of these tutorials with stuff like structures, why not start with the basics of the syntax and variables?
-
Actually I agree, I first watched Windlord's first video when I had already written the script for XE and most of it was new to me. The videos aren't a good starting point for learning how things work, they're better to look at after you've learnt to see why things work.
I'll remove them from the first post.