SRL Archive - News and General

Coming soon


Shuttleu

2011-08-12 18:51:40

Coming soon to all my scripts


im sure you can guess what that is and im sure the people who use my script will be happy

~shut

EDIT: if the user is running more than one instance of the same script then it will give them a option for which one they want to do it for

EDIT: i mainly made this out of spite because Coh3n wouldn't let me do one for MSI

kingarabian

2011-08-12 18:58:18

Looks very nice Shut!

Shuttleu

2011-08-12 19:00:53

oh and i also forgot to mention

if the user is running more than one instance of the same script then it will give them a option for which one they want to do it for

~shut

Coh3n

2011-08-12 19:31:52

Cool. :)

Shuttleu

2011-08-12 19:35:44

From: Coh3n
Cool. :)


updated first post :p

~shut

Coh3n

2011-08-12 19:41:53

From: Shuttleu
if the user is running more than one instance of the same script then it will give them a option for which one they want to do it for

~shut
Mind tell us how you do this?

And what? Lol I didn't say you couldn't do it, I just said the new form is going to be the remote when it's done so there isn't two code files for forms that do the exact same thing. There's no point in having two different forms for the same purpose as both will need to be updated. You could have worked on the actual form (which will be used as the remote anyway). It wouldn't have been any different. :p

Shuttleu

2011-08-12 19:50:20

basicly it has a constant which is the extension (.ini)
then it has a variable which is set depending on which option is clicked in the menu (AppPath+'Scripts/VVRemote') or (AppPath+'Scripts/ShiloRemote)

the script on startup will scan the AppPath+'Scripts' folder for which files are there
so it will start with VVRemote1.ini and if thats taken then it will go to VVRemote2.ini
it will then remember the number throughout the runtime of the script

it will periodicly check if the ini file has changed and if so it will set the settings in the script

when the sscript finishes it will delete the ini file

now the extension will search through and keep count of how many ini files there are and what numbers they are (so if you had 1..5 and you stopped 3 it would return 1, 2, 4, 5)

if there are more than one ini file for the script it will open up a seperate form to ask you which instance you want to edit

if there is only one then it will open the form straight away

and if no ini file are found then the script must not be ruinning

i hope you understand that

~shut

Coh3n

2011-08-12 19:53:36

Oh nice, may have to steal some of that code for MSI. :stirthepot:

Smarter Child

2011-08-13 07:26:17

Nice, I might do this for myself if I get the time..

litoris

2011-08-13 07:30:26

Awesome, looks way better than Declareplayers

Coh3n

2011-08-13 10:49:56

Why not make an SRL Player Remote? :rolleyes:

Wouldn't be much different than what you have now.

Shuttleu

2011-08-13 12:13:35

From: Coh3n
Why not make an SRL Player Remote? :rolleyes:

Wouldn't be much different than what you have now.


hmmm, good idea

i shall adapt it to work with srl, only one thing we will need a var in srl to put the name of the script so the user knows which script they are changing the vars for

~shut

Coh3n

2011-08-13 12:49:56

From: Shuttleu
hmmm, good idea

i shall adapt it to work with srl, only one thing we will need a var in srl to put the name of the script so the user knows which script they are changing the vars for

~shut
Something like remote_SetName or something. Maybe not be a bad idea to warn the scripter if no name has been set.

BraK

2011-08-13 13:03:38

We had a player remote before but I don't think it used forms. It was pretty handy and probably needs to be redone. Looks real nice Shut. INI's are pretty handy files to have around. :)

~BraK

Shuttleu

2011-08-13 13:33:57

hmmm… just found a problem which i never noticed yesterday

and the retarded thing is there is no reason for the error, literally there is no reason

~shut

EDIT:
its this

ThePlayers.Strings[j]:= ReadINI(IntToStr(i), 'String'+IntToStr(j), INIPath);

now upon the first run of the form there are no errors
there are also no errors after adding players or changing vars

but if you delete a player it fails

now back to the line
ThePlayers.Booleans[j]:= StrToBool(ReadINI(IntToStr(i), 'Boolean'+IntToStr(j), INIPath));

both i and j are both 0 and through debugging ThePlayers.Strings has a length of 1

but for some reason it comes up with a access violation error

if i change it to
ThePlayers.Strings[j]:= 'String';
it still has the error

and it fails before setting the var while i and j are both still 0

but
ThePlayers.Strings:= ['String'];
does not

Carlito

2011-08-13 14:23:29

Wow shuttleu looks great, cant wait to use it!

Coh3n

2011-08-13 14:33:50

From: Shuttleu
hmmm… just found a problem which i never noticed yesterday

and the retarded thing is there is no reason for the error, literally there is no reason

~shut

EDIT:
its this

ThePlayers.Strings[j]:= ReadINI(IntToStr(i), 'String'+IntToStr(j), INIPath);

now upon the first run of the form there are no errors
there are also no errors after adding players or changing vars

but if you delete a player it fails

now back to the line
ThePlayers.Booleans[j]:= StrToBool(ReadINI(IntToStr(i), 'Boolean'+IntToStr(j), INIPath));

both i and j are both 0 and through debugging ThePlayers.Strings has a length of 1

but for some reason it comes up with a access violation error

if i change it to
ThePlayers.Strings[j]:= 'String';
it still has the error

and it fails before setting the var while i and j are both still 0

but
ThePlayers.Strings:= ['String'];
does not
Name the file extension .txt rather than .ini. We had the same issue with MSI and I couldn't figure out why. Using .txt fixed the issue.

E: Also, if you make an SRL Player Remote, the same code could probably be used for an SRL Player Form.

Shuttleu

2011-08-13 14:46:23

nope, .txt didnt fix it

~shut

Coh3n

2011-08-13 14:49:36

From: Shuttleu
but
ThePlayers.Strings:= ['String'];
does not
Doesn't give the error? If ThePlayers is a TUser type, .Strings is an array, so that would make sense, no?

Shuttleu

2011-08-13 14:52:34

From: Coh3n
Doesn't give the error? If ThePlayers is a TUser type, .Strings is an array, so that would make sense, no?


ThePlayers is my own Type

.Strings is a "array of string"

but what i mean is

ThePlayers.Strings:= ['String'];
does not give a error

but

ThePlayers.Strings[0]:= 'String';

does

for some reason it wont let me access ThePlayers.Strings via the array index

Coh3n

2011-08-13 14:56:32

From: Shuttleu
ThePlayers is my own Type

.Strings is a "array of string"

but what i mean is

ThePlayers.Strings:= ['String'];
does not give a error

but

ThePlayers.Strings[0]:= 'String';

does

for some reason it wont let me access ThePlayers.Strings via the array index
It doesn't really make sense that it wouldn't let you access the array. I've never heard of that before, so I'm thinking it has something to do with the file reading. Try using the array in a similar situation, except without using file functions, see if you still get the error.

Also, I'm assuming you're setting the length of the array before trying to access it (yeah, I know it should give out of range in that situation).

Shuttleu

2011-08-13 14:58:22

From: Coh3n
It doesn't really make sense that it wouldn't let you access the array. I've never heard of that before, so I'm thinking it has something to do with the file reading. Try using the array in a similar situation, except without using file functions, see if you still get the error.

Also, I'm assuming you're setting the length of the array before trying to access it (yeah, I know it should give out of range in that situation).


i already use the strings array elsewhere by its index and it gives a error there too

i have set the length and i have checked the length and it is set to 1 (ie. [0])

~shut

EDIT: Fixed it
i made one of the global vars a local var

TomTuff

2011-08-13 15:26:08

You must run NumberOfPlayers(HowManyPlayers), this sets the lengths of TUser.Strings, TUser.Integers, TUser.Booleans, etc.

If you're using your own array and not the default Players array, then you'll need to set the length as well.

Shuttleu

2011-08-13 16:42:26

From: TomTuff
You must run NumberOfPlayers(HowManyPlayers), this sets the lengths of TUser.Strings, TUser.Integers, TUser.Booleans, etc.

If you're using your own array and not the default Players array, then you'll need to set the length as well.


i know, and i have already fixed the problem

and i have completely finished the SRL Player Remote

~shut

Yago

2011-08-15 14:53:48

Good job

Shuttleu

2011-08-15 14:55:12

From: Yago
Good job


would you mind testing the srl player remote? http://villavu.com/forum/showthread.php?t=66074

~shut

Yago

2011-08-15 15:05:33

From: Shuttleu
would you mind testing the srl player remote? http://villavu.com/forum/showthread.php?t=66074

~shut


Ill try testing this soon, say in a script if the player doesn't have the remote then would there be an error or something?

Shuttleu

2011-08-15 15:29:56

From: Yago
Ill try testing this soon, say in a script if the player doesn't have the remote then would there be an error or something?


if they dont have the remote.simba include then yes, if you mean the extension then no

~shut