Author Topic: [Suggestion] Extending GetPlayerStat, and some more.  (Read 2549 times)

0 Members and 1 Guest are viewing this topic.

Offline Flippeh

  • Major
  • *
  • Posts: 58
  • Fish go moo :>
    • My Homepage
[Suggestion] Extending GetPlayerStat, and some more.
« on: November 27, 2007, 10:18:31 am »
So, i would like to see a new value for GetPlayerStat, being State

Returns...
1 if player is moving
2 if player is standing
3 if player is crouching and not moving
4 if player is crouching AND moving (the 1 of moving added to the 4 of crouching)
5 if player is lying around
6 if player is lying and moving (again, 1 of moving added to the 5 of prone)

(This looks ugly, but found no better way)

Also some more procedures..

DropWeapon(ID: Byte); - Makes player with ID drop his weapon
CancelVote(); - Cancels the current kick/map vote
AcceptVote(); - Accepts the current kick/map vote, without avaiting the results
StartVoteKick(Target, Caller: ID; Reason: String); - Starts a kick vote against Target, in the name of Caller (If Caller = 255 then the caller's nick is Server)
StartVoteMap(Caller: ID; Map: String); - Starts a map vote for Map, in the name of Caller (Again, if Caller = 255 then its the Server)

And maybe some events?

procedure OnVoteMap(Caller: ID; Map: String); - Fires when someone votes a map, where Caller is the player who votes and Map is the map being voted
procedure OnVoteKick(Target, Caller: ID; Reason: String); - Fires when someone vote-kicks someone. Caller is the voter, Target is the voted one and Reason is the reason for the vote.


I suggested some of that in enesces forums, before, but i this Thread never got attention (or i forgot about it already ;x)

I am pretty sure that not everything can be implemented, but i would sure like the vote events and procedures in.
« Last Edit: November 27, 2007, 10:20:21 am by Flippeh »

Offline BombSki

  • Flagrunner
  • ****
  • Posts: 927
    • Climbing-soldiers.net
Re: [Suggestion] Extending GetPlayerStat, and some more.
« Reply #1 on: November 27, 2007, 11:55:33 am »
agreed. vote procedures are needed.
custom votes would even be cooler, something like
StartVote
OnVoteEnd

you can already start a mapvote with "/votemap for admin console" script.

Offline Flippeh

  • Major
  • *
  • Posts: 58
  • Fish go moo :>
    • My Homepage
Re: [Suggestion] Extending GetPlayerStat, and some more.
« Reply #2 on: November 27, 2007, 01:19:46 pm »
Oh, i just noticed there are already StartVoteMap and StartVoteKick ;o
Now only CancelVote and AcceptVote, aswell as the events, and i am happy :>

Nice to see agreements :)

Custom votes are a really nice idea, too.
I'd define them as

procedure StartVote(Poll: String; Caller, VoteID: Byte);
procedure OnVoteEnd(VoteID, YesNum, NoNum: Byte);
« Last Edit: November 27, 2007, 01:23:37 pm by Flippeh »

Offline BombSki

  • Flagrunner
  • ****
  • Posts: 927
    • Climbing-soldiers.net
Re: [Suggestion] Extending GetPlayerStat, and some more.
« Reply #3 on: November 27, 2007, 01:46:08 pm »
if those are gonna be added you should be able to edit 'yes' and 'no' into something else (eg vote for respawntime 3 or 4)

Offline spkka

  • Camper
  • ***
  • Posts: 469
Re: [Suggestion] Extending GetPlayerStat, and some more.
« Reply #4 on: November 27, 2007, 04:12:15 pm »
DropWeapon(ID: Byte); - Makes player with ID drop his weapon
can be done by scripting imo.

Two other suggestions:
- procedure SetWaypointStat(ID: byte; X, Y: single);
- procedure SetTeamDeaths(Team: byte; Deaths: integer);

^^

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: [Suggestion] Extending GetPlayerStat, and some more.
« Reply #5 on: November 27, 2007, 05:01:35 pm »
- procedure SetWaypointStat(ID: byte; X, Y: single);
Probably something more like:
GetWaypointStat(ID: byte; Stat: string): variant;
SetWaypointStat(ID: byte; Stat: string; Value: variant);
Stats being:
X, Y: single;
Constraint: array of byte; (for determining which waypoints this waypoint is connected to)
Up, Down, Left, Right, Jet: array of boolean; (each connection gets boolean directions)
Wait: array of byte; (you can set a certain wait time in maps..)
Style: byte; (either path 1 or 2)

Offline Flippeh

  • Major
  • *
  • Posts: 58
  • Fish go moo :>
    • My Homepage
Re: [Suggestion] Extending GetPlayerStat, and some more.
« Reply #6 on: November 27, 2007, 06:09:07 pm »
Oh, i have another idea:

CreateExplosion(X, Y, Owner: Byte; Radius, Damage: Integer);

Creates an explosion at the given coordinates with the given strenght and radius. Kills made by the explosion will be given to the owner

I tried hard to create an explosion, but its impossible. I can't create an explosion on myself with CreateBullet (m79 bullet either drops right through me, or explodes way under me). Also CreateBullet can not explode in the air :/

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: [Suggestion] Extending GetPlayerStat, and some more.
« Reply #7 on: November 27, 2007, 09:06:18 pm »
this is practically turning into another scripting engine suggestions thread! yay!

function TransferFile(ID: Byte; FileName, SaveName: string; OnExcept: integer):integer;

(forces ID to download FileName (FileName and SaveName MUST HAVE EXTENTION!!!), saves file as SaveName, and if there is an unhandled exception, does choice for OnExcept, Returns download state)
(if ID = 0 then all players download file)

OnExcept values:
0: cancel transfer
1: add number at end of SaveName (before extention)
2: I dunno...

results:
unknown exception: 0
transfer sucessful: 1
already exists: 2
connection broken: 3

stuff that would be cool:
procedure UseFile(FileName: string);
procedure PlaySound(FileName: string);
procedure CreateSpark(FileName: string);
procedure SetPlayerStat(ID: byte; Stat: string; NewValue: variant);


(create spark and play sound would most likely have more params)

another idea:

procedure WriteClientFile(ID: byte; FileName, WriteString: string);
function ReadClientFile(ID: byte; FileName: string):string;

(just like WriteFile() and ReadFile() except with ID's file)
(if ID = 0 then does to all players)

function ExecString(Code: string):variant;

(executes a string in soldatserver (IE: if variable 'woot' = 'KickPlayer(1)' then server will kick player 1))
(if Code has a result, the Result will be what the code returns)

function SetVar(VarName: string; NewValue: variant):string;
(Sets variable and returns variable type ('string' 'integer' 'boolean' etc)
(NEWVALUE MUST BE SAME VAR TYPE)

also: maybe change CreateBullet() into a function, and return a bullet ID for a:
procedure KillBullet(ID: byte);
(kills a bullet, good for, eerm.. getting rid of those dangerous projectiles wizzin past yer head)
(ID = 0 for all bullets)

function GetBulletStat(ID: byte; Stat: string):variant;
(gets a bullet's stat, good for finding bullets in mid-flight and adding more :) )

procedure SetBulletStat(ID: byte; Stat: string; NewValue: variant);
(sets a bullet's stat, good for changing those pellets shot from your spas into m79 nades :) )
(ID = 0 for all bullets)

function GetBulletCount(ID: byte):integer;
(gets total bullet Count made by ID (0 = all players, 255 = server(made using CreateBullet)))

procedure SetBulletCount(ID: byte; NewValue: integer);
(sets total bullet count of ID (0 = all players, 255 = server) (almost completely useless))

procedure ResetBulletCount(ID: byte);
(resets total bullet count made by ID (0 = all players, 255 = server)

(and maybe add a:
function OnNewBullet(Shooter, BID: byte; Amount: integer):boolean;
where if you returned true you would kill the new bullet(s)
(I think this would only be called every tick or something, to prevent server l     a          g

Date Posted: November 27, 2007, 08:48:28 pm
So, i would like to see a new value for GetPlayerStat, being State

Returns...
1 if player is moving
2 if player is standing
3 if player is crouching and not moving
4 if player is crouching AND moving (the 1 of moving added to the 4 of crouching)
5 if player is lying around
6 if player is lying and moving (again, 1 of moving added to the 5 of prone)

7 if player is jetting
8 if player is jetting and moving (yet again, 1 of moving added to the 7 of jet)


finally I get all of my ideas out there! anyone like them?
« Last Edit: November 27, 2007, 09:22:24 pm by Kavukamari »
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."


Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: [Suggestion] Extending GetPlayerStat, and some more.
« Reply #9 on: November 27, 2007, 10:11:20 pm »
I know T.T

btw: is there ANYTHING possible about any of my suggestions?

(I'm hoping for the write/read client file's and execstring and setvar)
« Last Edit: November 27, 2007, 10:13:05 pm by Kavukamari »
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline BombSki

  • Flagrunner
  • ****
  • Posts: 927
    • Climbing-soldiers.net
Re: [Suggestion] Extending GetPlayerStat, and some more.
« Reply #10 on: November 28, 2007, 01:37:51 am »
lol. the scriptcore suggestion threads was closed. gtf out of here with anything thats offtopic (that means, anything that is not related to something that was posted in the first post)
custom votes ftw.

Offline Flippeh

  • Major
  • *
  • Posts: 58
  • Fish go moo :>
    • My Homepage
Re: [Suggestion] Extending GetPlayerStat, and some more.
« Reply #11 on: November 28, 2007, 01:34:06 pm »
(I'm hoping for the write/read client file's and execstring and setvar)

Would be a security risk. Server could like inject code in the soldat.exe, change players profiles, reset keys, ...

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: [Suggestion] Extending GetPlayerStat, and some more.
« Reply #12 on: November 29, 2007, 09:08:54 am »
btw: is there ANYTHING possible about any of my suggestions?

(I'm hoping for the write/read client file's and execstring and setvar)
Most of them are possible, such as sounds (I am already experimenting with it), CreateSpark can be done but in the client sparks are identified by ID's not filenames, and ID's change, so there is no way for the server/script to know which ID is currently assigned to the client's spark (eg: one second smoke puff is ID 23, then its 11 etc).
Set*Stat etc wont work because updating them server-side does not affect them client-side, causing desynchronization.
ExecString is not possible with the engine.
WriteFile/ReadFile on client is possible, but opens a few security/sanity problems. I may consider adding the possibility to write/read to an INI file within the /downloads/ folder in the Soldat client; with size/content limits.
SetVar is pointless.

Thats about it.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: [Suggestion] Extending GetPlayerStat, and some more.
« Reply #13 on: November 29, 2007, 10:32:12 am »
SetVar is not pointless as it allows way faster debugging and testing of scripts. Would allow coding ingame commands such as "/setvar insertglobalvariablenamehere value" to test a certain function of a script under very varying conditions, without having to change the whole script for the testing.
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: [Suggestion] Extending GetPlayerStat, and some more.
« Reply #14 on: November 29, 2007, 12:46:15 pm »
WriteFile/ReadFile on client is possible, but opens a few security/sanity problems. I may consider adding the possibility to write/read to an INI file within the /downloads/ folder in the Soldat client; with size/content limits.

maybe make it so script makers cannot edit .ini's unless they make them themselves (not default .ini's)

btw, is the TransferFile() possible?

(maybe playsound could be like this:
procedure PlaySound(FileName: string; Volume: integer; Radius: single);
where volume is how loud it is (from 1 to 100) and radius is how far the sound travels (where 1.0 is one screen and 0.5 is half a screen and 2.0 is two screens))
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: [Suggestion] Extending GetPlayerStat, and some more.
« Reply #15 on: December 05, 2007, 11:47:26 pm »
Thats like ambient sounds, new dimension to maps:

You could have the sound of a car idling, machinery clanking, forest sounds and other cool stuff :P
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline BombSki

  • Flagrunner
  • ****
  • Posts: 927
    • Climbing-soldiers.net
Re: [Suggestion] Extending GetPlayerStat, and some more.
« Reply #16 on: December 06, 2007, 02:10:37 am »
yea... who wouldnt want that......

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: [Suggestion] Extending GetPlayerStat, and some more.
« Reply #17 on: December 06, 2007, 12:37:49 pm »
a little change to PlaySound:

function PlaySound(FileName: string; Delay: integer; Volume: integer; Radius: single):integer;
added delay, so sounds don't overlap (but if delay=0 then sound doesn't end) (and crossed out volume)

procedure StopSound(SID: integer);
ends sound (SID is the number the PlaySound function returns)

procedure PauseSound(SID: integer);
pause the sound at current point

procedure ContSound(SID: integer);
continues a paused sound (ignores if sound was already playing

procedure RestartSound(SID: integer);
restarts SID from beginning

procedure JumpSound(SID: integer; Time: integer);
skips an already playing sound to Time (like if you wanted to play the file from 60 seconds)

function GetSoundStat(SID: integer; Stat: string);
stats:
Length: how long sound is (effected by Delay)
LengthM: length in millisec's
Time: Current time out of length the sound is currently at
X,Y: gets x or y
Radius: radius :P
Name: name of file sound is playing from

(damn, I'm getting out of control with ideas again O.o sorry)
« Last Edit: December 06, 2007, 12:41:25 pm by Kavukamari »
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."