Go Back   Savage 2: A Tortured Soul Forum > Savage 2 Modding > Documentation

Notices

Documentation Post useful tutorials and other informative material.

Reply
 
Thread Tools Display Modes
Old 03-04-2012, 02:59 PM   #81
Pidgeoni

Pidgeoni's Avatar
 
Join Date: Jul 2009
Posts: 1,734
Thanks: 185
Thanked 317 Times in 190 Posts
Default

Had that too rancho, a clean install of archlinux fixed it for me :|


Here's how to check if a file exists for a client

The "FileExists" function is server only, as stupid as that is.
For the "ForEachFile" sintax, just type the command in console.
The "file_exists" variable is a custom one, but there are other "file_*" variables that are used by the "ForEachFile" command if you are interested in having a look.

HTML Code:
Set file_exists false
ForEachFile * /path/to/file filename true "Set file_exists true"
UI equivalent:

HTML Code:
Set('file_exists',0);
ForEachFile('*','/path/to/file','filename',true,Set('file_exists',1));
You can also GetCheckSum but it prints an error if file is not found.

Last edited by Pidgeoni; 03-07-2012 at 04:44 PM.
Pidgeoni is offline   Reply With Quote
Old 04-18-2013, 02:23 PM   #82
Durwyn

 
Join Date: Jul 2011
Location: Belgium
Posts: 264
Thanks: 47
Thanked 67 Times in 54 Posts
Default

Quote:
Originally Posted by rohezal View Post
Broken Comment:

//this is a comment; this isnt a command anymore

I had a //string; lets ... comment in my script and was wondering why warnings were written
Another way to break a comment:

Quote:
//Set active #IsEntityActive(|#index#)#
The function will be called even though it's supposed to be a comment. way to waste time.
__________________
Operating System: Windows 7 x64
Graphic card : Geforce GT 540M
RAM : 8gb
Savage2MapsAI
Durwyn is offline   Reply With Quote
Old 04-18-2013, 03:07 PM   #83
rohezal

rohezal's Avatar
 
Join Date: Mar 2008
Posts: 2,610
Thanks: 112
Thanked 136 Times in 106 Posts
Default

I noticed this first way, the second is new to me. Thank you for sharing .
__________________

http://xs229.xs.to/xs229/08295/image_get.php939.jpeg

I love VOIP
sing: "base, base, base, base, base, base, base"

Why only 15 year old girls? Since 4 Years, damn I'm doing something wrong...

One day I will find out who is responsible for the K2 scripting "language" and the modding "support". And then...

rohezal is offline   Reply With Quote
Old 12-29-2013, 01:06 PM   #84
PetzI

PetzI's Avatar
 
Join Date: Jun 2007
Posts: 1,814
Thanks: 17
Thanked 72 Times in 50 Posts
Default

Avoid using 7zip to open .s2z files. I started using it and Savage 2 refused to read the .cfg files I edited, so I vividly recommend WinRAR.
PetzI is offline   Reply With Quote
Old 12-29-2013, 03:54 PM   #85
Durwyn

 
Join Date: Jul 2011
Location: Belgium
Posts: 264
Thanks: 47
Thanked 67 Times in 54 Posts
Default

For the .cfg files it works with Winrar, however if you want to work with the interfaces, they will get corrupted once you zip(winrar'd) them :-/

Since Holleau mentionned Total Commander a while back, since then, im using it no problem!
__________________
Operating System: Windows 7 x64
Graphic card : Geforce GT 540M
RAM : 8gb
Savage2MapsAI
Durwyn is offline   Reply With Quote
Old 12-29-2013, 06:29 PM   #86
PetzI

PetzI's Avatar
 
Join Date: Jun 2007
Posts: 1,814
Thanks: 17
Thanked 72 Times in 50 Posts
Default

Ooh, that's good to know.
PetzI is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 05:40 AM.