SRL Archive - SRL Suggestions

Add 'Status' to TUser record?


EvilChicken!

2010-07-27 20:56:54

(Title says all.)

I'm actually baffled there doesn't exists such an element in the TUser record already, the closest thing I can get is the .Loc string. But, it makes so much more sense to have a 'Status' string in addition to the .Loc string and use both the mentioned string separately instead of having to make the location string store all the data, like I've seen many (if not most) people do.

Simply put, "Players[X].Status" suits a lot of different occasions where "Players[X].Loc" either simply may be inappropriate or inadequate to use; the .Loc variable might even already be in use.

Just wondering, would this be a useful add?

I feel it's slightly pointless to make an entire thread about such a small change, but I don't want to spam SRL with useless things. And besides, while I'm at it, I might as well do some shameless self-promotion: check out this, it's a sort of screenshot & debugging-combined thingy.

Heavenguard

2010-07-27 21:16:48

I vote yes, it actually makes a lot of sense as it is. The fact that players actually use Location to do this is proof enough to why it should be added :P

Wanted

2010-07-27 21:51:41

Yea as long as it's not being assigned within the SRL include to anything like .Loc is, that itself is what normally screws it up. For my abyss script it checks .Loc alot, and I'm sure sooner or later some random is going to solve successfully, change the loc or some shit, the have my script not know what is going on.

EvilChicken!

2010-07-27 22:35:24

From: IceFire908
Yea as long as it's not being assigned within the SRL include to anything like .Loc is, that itself is what normally screws it up. For my abyss script it checks .Loc alot, and I'm sure sooner or later some random is going to solve successfully, change the loc or some shit, the have my script not know what is going on.


I doubt Players[].Status will be assigned anywhere inside SRL, if that's what you meant.

Heavenguard

2010-07-28 00:00:59

From: EvilChicken!
I doubt Players[].Status will be assigned anywhere inside SRL, if that's what you meant.


Rather, it just be there so scripters actually have a decent status variable for there players ;) Up to them to use it or not.

Wanted

2010-07-28 00:03:12

Well we do have .strings which is already unlimited, so this doesn't really open any new possibilities, it only makes the script look neater I guess.

Daniel

2010-07-28 04:23:07

From: IceFire908
Well we do have .strings which is already unlimited,


It's unlimited? Really?!

Last time I checked it has a length of 100…

Wanted

2010-07-28 12:17:01

[QUOTE=Dan's The Man;727189]It's unlimited? Really?!

Last time I checked it has a length of 100…

Strings: array of string; 

Players.scar, just don't use NumberOfPlayers(); use your own array lengths.

Daniel

2010-07-29 07:13:16

From: IceFire908
Strings: array of string; 

Players.scar, just don't use NumberOfPlayers(); use your own array lengths.

That doesn't mean it's unlimited. ;)

Also:
[php]
procedure NumberOfPlayers(Number: Integer);
var
I: Integer;
begin
SetLength(Players, Number);
HowManyPlayers := Number;
for I := 0 to HowManyPlayers - 1 do
begin
SetLength(Players.Strings, 100);
SetLength(Players.Integers, 100);
SetLength(Players.Booleans, 100);
SetLength(Players.Extendeds, 100);
SetLength(Players.Arrays, 100);
end;
end;
[/php]

^

EDIT:
From: IceFire908
just don't use NumberOfPlayers(); use your own array lengths.

lol. Are you sure you can directly edit the index's of an array without specifying its length? :p

EvilChicken!

2010-07-29 10:57:45

I added it, by the way.

[QUOTE=Dan's The Man;727375]That doesn't mean it's unlimited. ;)

Also:
[php]
procedure NumberOfPlayers(Number: Integer);
var
I: Integer;
begin
…
end;
[/php]

^

EDIT:

lol. Are you sure you can directly edit the index's of an array without specifying its length? :p

I'm sure he means that you should make your own version of NumberOfPlayers(); where you set your own desired array lengths, rather than calling the one in SRL.

Wanted

2010-07-29 14:01:26

[QUOTE=Dan's The Man;727375]That doesn't mean it's unlimited. ;)

Also:
[php]
procedure NumberOfPlayers(Number: Integer);
var
I: Integer;
begin
SetLength(Players, Number);
HowManyPlayers := Number;
for I := 0 to HowManyPlayers - 1 do
begin
SetLength(Players.Strings, 100);
SetLength(Players.Integers, 100);
SetLength(Players.Booleans, 100);
SetLength(Players.Extendeds, 100);
SetLength(Players.Arrays, 100);
end;
end;
[/php]

^

EDIT:

lol. Are you sure you can directly edit the index's of an array without specifying its length? :p

What? xD it's as unlimited as your memory on your computer is, if you room for another string you'd have room for another array index instead. I'm not sure what you're saying with the lengths, thats why you set your own and not use NumberOfPlayers in SRL xD