Official Soldat Forums

Server Talk => Scripting Discussions and Help => Topic started by: EnEsCe on April 27, 2008, 01:20:40 am

Title: Script Core Suggestions
Post by: EnEsCe on April 27, 2008, 01:20:40 am
If anyone has decent ideas for the next release of the Soldat Server Script Core, now is the time to voice them. I feel that the Script Core needs abit of love.
So please, post any suggestions you have. Make sure you explain every aspect of your idea, and examples will increase the chances of your idea being added. Any dumb or unnecessary ideas will be ignored.

ONLY REPLY TO THIS THREAD WITH AN IDEA ~ NOT A COMMENT REGARDING SOMEONE ELSE'S IDEA!
Title: Re: Script Core 2.6.4 Suggestions
Post by: Toumaz on April 27, 2008, 02:19:43 am
OnRoundStart and OnRoundEnd: think the names explain it, but two procedures that would be called upon round start and round end in survival mode. This would make scripting related to survival mode a lot easier, without having to mess around with timer variables.
Title: Re: Script Core 2.6.4 Suggestions
Post by: jrgp on April 27, 2008, 02:43:57 am
Ability to control the screen's darkness at any given time so you can have it get dark, stay dark for x amount of time, then return to the normal level of brightness again. Might be useful for certain kinds of maps and custom gamemodes.
Title: Re: Script Core 2.6.4 Suggestions
Post by: Avarax on April 27, 2008, 03:20:05 am
Make /gmuted players still call the OnPlayerSpeak event.

Adjustable volume for playing the WAV files

Unlock the blocked bullettypes for CreateBullet
Title: Re: Script Core 2.6.4 Suggestions
Post by: shantec on April 27, 2008, 09:32:27 am
Here's my idea: you would be able to use Objects in CreateBullet... like a Nova of berserker bonuses xD
(Okay that's stupid... it probably will be ignored :D )

Another: you would be able to blow up grenade at any second, or raise the "fuse time" (err... grenade that blows up when someone hits it o.O)


Dun worry, that wasn't all =)
Title: Re: Script Core 2.6.4 Suggestions
Post by: BombSki on April 27, 2008, 10:05:59 am
There were some nice suggestions in this thread:
http://forums.soldat.pl/index.php?topic=19565.0
Title: Re: Script Core 2.6.4 Suggestions
Post by: JFK on April 27, 2008, 10:39:48 am
Make /gmuted players still call the OnPlayerSpeak event.
Plus a way to find out that a player is gmuted, like GetPlayerStat(ID, 'Gmuted')

And i'm just gonna try this:
- Variant Type supporting booleans (see the end of my huge double post (http://forums.soldat.pl/index.php?topic=26540.0))
- Pointers :D... plz?
- Any way to get the X-Y coordinates (in a map) of a players cursor

Also: great new features already. I do hope the wav-files can be stereo and are allowed to be quite big :)
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on April 27, 2008, 11:54:57 am
I'll throw everything that comes out there:

Assignment of player's bullets to IDs as CreateBullet does -- (using GetObjectStat, SetObjectStat them)

procedure OnBulletCreation(Id, Owner: byte);
function OnBulletDestruction(Id, Owner: byte): boolean; (results if bullet will be destroyed or not)
(awful names for events, but can be changed to whatever sounds better)
Called when a bullet is created or destroyed.

SetObjectStat or GetObjectStat addons
Style: byte;
Active: boolean;
X: single;
Y: single;
Owner: byte;
VelX: single;
VelY: single;
HitM: single;
sStype: byte;

Having Ticks: cardinal by default on AppOnIdle, not integer (like GetTickCount(): cardinal i think)

KillObject(CreateBulletID); I thought this worked, but it didn't when I tested it....
Title: Re: Script Core 2.6.4 Suggestions
Post by: mar77a on April 27, 2008, 12:31:13 pm
ChangePlayerNick(ID: byte; New_Nickname: String) ;

EDIT: Toumaz -really- likes climbing walls of dicks
Title: Re: Script Core 2.6.4 Suggestions
Post by: danmer on April 27, 2008, 12:45:26 pm
add 'JoinPort' stat to the GetPlayerStat function plz

(obviously for ForwardClient , as now it's only possible on linux systems)
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on April 28, 2008, 02:33:10 pm
GetPlayerStat(Id: byte; 'shirt'): longint; or 'main' (i dont know if it will be "red" if a player joins alpha, or if it will be the actual player's chosen color; whichever is the actual value that the server stores it as will be for the best probably)
GetPlayerStat(Id: byte; 'pants'): longint;
GetPlayerStat(Id: byte; 'skin'): longint;
GetPlayerStat(Id: byte; 'hair'): longint;
GetPlayerStat(Id: byte; 'jet'): longint; ('jets' is different than 'jet', or u could do 'jetcolor' or something like that, and for consistency, mayb add 'color' at the end for all other color-getting stat value as well; or "colour" :P)
returning colors of the specified thingy
GetPlayerStat(Id: byte; 'hairstyle'): byte;
GetPlayerStat(Id: byte; 'headstyle'): byte;
GetPlayerStat(Id: byte; 'chainstyle'): byte;

It really shouldn't be considered what they will be used for, but rather is it possible, and ease if implementing it.
Title: Re: Script Core 2.6.4 Suggestions
Post by: Serial K!ller on April 28, 2008, 03:54:32 pm
Title: Re: Script Core 2.6.4 Suggestions
Post by: chutem on April 28, 2008, 07:28:27 pm
How about something you can put in a script like WaitUntil(AppOnIdle) that you can put in scripts and it pauses (not sleeps!)  the function where it is until the stated function is called.

And i'm not sure if you can or can't draw multiple DrawText's, because somewhere i read that kill messages overdraw other messages, but if you can't a suggestion would be that you can draw multiple DrawText's

Oh yeah, a procedure that clears text would be cool aswell.

And how Serial k!ller said you should make a putmapgrafix(x,y,alpha,...) which puts a graphic on the map, you should be able to draw text to a place on the map, (but keep the one that draws on screen of course).

And BTW all of the suggestions above this post so far are great :P

I think thats all for now ;)

Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on April 29, 2008, 02:38:09 pm
ForceAction(Action: byte);
case Action of
0: stop moving
1: move left
2: move right
3: jump
4: crouch
5: uncrouch
5: prone
6: unprone/stand
7: fire bullet
8: switch weapons
9: throw grenade

would require client changes afaik though
Title: Re: Script Core 2.6.4 Suggestions
Post by: chutem on May 01, 2008, 09:30:36 pm
Suggestion 5:
I think OnWeaponChange should be called when player reloads their weapon, and every weapon should have an ID so it would be like this OnWeaponChange(ID, PrimaryNum, SecondaryNum,PrimaryID, SecondaryID, Action: Byte), and the action would be what called the event e.g:

1 : Switches weapon (presses 'Q')
2 : Drops weapon
3 : Picks up weapon
4 : Picks weapon from respawn menu
5 : Reloads weapon
and any other thing you feel needs adding

And could you please put the contents of www.enesce.com/help/ into a single downloadable folder please?, it is a pain for me (and probably a few others) to get information, as I have dial-up and am not always connected to the internet, in fact I am almost never on the internet when writing scripts.

Suggestion 6:
Not relly a scriptig suggestion, but a suggestion nonetheless, when you release the new scriptcore you will make a list of new functions/events/changes, how about making a list of things that have been suggested here but didn't get done, a short sentence of why it wasn't done aswell, i.e, can't be done, stupid idea.
Title: Re: Script Core 2.6.4 Suggestions
Post by: shantec on May 02, 2008, 01:49:45 am
Some sort of idea:

ForceSpeak (or somekind... something...)
You would be able to force some player to speak anything :D
ForceSpeak(ID, text)   maybe :D
Title: Re: Script Core 2.6.4 Suggestions
Post by: danmer on May 02, 2008, 05:17:13 am
also, is it possible to make OnWeaponChange() call even if the player's weapons are identical?
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on May 02, 2008, 03:17:54 pm
GetPlayerStat(Id: byte; 'TTime'): cardinal;
Returns the amount of time (in ticks) that a player has been in-game for
Ignore the fact that you can already get this number with a little scripting ^^ would make it slightly more ez to do some things
Title: Re: Script Core 2.6.4 Suggestions
Post by: Serial K!ller on May 03, 2008, 05:27:33 am
event for double kill, multi kill, masta kill etc
f.e.

onkillbonus(ID,kills,...)
 if kills = 2 then
   playsound("Doublekill.wav",...)

...



Title: Re: Script Core 2.6.4 Suggestions
Post by: Noober on May 03, 2008, 04:30:49 pm
Ability to download sounds from a server.
And be able to play them when a player gets double kill or triple..etc
Title: Re: Script Core 2.6.4 Suggestions
Post by: amb2010 on May 03, 2008, 05:00:46 pm
Maybe a DrawToMap command that would be basically draw text but you can set it to do it to a part of the map(objective based map like thing :D) Would stay there until removed.
Title: Re: Script Core 2.6.4 Suggestions
Post by: JFK on May 03, 2008, 06:53:26 pm
OnVoteKick(ID: byte, Reason: string) would be a nice event to be called if someone does a vote-kick. Or any other way to at least get the reason why someone should be kicked.
Also a way to nullify a kick-vote, so you can decide what reasons for kick-voting are valid.
Maybe like this:
Code: [Select]
Function OnVoteKick(ID: byte, Reason: string):boolean;
begin
  result := true //let the vote go through
  result := false //nullify the vote, player will not be kicked even if enough players press f12
end;
Title: Re: Script Core 2.6.4 Suggestions
Post by: Neosano on May 04, 2008, 08:08:21 am
GetObjectStat: VelX,VelY
SetPlayerVel(ID: byte;VelX, VelY: single)
CancelBonus(ID,Bonus:byte) //can cancel predator, berserker from player
OnPlayerBonusPickUp(ID,BonusID: byte) //or something like that
OnPlayerAmmoChange //if its possible...
OnPlayerChangeStat // for example when GetPlayerStat(ID,'ground') activates
CancelVote

MoveObject(ID: byte; X,Y:single)
MoveFlag(FlagTeam: byte; X,Y:single)
mouse coordinates would be good too...

Add to SpawnObject VelX and VelY

Title: Re: Script Core 2.6.4 Suggestions
Post by: shantec on May 04, 2008, 02:17:10 pm
You could be able to control which player bot is attacking (Normally nearest player?)
It would be useful ? for making "different" bots.
Title: Re: Script Core 2.6.4 Suggestions
Post by: chutem on May 06, 2008, 11:05:49 pm
It would be super funky cool if you were able to script the bots AI, you would need commands and events specific to the scrip for bots though, so you can control how they react when the see enemies, hit waypoints, control their aim and reloading etc, etc.

This would lead to HUGE improvements in how good the bots are (but say, in the bot skill you could choose easy, normal, hard and scripted (only works if script present)) and you have a seperat .PAS file for each 'action' like aiming and reacting to spotting players.

EDIT: probably not gonna be in the script v2.6.4, but something definitely worth thinking about.
Title: Re: Script Core 2.6.4 Suggestions
Post by: sai`ke on May 07, 2008, 04:17:47 am
Being able to set jetpack fuel level/maximum on a per player basis.
Title: Re: Script Core 2.6.4 Suggestions
Post by: EnEsCe on May 07, 2008, 07:26:56 am
Keep em' coming guys. Quite afew aren't possible due to sync issues (like the one above this post)

Ill post a larger reply about suggestions when I get time
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on May 08, 2008, 02:58:14 pm
A pre-processor type of thing...
I'm not sure how pascal preprocessor is supost2 be like, but something like...
{$VAR := true}
var
  MapStart: cardinal;
  Players: array[1..32] of record
    Deaths: byte;
    {$IF VAR}
    JoinTime: cardinal;
    {$ENDIF}
  end;

OnJoinGame...
begin
  {$IF VAR}
  Players[Id].JoinTime := GetTickCount();
  {$ENDIF}
end;

to slightly make scripting more efficient when it comes to memory and options in a script
Title: Re: Script Core 2.6.4 Suggestions
Post by: NTxC on May 14, 2008, 06:54:31 am
GetMousePosX(ID: integer);
GetMousePosY(ID: integer);

would be great.  ;)
Title: Re: Script Core 2.6.4 Suggestions
Post by: sai`ke on May 14, 2008, 08:19:52 am
Oh okay, no biggie :).

Here's just a minor gripe, but it would be very convenient if it'd be 'fixed'. When you have multiple included script files and have an error somewhere, the scriptcore engine gives you a line number that's cumulative. It would be nicer to have the line number of the specific file the error is in so you don't have to subtract the length of the other files manually each time.
Title: Re: Script Core 2.6.4 Suggestions
Post by: xmRipper on May 18, 2008, 06:37:20 am
CreateSpark(x,y,velx,vely,style,color,etc...);
Title: Re: Script Core 2.6.4 Suggestions
Post by: sai`ke on May 18, 2008, 07:36:15 am
procedure onBonusPickup( Type: Byte? );
Title: Re: Script Core 2.6.4 Suggestions
Post by: TheToast on May 18, 2008, 09:46:50 am
I second JFKs OnVoteKick, or at least a possibility to abort a vote (map or kick). Seen it in Trackmania and it'svery usefull.

Like abort every MapChangeVote when there are only less then 5 kills to do or only 10% Time left or if the map just played.
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on May 18, 2008, 05:46:55 pm
Ability to get few player modded materials (for example, /Txt/font.ini > FontConsoleSize= would be nice to have in order to determine if the console's text will verticall align if linebreaks are used in messages in the console (9 = aligned, i use 7 which doesn't, would be nice to know when making cool-looking multi-line stuff in the console)

Scripting/server option of setting few moded things, such as Txt/font.ini (temporarily while in server)
Title: Re: Script Core 2.6.4 Suggestions
Post by: Neosano on May 21, 2008, 05:39:47 am
i heard about GIFs... well.. how about
GifPlay(ID:byte);
GifStop(ID:byte);
CreateBlood(X,Y:single); - maybe size and type if possible..

i also heard about your trying to move bot.. but, make it possible to move anyways? doesn't matter he loose his AI or not.. for me it would be useful
ForceSwitch(ID:byte); - forces player to switch weapons (like Q button)

urm, how about.. CreateBulletForPlayer?
DrawLineToMap(X,Y,X2,Y2:single,Color:longint); - draws line sticked to map, if possible - add size
CreateDanmer; - creates sumo on your screen
ControlSwitch(ID:byte,Controllable:boolean); - or something.. the player cannot move and shoot while his control is shut down
Title: Re: Script Core 2.6.4 Suggestions
Post by: UPNPAD on May 21, 2008, 06:48:27 am
Oh I better suggest it here: http://forums.soldat.pl/index.php?topic=11505.0

Add a Weapon variable to OnPlayerDamage (as it is implemented in OnPlayerKill) so it's possible to find out which weapon did the damage.
Title: Re: Script Core 2.6.4 Suggestions
Post by: NTxC on May 25, 2008, 01:01:49 pm
Is it possible to set Soldat's default animations on players? :o

SetAnimation(ID, Animation: byte);

also

LockPlayer(ID: byte; Lock: boolean);

makes player unable to move?
Title: Re: Script Core 2.6.4 Suggestions
Post by: xmRipper on May 25, 2008, 04:12:47 pm
LockPlayer(ID: byte; Lock: boolean);
You can already do that.
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on May 31, 2008, 10:10:54 pm
i'm still really really wanting procedure RespawnPlayer or Respawn(Id: byte);, obviously respawning the player, especially sense setteam doesn't respawn people anymore

Date Posted: May 26, 2008, 06:07:01 pm
Bug: ForwardClient server IP may not be something like "mm.climbing-soldiers.net" for example, says "'mm' is not a valid integer value"
Has been suggested before but... ForwardClientPass(PlayerIP: string; PlayerPort: integer; ServerIP: string; ServerPort: integer; ServerPass: string);

Date Posted: May 31, 2008, 12:34:05 pm
unix time supported in FormatDate or as a separate function

Date Posted: May 31, 2008, 09:38:37 pm
FormatDate containing number of days within the year
Title: Re: Script Core 2.6.4 Suggestions
Post by: Neosano on June 03, 2008, 08:15:20 am
GetPlayerStat(ID,'admin')
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on June 03, 2008, 02:25:50 pm
GetPlayerStat(Id, 'Port'): integer; relating to ForwardClient
Title: Re: Script Core 2.6.4 Suggestions
Post by: NTxC on June 04, 2008, 08:17:34 am
LockPlayer(ID: byte; Lock: boolean);
You can already do that.

How can I? LockPlayer doesn't work. :(

also:

RenamePlayer(ID: byte; Name: string);
Title: Re: Script Core 2.6.4 Suggestions
Post by: sai`ke on June 04, 2008, 09:32:33 am
More descriptive error messages than Invalid Opcode or out of Global Vars range would be nice.

Probably a lot of work since the scripts are probably compiled into bytecode before running, but some more extensive debugging tools would be nice for rare bugs that are hard to reproduce. Like a variable name the bug is associated with.

Perhaps fix some compatibility issues regarding the crazy access violations on many OSes?
Title: Re: Script Core 2.6.4 Suggestions
Post by: xmRipper on June 07, 2008, 01:53:38 pm
- "Script Packages" may be sent to the Client containing some WAV files that the server can then command the client to play. More types of files will be added gradually.

Suggestion:
X, Y coordinates for playing sound. so we can make 3D effect :P
Title: Re: Script Core 2.6.4 Suggestions
Post by: spkka on June 08, 2008, 08:01:52 am
A option to hide messages like (player) joined the game, (player) left the game
Title: Re: Script Core 2.6.4 Suggestions
Post by: xmRipper on June 08, 2008, 08:51:57 am
if it possible, make the OnPlayerSpeak as a function.
and result is Text.
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on June 08, 2008, 08:57:20 am
function OnPlayerSpeak(const Id: byte; var Text: string): boolean;
begin
  Result := false;
  if Text[1] = '!' then begin
    Result := true;
//do stuff
    exit;
  end;
  Text := StrReplace(Text, 'fuck', '!@#$');
end;
Title: Re: Script Core 2.6.4 Suggestions
Post by: Frenchie on June 10, 2008, 01:02:32 am
Don't think anyone posted this...

Ability to draw a box with positioned text.
Eg: DrawBox( TopLeft corner, Bottomright corner, colour)
PosText ( X Pos, Y Pos, String)

This feature would have unlimited possibilites in scripts.
(ctf, inf, htf...) You could have a box above flag caps representing overall team wins
(tw, zombie, race....) You could have a box which lists time before a specific event.. such as in tw an airstrike or backup arrives, zombie.. time till cure arrives, race.. time before slowest player in race gets spectated.. And Much more
(hexer, miraclemod, an rpg thing...) Could list number of spells you have obtained in specific classes
(cs, a script with a money system..) Could list how much money you have/ list weapons you can afford/list weapons you currently have

It is a small feature which would allow scripts to integrate better with soldat itself

Please read this ideaEnesce,
 I just don't know how much work you would have to put into the client though... (But 1.5 is around the corner...)
Title: Re: Script Core 2.6.4 Suggestions
Post by: JFK on June 10, 2008, 06:05:29 am
LockPlayer(ID: byte; Lock: boolean);
You can already do that.

How can I? LockPlayer doesn't work. :(


I know were not supposed to comment each others ideas, but since im not the first one to comment on this: i think that XM means that you can keep a player on its position by using MovePlayer(ID, x, y). However the player will still be able to move, so you'll have to call the procedure as many times as possible per second. If you do this, for example, in mid air, a player will constantly fall and get picked up again and the player doesn't actually 'freeze'.
I think LockPlayer would be a nice function and not hard to implement. Would be nice if it worked for bots also.. and moveplayer for bots..

edit:
now that i think of it, very great that we'll get gravity modifiers, but it would be totally awesome if we will be able to adjust the gravity PER PLAYER. Something like:
Code: [Select]
SetGravity(ID: byte, Gforce: Double); ID to zero for all players, ofc.
GetPlayerStat(ID, 'Gravity'); //would then return a double
then you could pretty much freeze a player in mid air btw...
Title: Re: Script Core 2.6.4 Suggestions
Post by: Rampage_Terranius on June 10, 2008, 10:31:12 am
what i would love to see (although i dont think it is possible) is separate weapons.ini files that can be loaded for different players this combined with leveling scripts etc could bring some very cool server scripts

LoadWeapon(ID: byte; Text: String);
ID is obviously id of player to load the .ini with the weapon stats
String would be what the file is called


so you could use it like
if Players[ID].Level = 1 then LoadWeapon(ID, 'LevelOneWeapons.ini')
if Players[ID].Level = 2 then LoadWeapon(ID, 'LevelTwoWeapons.ini')

so you could have different scripted level weapons
Title: Re: Script Core 2.6.4 Suggestions
Post by: xmRipper on June 11, 2008, 05:40:30 pm
function OnPlayerSpeak(const Id: byte; var Text: string): boolean;
begin
  Result := false;
  if Text[1] = '!' then begin
    Result := true;
//do stuff
    exit;
  end;
  Text := StrReplace(Text, 'feck', '!@#$');
end;

wtf is that ? >_>
Title: Re: Script Core 2.6.4 Suggestions
Post by: Neosano on June 13, 2008, 04:06:07 pm
xmRipper, possibly it's word filter..
NTxC, check out my Freezer in scripting releases

and one more thing... i have real problems with Weapon list menu in my mod.. so..
HideWeaponList(ID:byte); - hides weapon list if it is on player screen.
Title: Re: Script Core 2.6.4 Suggestions
Post by: xmRipper on June 13, 2008, 04:16:57 pm
xmRipper, possibly it's word filter..
Nah. That will not work.
Title: Re: Script Core 2.6.4 Suggestions
Post by: PorN on June 19, 2008, 09:02:17 am
for deathmatch survival,
if anyone type !radar than the server shows where u can find all other living players
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on June 19, 2008, 05:28:35 pm
functions to draw stuff on the radar on a Soldat client (time, or create / destroy (resulting an id))
function DrawBox(X1, Y1, X2, Y2: single; Colour: longint): byte;
function DrawPos(X, Y: single; Colour: longint);
procedure DestroyDraw(Id: byte);
things like that

X, and Ys are on map position

would help server players find scripted locations
If possible, setting alpha so that.. well, heres an image:
left side would help bunches more than right side for the way I have locations setup..
(maybe a depth thing too, so u can draw behind the polys on the radar)
Title: Re: Script Core 2.6.4 Suggestions
Post by: xmRipper on June 19, 2008, 08:32:55 pm
procedure BulletTime(blabla: boolean);

true = turns on bullettime mode.
false = turns off bullettime mode.
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on June 19, 2008, 10:06:27 pm
procedure BulletTime(blabla: boolean);
(or a server command, and then Command('/whatever 1/0')
Title: Re: Script Core 2.6.4 Suggestions
Post by: xmRipper on June 20, 2008, 12:00:17 am
if it possible;
procedure ChangeSkin(ID: byte; Hair, Shirt, Pants: longint);

(i remember, someone was suggest that before)
Title: Re: Script Core 2.6.4 Suggestions
Post by: sai`ke on June 20, 2008, 05:57:06 am
An option to be able to dump all the variables in memory upon access violation.
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on June 20, 2008, 11:47:35 am
Making it so TCPAdminPM doesn't write in the console (maybe as an option for the server); sometiems u goda send weird characters to a bot connected through as an admin that don't look so good when looking at the server through an admin program..
Title: Re: Script Core 2.6.4 Suggestions
Post by: urraka on June 20, 2008, 11:57:01 am
function OnBattlEyeKick(ID: byte; Reason: Text): Boolean;

ID would be the player and Reason the message that battleye gives. And the return value could avoid player from getting kicked.
Title: Re: Script Core 2.6.4 Suggestions
Post by: freestyler on June 21, 2008, 09:00:40 am
As I said before:
GetCursorXY(ID: byte; X, Y: single);
SetCursorXY(ID: byte; X, Y: single);

Forcing the map's GIFs to start/stop would be awesome, but as I remember, you said it's impossible...

DrawTextAbsolute(ID: byte; Text: string; Delay: integer; Color: longint; Scale: single; X,Y: integer)
Same as DrawText, but the text sticks to the map instead of player's screen (someone suggested it already, but it's great idea).

Speaking of DrawText, could you fix it so if text's opacity is less than 100% then it doesn't blink after fading off?
Title: Re: Script Core 2.6.4 Suggestions
Post by: xmRipper on June 21, 2008, 10:11:37 am
and that would be good if drawtext function can use multiple times without previous one disappear.

(hmm. Sorry for bad English. That was hard for me =P )
Title: Re: Script Core 2.6.4 Suggestions
Post by: EnEsCe on June 21, 2008, 11:17:49 am
xmRipper I suggest you read this line again:

ONLY REPLY TO THIS THREAD WITH AN IDEA ~ NOT A COMMENT REGARDING SOMEONE ELSE'S IDEA!

So stop it. (not referring to last post, ones before it)
Title: Re: Script Core 2.6.4 Suggestions
Post by: Mr on June 24, 2008, 09:53:42 am
Downloads a graphik mod from a webserver ... or the gameserver and loads it: LoadMod(Name, DownloadURL: Text);
ExecOnClient(ID: Byte; Command: Text;); ^^
Title: Re: Script Core 2.6.4 Suggestions
Post by: danmer on June 25, 2008, 09:31:56 am
function DirListing(directory: string): TStringArray;

would be nice (returns the list of all files/folders in the given folder)
Title: Re: Script Core 2.6.4 Suggestions
Post by: Serial K!ller on June 29, 2008, 05:36:09 am
putplayericon(ID,"/downloads/medic.png",Teamviewonly=true/false)
can be very usefull for scripts with classes
Title: Re: Script Core 2.6.4 Suggestions
Post by: iDante on June 29, 2008, 07:29:00 pm
isInPoly(X,Y: Integer): boolean;
Returns True if the point is in a polygon.
EDIT: Thanks to a tip from DorkeyDear...
Code: [Select]
function isInPoly(X,Y: single): boolean;
var Dist: single;
begin
   Result := iif(RayCast(X,Y,X,Y,Dist,1), false, true);
end;

GetPolyStat(ID: byte;Stat: string): Variant;
IDK if polygons are given ID's, but if so you could have things like... color of all 3 verticies, poly type, opacity, etc.
Title: Re: Script Core 2.6.4 Suggestions
Post by: shantec on July 01, 2008, 06:49:11 am
putplayericon(ID,"/downloads/medic.png",Teamviewonly=true/false)
can be very usefull for scripts with classes

This is an IDEA regardin' to Serial K!llers idea:
Everyone would have their own player indicators, which would be changeable with PutPlayerIcon(...)

E.
PlayerChat(ID: byte; Text: string);
Same as BotChat, but would work with players.
Title: Re: Script Core 2.6.4 Suggestions
Post by: CurryWurst on July 07, 2008, 05:54:01 am
- Ability to use pointers - I think that would be a really great script core improvement, because you will have the possibility to do things, which could not be done before, for example a dynamic data management realized with linked lists.

- If possible try to implement a support for overloading functions (KeYDoN told me already that pascal doesn't support overloading functions, however).

- Access to search results of Reg ExpMatch could be pretty useful.
Title: Re: Script Core 2.6.4 Suggestions
Post by: PKS|Shooter on July 12, 2008, 06:41:24 am
a Ignore core, works like a Ignore list/Block System, /ign <ID>,  ignore the player.
Title: Re: Script Core 2.6.4 Suggestions
Post by: As de Espada on July 12, 2008, 08:45:32 am
particle support
like blood and jets, but controled by the script
Title: Re: Script Core 2.6.4 Suggestions
Post by: Avarax on July 12, 2008, 09:15:54 am
Just to make sure he remembers >_<




Hey enesce,
Here's a very personnel request of mine for the upcoming server / client versions:
Add the function to the number keys (1-9 & 0) on the keyboard that when you press them, a special command is sent to the server you're playing on.
These commands would have the only effect of triggering a scriptingcore event on the server like:
Code: [Select]
Hotkey(ID,Number: byte)
This would make total game modifications like Hexer, MMod or Tactical Trenchwars get rid off having to use taunts for fast special ability usage.
Thus, such mods would be way easier to get into for beginners that don't really know yet how to bind taunts or are too lazy to bind them exclusively for that mod.

Thanks for considering ;D

ciao, ava
Title: Re: Script Core 2.6.4 Suggestions
Post by: iDante on July 18, 2008, 03:56:42 am
IDK if it is already, but GetPlayerStat(ID,'kills'); should return KILLS only, not points. Possibly add another thing for points?
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on July 18, 2008, 01:02:47 pm
GetPlayerStat(Id, 'Kills') should not be modified, and should return points (due to older script capability), although there should be 'realkills' or something to return the number of kills a player got
Maybe next major change w/ no more capability for older versions this should change to 'points', and 'kills'
Title: Re: Script Core 2.6.4 Suggestions
Post by: lewymati on July 24, 2008, 03:51:21 am
1) Make Drawtext and that red kill messages not overdraw another messages - that i would like to see

2) Add abilty to put some additional scenery by scripting, something like:
putscenery(sceneryname:string,x:single,y:single,z-index:integer, optional: rotation,scale etc...)

maybe it will need some client changes, idk... But it will be something awesome... We could mark some places (for ex. mine positions), have a changable camp places :D, lots of new script abilities then

3)
Hey enesce,
Here's a very personnel request of mine for the upcoming server / client versions:
Add the function to the number keys (1-9 & 0) on the keyboard that when you press them, a special command is sent to the server you're playing on.
These commands would have the only effect of triggering a scriptingcore event on the server like:
Code: [Select]
Hotkey(ID,Number: byte)
This would make total game modifications like Hexer, MMod or Tactical Trenchwars get rid off having to use taunts for fast special ability usage.
Thus, such mods would be way easier to get into for beginners that don't really know yet how to bind taunts or are too lazy to bind them exclusively for that mod.

Thanks for considering ;D

ciao, ava
yes yes yes yes yes yes add that!!!
Title: Re: Script Core 2.6.4 Suggestions
Post by: iDante on July 24, 2008, 04:07:53 am
Well since OnWeaponFire couldn't happen, could you implement like... a variable BulletsFired[1..32] that just increments every time a player fires their gun?

Edit:
Also could like... onPlayerSpeak become a function that we can modify the result of?
by default it would be Result := Text; but it would make actual filters possible, instead of just warning people n stuff.
Title: Re: Script Core 2.6.4 Suggestions
Post by: neverknown on July 24, 2008, 09:25:44 pm
dont know if this one has been suggested before but well:

SetPlayerColor(Id, Part, Color)

This little function should let you change the color of a players pants and shirt on the fly ( e.g. while he is on the server ).
So scripts with classes and stuff are able to identify each others classes..
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on August 04, 2008, 07:27:53 pm
GetPlayerStat(byte, 'Shirt'): longint; and other body parts

Date Posted: July 25, 2008, 09:56:45 pm
moving the spawn point of a flag on the server doesnt move it on the client, it flickered at the default spawn point once (unless im mistaken) (actually i deleted the spawn point, and recreated it elsewhere)

Date Posted: July 27, 2008, 09:41:39 pm
GetPlayerStat(Id, 'SecondaryAmmo')

Date Posted: August 04, 2008, 08:20:19 pm
ForceWeapon ammo being 255 to have the player start reloading (for a real 0 amount of ammo)
Title: Re: Script Core 2.6.4 Suggestions
Post by: Norbo on August 16, 2008, 02:49:09 am
GetBulletExplosion maybe? that would be kinda hard to make, and u would have to specify the ID of the explosion... but how would u do that.... that would be extremely usefull, but hard to make.
Title: Re: Script Core 2.6.4 Suggestions
Post by: sai`ke on August 16, 2008, 06:40:28 am
Perhaps a special version of CreateBullet that would send the server to a specific routine on impact. CreateBulletImpact( standard createbullet parameters, 'routinename' ) or something.

Where the routine in question would get the coordinates of the impact passed as input parameters.
For example: function impact( X, Y: single );

Kinda like crossfunc but triggered by the impact. Could be lagtastic if used wrong but would open some nice possibilities for scripted weaponry.
Title: Re: Script Core 2.6.4 Suggestions
Post by: EnEsCe on August 16, 2008, 09:19:58 am
Thats a good concept there Sai`ke, sounds interesting. Shall definately have a look into that one
Title: Re: Script Core 2.6.4 Suggestions
Post by: zop on August 17, 2008, 08:50:05 pm
Is there anyone talk about UI?
Weapon menu, mini-map, score point list, any UI show messages or selections should be used to script.

I would like to add a class menu before weapon menu, and show something in mini-map, and some messages in score points.

Maybe scripter can create new UI list for their mod.
Title: Re: Script Core 2.6.4 Suggestions
Post by: Norbo on August 23, 2008, 09:49:39 am
another parameter for CreateBulllet, something like,  CreateBullet(standar createbullet params, visibleto) to set the bullet to be visible for what teams, that would be cool on trenchwars servers so both team can see the airstrike...
Title: Re: Script Core 2.6.4 Suggestions
Post by: chutem on August 24, 2008, 12:10:38 am
Making it so that Poly's have ID's. (You could make the server load them by having the top-most poly having ID 1, etc)

And then you can have a procedure:

OnPlayerPolyCollide(PolyID, PlayerID, PlayerX, PlayerY, PolyType);

You could also have stuff like GetPolyStat and SetPolyStat too.
Title: Re: Script Core 2.6.4 Suggestions
Post by: Norbo on August 26, 2008, 03:35:31 am
GiveBonus(ID,type,time);
a new parameter for give bonus, time, which is how long the bonus will last
Title: Re: Script Core 2.6.4 Suggestions
Post by: SyavX on August 26, 2008, 03:57:29 am
changes that have already been proposed

Code: [Select]
GetPlayerStat(ID, 'Admin');

OnVoteKick(Voter, Target: byte; Reason: string): boolean;
OnVoteMap(Voter: byte; MapName: string): boolean;

Plus ability to call StartVoteKick/StartVoteMap even if there was another voting less than 2 min ago.

btw, EnEsCe, fix a mistake in example for GetPiece (http://www.enesce.com/help/html/Functions/GetPiece.html):
Quote
WriteLn(GetPiece(MyString,' ',0)); //Hello
etc...
Title: Re: Script Core 2.6.4 Suggestions
Post by: zakath on September 04, 2008, 08:05:54 am
Change onplayerDamage to include bullettype that caused the damage
function OnPlayerDamage(Victim,Shooter,type: Byte;Damage: Integer) : integer
So that You can do things like a chance to critical damage with for example ruger.
Title: Re: Script Core 2.6.4 Suggestions
Post by: Norbo on September 29, 2008, 11:52:48 am
procedure RespawnFlag(TeamFlag: byte)

TeamFlag = the id of the team that the flag is (so TeamFlag would be 1 for alpha)

kills the flag and resapwns it in its spawnpoint (like after a round in survival mode)
Title: Re: Script Core 2.6.4 Suggestions
Post by: BombSki on September 29, 2008, 12:02:44 pm
procedure RespawnFlag(TeamFlag: byte)

http://forums.soldat.pl/index.php?topic=22216.0
Title: Re: Script Core 2.6.4 Suggestions
Post by: Vyka on September 29, 2008, 12:45:05 pm
GetPlayerStat(ID,'prone')

support prone to available variables in GetPlayerStat, please ;)
Title: Re: Script Core 2.6.4 Suggestions
Post by: Norbo on September 29, 2008, 01:31:54 pm
procedure RespawnFlag(TeamFlag: byte)

http://forums.soldat.pl/index.php?topic=22216.0
thanks, that rly helped
Title: Re: Script Core 2.6.4 Suggestions
Post by: Serial K!ller on September 29, 2008, 01:40:32 pm
putbutton(ID,uniquebuttonname,Xpos,Ypos,"Text",myprocedure)
Deletebutton(ID,uniquebuttonname)

Add a buton on a users screen (f.e. an "Admin" button that open a selection box that shows some actions depending on you authorisation lvl.)
Title: Re: Script Core 2.6.4 Suggestions
Post by: Norbo on October 01, 2008, 12:18:19 pm
OnBulletFire(ID,Weapon,VelocityX,VelocityY);
its self-explainable
Title: Re: Script Core 2.6.4 Suggestions
Post by: iDante on October 01, 2008, 12:59:19 pm
OnBulletFire(ID,Weapon,VelocityX,VelocityY);
its self-explainable
Think about how often that would be called in a 16 vs 16 deathmatch where everyone is using miniguns.

EnEsCe: can OnMapChange be called when the first map loads on a server? You can't call it from ActivateServer because the map isn't loaded by that time.
Title: Re: Script Core 2.6.4 Suggestions
Post by: chutem on October 04, 2008, 04:36:01 pm
How about adding some stuff to moveplayer, like being able to set the x velocity, y velocity, and side they are facing?
Title: Re: Script Core 2.6.4 Suggestions
Post by: tk on October 21, 2008, 12:37:09 pm
GetPlayerStat(ID, 'aimingX'): single
GetPlayerStat(ID, 'aimingY'): single   (angle of weapon which player is holding)
GetPlayerStat(ID, 'admin'): boolean
GetPlayerStat(ID, 'position'): byte   (0-normal, 1-duck, 2-prone)

AppOnIdleB(ticks: int)
   Like normal apponidle but called 10 times per second. No more apponidle bots and thread functions

KillPlayer(ID, Killer)

SetPlayerGrenades(NumberOfNades: byte; NadeType: boolean{normal or cluster})

SetJetFuel(ID, percent or jetticks)

CreateSpark(x,y, scale, Type)

PlaySound(x, y, range, name)
   Sound played from defined point on the map. If we are far to a source we dont hear the sound or it's less loud.

CreateText(ID, text, TimeDelay, RGB(0,0,0), scale, x, y)
   Text like we can see over the player saying smth, but sticked to defined point on the map.


Could be enabled exploding bullet types? (cluster, flamearrow, missile)
Title: Re: Script Core 2.6.4 Suggestions
Post by: NakedSnake on October 26, 2008, 07:42:18 pm
What I would like to see is -

DestroyBullet (BulletID: integer);

:)

By my logic - CreateBullet returns the Bullet ID No. - then why can we not have a Destroy Bullet?
Title: Re: Script Core 2.6.4 Suggestions
Post by: miketh2005 on October 30, 2008, 03:00:30 am
I don't script, but here are a few procedure suggestions:

Onbulletcollide - Should have:
if player then
and
if polygon then

because theres no way to track if a bullet hits a polygon, would be nice for a portal sub-gamemode.

umm... these names a pretty sucky, but you can change them:

onplayerdoes: can slow down a player or tell if he is crouching

tellplayerchat: can tell the player to say stuff which is useless...

onbuttonpress: can tell what button the person pressed, prob the most usefull procedure here, think of the possibilities

onnade: can give the player / take away nades

onjet: can change the maximium jet for ALL players, or change it to so much, for ALL players

thats it...
Title: Re: Script Core 2.6.4 Suggestions
Post by: chutem on October 31, 2008, 05:38:36 pm
LoadWeap(ID:byte, FileName:String);

Loads a weapon.ini file with the specified name, to the specified ID (0 for all).

Would need some good protection, as I can see hacks being made to exploit this, so it should be an option like scripting is in soldat.ini.
Would be awesome for scripts that involve skills, you could increase ammo, range and power much more efficiently. (Must not restart server though).
Title: Re: Script Core 2.6.4 Suggestions
Post by: jezza on December 02, 2008, 09:24:07 pm
Good to see an upcoming release! About the gravity i think there should be a parameter in it allowing you to change a certain players gravity and/or the entire server. Now for my own idea, maybe something like GetPlayerMouse(ID) would check to see at what coordinates on the map or relative to the player, the players mouse is, this would open up so many boundaries and help with many scripts, maybe

GetPlayerMouse(ID,'Absolute');
or
GetPlayerMouse(ID,'Relative');
thanks for considertation.


Modifcation: And also maybe would it be possible to have more than one DrawTexts up at a time without it overwriting?


Modification: Also a WriteINI(blablabla) function would be very useful, i suggest that. There are some WriteINI custom functions already out there but they are very laggy to the servers.
Title: Re: Script Core 2.6.4 Suggestions
Post by: chutem on December 04, 2008, 11:10:47 pm
It would be nice if the scriptcore gave a bit more information about any errors, like what things are causing the problem. And at the same time you could fix up the problem that when it says where the error occured, it is always a couple of lines ahead and makes it a pain in the ass to fix.

Thank you.
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on December 12, 2008, 06:27:53 am
having CrossFunc (and possibly ThreadFunc if you want) to work on built-in functions so we don't have to redefine them with a different name.
For instance.. CrossFunc(['test'], ScriptName + '.WriteLn');
Title: Re: Script Core 2.6.4 Suggestions
Post by: iDante on December 22, 2008, 04:35:26 am
Bugfix/suggestion:
Make Round(0.5) return 1 instead of 0. Same with Round(0.45) and such.
Title: Re: Script Core 2.6.4 Suggestions
Post by: chutem on January 17, 2009, 12:28:47 am
Could you make the numbers for guns and objects consistent throughout functions please?

As in setweaponactive and forceweapon use different numbers for each gun. It's kinda annoying.
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on January 17, 2009, 02:43:12 pm
(more of a server suggestion but relates to scripting)
When starting up the server with scripting enabled, but 0 scripts found and no Includes.txt found in the old format, preventing the errors..
Title: Re: Script Core 2.6.4 Suggestions
Post by: cynicle on January 25, 2009, 03:51:45 am
A simple one. modification to add more options to setscore procedure.

procedure SetScore(ID: Byte; Type, Value: Integer);

Where Type could be:
1 = Score
2 = Kills
3 = Deaths

or optionally Type could be a string.
Title: Re: Script Core 2.6.4 Suggestions
Post by: tk on January 28, 2009, 11:33:35 am
ln and exp function.
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on January 28, 2009, 11:58:24 am
or possibly even a Log function; whatever u name it Ln & Log or Log and Log10
Title: Re: Script Core 2.6.4 Suggestions
Post by: danmer on February 10, 2009, 09:01:58 am
function FormatGMTDate(FormatString: string; offset: integer): String

similar to FormatDate, but returns the GMT+offset time instead of local server time. Useful for keeping logs on multiple servers synchronized.

Or/and, if possible:
function UnixTimestamp(): integer
function FormatTimestampDate(FormatString: string; timestamp: integer): String
Title: Re: Script Core 2.6.4 Suggestions
Post by: deguix on March 07, 2009, 09:02:34 am
My project consists on customized weapon swaps, so I suggest the following:
- Remove the initial onweaponchange call when the player joins the server... it gives invalid weapon ids.
- Make onweaponchange to be called only when the weapon change is complete like on the flamer god bonus (flamer, oldprimary; oldprimary, oldprimary; flamer, oldprimary) - make it directly flamer, oldprimary. (although possible to pass by).
- Either make a OnBulletChange procedure/function (which would be called whenever a bullet is shot), or fix GetPlayerStat(ID, "ammo") to correctly get the current weapon ammo inside onweaponchange (latter is easier).
- procedure OnWeaponSelEnd(ID, primary, secondary:byte); - procedure to be called when the weapon selection ends on the weapon menu.
- unlock forceweaponing rambo bow and add options to soldat.ini for Weapon_14 and Weapon_15 and make "Disable_AntiCheat_Kick" to work on them too - then there wouldn't be anymore unnecessary rambo kicks if a script uses the bow. But, make sure it's considered a normal weapon on game modes that are not rambo mode, and make sure the forceweaponing of bow on RM servers is locked.
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on March 11, 2009, 07:13:08 pm
GetURLTimeout: cardinal; // in millisecs
or function GetGetURLTimout(): cardinal; procedure SetGetURLTimeout(const Amount: cardinal);

events rather then GetKeyState or wahtever function it is called
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on March 21, 2009, 02:48:45 pm
Binary writing and reading..
function fOpen(filename: string): integer; (returns index to a built-in array of handlers)
procedure fClose(handle: integer);
procedure BinaryWrite<type>(handle: integer; data: <type>); (example BinaryWriteByte(handle: integer; data: byte); BinaryWriteString(handle: integer; data: string) would write an int or something for length of string, and then each char of the array)
function BinaryRead<type>(handle: integer): <type>; (example BinaryReadString(handle: integer): string;
procedure ReadAll(handle: integer): string;
procedure Write(handle: integer; options: integer); (options is to make it either clear everything and start from beginning, or start at end, or whatever; probably better word than options tho (or instead have different functions, either way works))
whereas <type> are all basic types..

would make life a lot more fun with binary reading and writing..
Title: Re: Script Core 2.6.4 Suggestions
Post by: danmer on March 27, 2009, 08:06:53 am
AppOnIdle_interval=x option in server.ini
To set how ofter that procedure is called (if its not more complex than adding two lines of code of course <.<) This could give some room for experimenting for those who have extra resources.
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on April 10, 2009, 02:55:36 pm
event: procedure DeactivateServer(); called right before a "/recompile" "/recompile <script>" of same script, server closing down (ctrl+c / Shutdown() or whatever) in order to close sockets, clean stuff up before shutdown, etc.
Title: Re: Script Core 2.6.4 Suggestions
Post by: DorkeyDear on April 12, 2009, 03:05:46 pm
global var BattlEyeEnabled: boolean; (or integer 1/0)
Title: Re: Script Core 2.6.4 Suggestions
Post by: Gizd on April 18, 2009, 09:02:53 am
Fix transparent DrawText's. When text fades it flashes and does other unwanted things.
Title: Re: Script Core 2.6.4 Suggestions
Post by: ]{ing on April 23, 2009, 10:50:59 pm
Could you please add 'OnWeaponReload' function ... or make OnWeaponChange be called on a reload. Either one of these would be tremendous!
Title: Re: Script Core 2.6.4 Suggestions
Post by: Bloo on April 27, 2009, 07:35:06 am
OnPlayerRespawn shouldn't act on OnMapChange.
Title: Re: Script Core Suggestions
Post by: NTxC on April 29, 2009, 09:25:42 am
Well, I guess it would be great if Command( Cmd: string ); would call OnCommand too!  ::)
Title: Re: Script Core Suggestions
Post by: LORD KILLA on May 01, 2009, 06:10:31 am
new Events/Functions:
Code: [Select]
Function OnPlayerShoot (ID, Weapon: Byte): Boolean;
begin
  Result := false; // false: Discard bullet (dont create it), true: Create it
end;

Function GetCursorPosition (ID: Byte; X: Boolean): Single;
begin
  if X = true then Result := {get cursor position code here(X)} else Result := {get cursor position code here(Y)};
end;
Title: Re: Script Core Suggestions
Post by: ]{ing on May 02, 2009, 12:17:07 am
I vote for OnPlayerShoot, would make my accuracy script allot cleaner.
Title: Re: Script Core Suggestions
Post by: DorkeyDear on May 03, 2009, 06:51:33 pm
having shell_exec changed so it is not limited to 8 characters doesn't ruin case sensitivity (it does everything in caps at least in windows) <- required for a script I want to do..
Title: Re: Script Core Suggestions
Post by: DorkeyDear on May 05, 2009, 08:29:07 pm
function SocketReceivedLength(Index: integer): integer;
function ReadSocket(Index, Length: integer): string; // reads the next Length characters... if longer than whats ready, it waits for it? or throws an exception.. or just returns what it gets..
Title: Re: Script Core Suggestions
Post by: DorkeyDear on May 06, 2009, 03:09:51 pm
function ExceptionProcName(ExProc: cardinal): string;
ExProc is the value returned by ExceptionProc: cardinal;

Title: Re: Script Core Suggestions
Post by: DorkeyDear on May 07, 2009, 05:30:40 am
function FunctionExists(Script, FuncName: string): boolean;

and just an idea i just came up with, would make some things easier, but not necessarily necessary
function GetFunction(Script, FuncName: string): TFunc; // or if TVarType supports it... but i doubted it
function InvokeFunction(Func: TFunc): variant;
can be used for other things like RenameFunction <- not sure what the real use of it would be tho :P

Title: Re: Script Core Suggestions
Post by: DorkeyDear on May 08, 2009, 06:48:51 pm
CreatePackage / UsePackage - allowing temporary modification of objects and possibly images such as boxes and flags and such. can come out to be kick-ass server mods :D
Title: Re: Script Core Suggestions
Post by: DorkeyDear on May 11, 2009, 07:22:03 pm
procedure Write(const Text: string);
procedure WriteAt(const X, Y: integer; const Text: string);
(console functions)
Title: Re: Script Core Suggestions
Post by: DorkeyDear on May 18, 2009, 07:00:32 pm
I believe you mentioned something about a Time function, but howabout a DateTime function?
Also ability to minipulate the return values of either into a string functions.

Possibly:
DateTimeTotalMinutes(Time: cardinal): cardinal;
DateTimeMinutes(Time: cardinal): cardinal;
DateTimeTotalHours(Time: cardinal): cardinal;
etc.. Something similar to .NET's TimeSpan class' methods: DateTime[Total](Days|Hours|Minutes|Seconds|Ticks|Milliseconds) whereas [] is optional and (a|b|c) are ors.

EDIT:
parameter is specified time (FormatDate does not have this ability); would probably be better if you did something similar to FormatDate but with a time parameter (new function)
FormatDateTime(Time: cardinal, Format: string): string;
Title: Re: Script Core Suggestions
Post by: LORD KILLA on May 23, 2009, 06:00:03 am
function FormatDate(): string;
>_<, we have already gotta that, look in eC help .-.
Title: Re: Script Core Suggestions
Post by: iDante on June 02, 2009, 07:06:30 pm
Instead of having lots of things like MovePlayer, ForceWeapon and SetScore, why not just have:
SetPlayerStat(ID: byte, Stat: string, Value: variant)
Of course it wouldn't work for things like IP and Name (possibly could create a temp name).

I'd also like SetPlayerVelocity(ID: byte, VelX, VelY: Single)
Title: Re: Script Core Suggestions
Post by: Gizd on June 02, 2009, 11:31:38 pm
Quote
I'd also like SetPlayerVelocity(ID: byte, VelX, VelY: Single)
SetPlayerStat(ID, 'VelX', x)
Title: Re: Script Core Suggestions
Post by: Bloo on June 03, 2009, 12:25:52 am
It's undoubtably been suggested before, but an IsAdmin() function is more-than-needed.
Title: Re: Script Core Suggestions
Post by: Gizd on June 03, 2009, 07:48:04 am
Why not just add 'admin' to GetPlayerStat?
Title: Re: Script Core Suggestions
Post by: Bloo on June 03, 2009, 07:49:39 am
Even better.
Title: Re: Script Core Suggestions
Post by: DorkeyDear on June 10, 2009, 11:13:44 pm
functions relating to weapon mods (current mod; current mod filename; mod name at least?)

current mapslist filename; ability to get the mapslist (one map at a time if you can't?)? (i believe there is/was a command to modify it, but not modify the file?)

function GetMapsList(): array of string;
var MapslistFilename: string;
Title: Re: Script Core Suggestions
Post by: DorkeyDear on June 11, 2009, 12:31:45 am
Something that acts similar to the way cookies act on websites. Temporary (or permenant data) stored client-side that can be retrieved by the server whenever, and only by that server.

i see no reason why not to still call them cookies.

procedure SetCookie(Name, Value: string);
function GetCookie(Name: string): string;
procedure DeleteCookie(Name: string);
function CookieList(): array of string; // list of cookie names
Title: Re: Script Core Suggestions
Post by: DorkeyDear on June 18, 2009, 03:59:34 pm
Having ReadLnSocket either return '' or throw an exception once the socket becomes disconnected. Please and thank you.

A function SocketReady(const Index: integer): boolean; or something which checks whether ReadLnSocket is ready to retrieve some text or not. (So you don't have ReadLnSocket waiting if you don't want it to)
Title: Re: Script Core Suggestions
Post by: Gizd on June 21, 2009, 09:15:42 am
ServerModifier('Resistance',x) - modifies air resistance.

> 0 - speed is deacreasing(very high value will unable any bullet/player to move)
= 0 - speed doesn't change(awesome with gravity set to 0)
< 0 - speed is increasing(100% fun  ;D)
Title: Re: Script Core Suggestions
Post by: iDante on June 26, 2009, 03:34:40 pm
GetPlayerStat(ID, 'registered')
Title: Re: Script Core Suggestions
Post by: tk on June 27, 2009, 02:57:36 am
Pointers
Title: Re: Script Core Suggestions
Post by: Prodigyx on June 30, 2009, 01:13:58 am
Basic file management functions: CopyFile, MoveFile, DeleteFile...

and search file functions: FindFirst/FindNext Delphi like, using mask *.txt, *.*, etc
Title: Re: Script Core Suggestions
Post by: SpiltCoffee on July 02, 2009, 12:32:16 am
GetPlayerStat(ID,'admin')
Title: Re: Script Core Suggestions
Post by: Neosano on July 04, 2009, 05:34:51 pm
KeyPress EVENT PLEASE!!!
Title: Re: Script Core Suggestions
Post by: y0uRd34th on July 05, 2009, 02:53:17 am
Quote
function GetKeyPress(ID: byte; Key: string):boolean

Parameter Info:
  ID (Byte): Player ID to get the key press of.
  Key (String): See Description for more information.

Description:
This function will return true/false if a player is holding down the specified key.

Key              Result
Left               Left key
Right             Right key
Up                Jump/Up Key
Down            Crouch/Down key
Shoot            Attack button
Jetpack         Jetpack button
Grenade        Grenade button
Changewep   Change weapon button
Throw           Throw Weapon button
Reload          Reload Button
Crouch          Crouch/Down key
Prone            Prone key (will stay TRUE while proned)
Title: Re: Script Core Suggestions
Post by: Neosano on July 07, 2009, 05:07:33 pm
Quote
function GetKeyPress(ID: byte; Key: string):boolean

Parameter Info:
  ID (Byte): Player ID to get the key press of.
  Key (String): See Description for more information.

Description:
This function will return true/false if a player is holding down the specified key.

Key              Result
Left               Left key
Right             Right key
Up                Jump/Up Key
Down            Crouch/Down key
Shoot            Attack button
Jetpack         Jetpack button
Grenade        Grenade button
Changewep   Change weapon button
Throw           Throw Weapon button
Reload          Reload Button
Crouch          Crouch/Down key
Prone            Prone key (will stay TRUE while proned)
It's not an event.
Title: Re: Script Core Suggestions
Post by: croat1gamer on July 07, 2009, 05:33:23 pm
AppOnIdle to be called each tick, and the beginning with "if GetKeyPress..."
Title: Re: Script Core Suggestions
Post by: y0uRd34th on July 08, 2009, 10:15:46 am
It's not an event.

Do you mean with event, that it is called like OnPlayerKill, etc.?
Event > something will be called if you do sth. specific? Am I right? :P
When yes, it would awesome ;)
Title: Re: Script Core Suggestions
Post by: Neosano on July 08, 2009, 04:09:48 pm
Yes, OnPlayerKill is event.
http://en.wikipedia.org/wiki/Event_(computing)
Title: Re: Script Core Suggestions
Post by: y0uRd34th on July 10, 2009, 07:03:42 am
kk, :D I wasn't sure what a event is in soldat :O not the best in english, lalala^^
Title: Re: Script Core Suggestions
Post by: miketh2005 on July 11, 2009, 12:07:03 am
Quote
function GetKeyPress(ID: byte; Key: string):boolean

Parameter Info:
  ID (Byte): Player ID to get the key press of.
  Key (String): See Description for more information.

Description:
This function will return true/false if a player is holding down the specified key.

Key              Result
Left               Left key
Right             Right key
Up                Jump/Up Key
Down            Crouch/Down key
Shoot            Attack button
Jetpack         Jetpack button
Grenade        Grenade button
Changewep   Change weapon button
Throw           Throw Weapon button
Reload          Reload Button
Crouch          Crouch/Down key
Prone            Prone key (will stay TRUE while proned)
Title: Re: Script Core Suggestions
Post by: croat1gamer on July 11, 2009, 07:00:42 am
To be able to specify in OnWeaponChange how did the weapon got changed, if it was picked up, changed at wep menu, thrown or changed to secondary.
Title: Re: Script Core Suggestions
Post by: DorkeyDear on July 13, 2009, 03:38:17 pm
Ability to only allow CrossFunc to access certain functions from specific scripts using scripting somehow.
(I have a script w/ functions i do not want to be able to be called except by this one other script)
Title: Re: Script Core Suggestions
Post by: Gizd on July 13, 2009, 03:42:31 pm
Ability to only allow CrossFunc to access certain functions from specific scripts using scripting somehow.
It's not possible?
Title: Re: Script Core Suggestions
Post by: miketh2005 on July 13, 2009, 04:24:12 pm
Ability to change a scenery depending on what the player does. Like /open opens a gate. This would require modifying map format, but it's worth it! Think of the possibilities! Soldat would be the best game ever made, if this was implemented.
Title: Re: Script Core Suggestions
Post by: ~Niko~ on July 13, 2009, 05:21:26 pm
AppOnIdle being called each determinate number of ticks you can specify for each function you put in, not soldat.ini based, but script-based.
Title: Re: Script Core Suggestions
Post by: croat1gamer on July 14, 2009, 12:54:49 am
Not each specified number but each second, and if you use mod() function you can set it like mod(ticks) BUT the ticks musst be = xy*60.

There should be an procedure that would call something every xy ticks.
Title: Re: Script Core Suggestions
Post by: Neosano on July 14, 2009, 03:14:23 am
Not each specified number but each second, and if you use mod() function you can set it like mod(ticks) BUT the ticks musst be = xy*60.

There should be an procedure that would call something every xy ticks.
Enesce said in his blog that calling a procedure too much is causing access violations...
That's why he is not going to add OnFire :S
Still I don't get how calling a procedure could cause an access violation O_o
Title: Re: Script Core Suggestions
Post by: croat1gamer on July 14, 2009, 05:08:16 am
Ill describe it to you this way:
Make a script like this

Code: [Select]
AppOnIdle(Ticks: integer);

var
i: integer;

begin
for i := 1 to 32
if GetPlayerStat(i, primary) = 1 then
   repeat
   if GetPlayerStat(i, ammo) = 0 then WriteConsole(i,'LOL, NO BULLETS',$EE81FAA1);
   until GetPlayerStat(i, ammo) > 0
end;

Enjoy it.

Not a access violation though, but it is the same effect.
Title: Re: Script Core Suggestions
Post by: Neosano on July 15, 2009, 02:30:16 am
Ill describe it to you this way:
Make a script like this

Code: [Select]
AppOnIdle(Ticks: integer);

var
i: integer;

begin
for i := 1 to 32
if GetPlayerStat(i, primary) = 1 then
   repeat
   if GetPlayerStat(i, ammo) = 0 then WriteConsole(i,'LOL, NO BULLETS',$EE81FAA1);
   until GetPlayerStat(i, ammo) > 0
end;

Enjoy it.

Not a access violation though, but it is the same effect.
Server will freeze... Or AppOnIdle is called in another thread?
Title: Re: Script Core Suggestions
Post by: croat1gamer on July 15, 2009, 08:00:48 am
Repeat is being done almost every tick untill Ammo gets higher than 0.
If there was a OnFire, now, 3 ppl firing 3 mp5 simultaneously would have the same offect, also being called evert 4th tick, and that 3 times.
Title: Re: Script Core Suggestions
Post by: NTxC on July 19, 2009, 11:54:10 am
Please remove the "(Script)" postfix in BanPlayerReason.... Who needs to know that he was banned by a script? It messes up the look of the reason.  ::)
Title: Re: Script Core Suggestions
Post by: Hacktank on July 21, 2009, 05:40:17 am
Code: [Select]
function GetWaypointStat(ID: byte; stat: string): varient;

Stats:
active: boolean
x: singe
y: single
team: byte
style: byte (like 0=right 1=left 2=up 3=down 5=jet and such, its the combined result of all)
links: array of byte (all the other waypoints ID is linked to)



getplayerstat(ID,'curwaypoint'): byte;

This would be usefull for some zombie mods and exotic gamemodes.
Title: Re: Script Core Suggestions
Post by: Prodigyx on July 27, 2009, 10:28:11 am
OnPlayerSpeak like a function. Return true if you want disable the text typed.
Title: Re: Script Core Suggestions
Post by: DorkeyDear on July 27, 2009, 03:03:59 pm
Making OnPlayerSpeak not threaded.
Title: Re: Script Core Suggestions
Post by: DorkeyDear on July 27, 2009, 06:42:35 pm
SoldatIniFile: string; / GetSoldatIniFile(): string;
same w/
weapons mod file
maps list file
and anything else missed

its kind of a waste of time to figure out and parse the commands used, and set it that way
Title: Re: Script Core Suggestions
Post by: DorkeyDear on July 27, 2009, 11:27:25 pm
calling OnWeaponChange BEFORE the X and Y coordinates are changed to 0, 0 (or just don't change them, shouldn't be any harm) of the object (weapon) that was picked up. (It seems the X and Y coordinates are set to 0, 0, but Active is not yet set to false, which is odd; but whatever)
Title: Re: Script Core Suggestions
Post by: DorkeyDear on July 29, 2009, 07:16:45 pm
This is more of a server suggestion, but it relates to the scripting core.
When doing /recompile [scriptname], if the script or scripts do not compile, disabling them instead of closing the server. (Possibly optional, server.ini)
Title: Re: Script Core Suggestions
Post by: Prodigyx on July 30, 2009, 05:00:20 pm
Binary Read/Write file functions.
Title: Re: Script Core Suggestions
Post by: DorkeyDear on August 03, 2009, 10:39:51 am
OnScriptCrash event, and ability to specify the a handler function in what script
server.ini
OnScriptCrash=Invoke:CrashHandler.OnScriptCrash (or just Infoke:CrashHandle, to remove the specification of what event to call)

function OnScriptCrash(Script: string): boolean; // returns whether or not to disable the script

This setup allows for only one handler method, and no return value collisions.
Title: Re: Script Core Suggestions
Post by: Serial K!ller on August 04, 2009, 01:42:00 pm
procedure DoHeal(ID: Byte; HealPoints: Integer)

Yes I know you can do negative damage with dodamage but I have one problem with it because it also 'heals' the bulletproof vest which makes the vest way to powerful when using a regeneration script.

an extra argument like armorpiercing : boolean on dodamage would be fine for me to
Title: Re: Script Core Suggestions
Post by: rayanaga on August 04, 2009, 05:58:54 pm
procedure DoHeal(ID: Byte; HealPoints: Integer)

Yes I know you can do negative damage with dodamage but I have one problem with it because it also 'heals' the bulletproof vest which makes the vest way to powerful when using a regeneration script.

an extra argument like armorpiercing : boolean on dodamage would be fine for me to

Seconded. :D
Title: Re: Script Core Suggestions
Post by: Polifen on August 07, 2009, 02:08:58 pm
Add parameter(s) to RayCast that will allow to specify for what kind of polys should it check : 0 - normal, 1 - only player collide, 2 - only bullet collide. I don't really know how to explain it better...
Title: Re: Script Core Suggestions
Post by: Zabijaka on August 07, 2009, 04:15:00 pm
Parameter Weapon:string in function OnPlayerDamage :)
Title: Re: Script Core Suggestions
Post by: danmer on August 07, 2009, 05:59:22 pm
Parameter Weapon:string in function OnPlayerDamage :)
at least bulletstyle, pretty pleeeeeeeeeeeeeeeeeeease
Title: Re: Script Core Suggestions
Post by: y0uRd34th on August 14, 2009, 10:22:31 am
Why bulletstyle? Hk, Minimi... have all plain bullet :D
Title: Re: Script Core Suggestions
Post by: ~Niko~ on August 14, 2009, 10:48:25 am
Why bulletstyle? Hk, Minimi... have all plain bullet :D
M79 is likely not to...
Title: Re: Script Core Suggestions
Post by: DorkeyDear on August 14, 2009, 10:59:54 am
procedure AppendFile(File, Content: string);
The same thing as WriteLnFile except it does not write a line, and only appends text to the end.
Title: Re: Script Core Suggestions
Post by: Serial K!ller on August 14, 2009, 01:06:51 pm
procedure OnWeaponChange(ID; PrimaryNum; SecondaryNum; By:??);

By says it's called by : Spawn, Forceweapon, weapon menu(choosing weapon after spawned), weapon switch, weapon pickup, ...
Title: Re: Script Core Suggestions
Post by: Serial K!ller on August 18, 2009, 12:10:20 pm
Procedure OpenWeaponsMenu(ID) opens the weapons menu for that player even when in the middle of a map.
Like that secret command that used to be in the older soldat versions.
Title: Re: Script Core Suggestions
Post by: ~Niko~ on August 18, 2009, 04:18:53 pm
procedure DoHeal(ID: Byte; HealPoints: Integer)
I guess that I could do this for ya.

When I find some spare time.
Title: Re: Script Core Suggestions
Post by: Serial K!ller on August 31, 2009, 03:24:39 pm
Event
function OnplayerBonus(ID : byte ;BonusType : byte) : boolean;

f.e.:

Code: [Select]
Function OnplayerBonus(ID,BonusType);

  If BonusType = 1 then begin
     customBonus(ID);
     result := false;
  end
  else begin
     result := true;
  end;

end;

[edit]
Fixed to function :p
Title: Re: Script Core Suggestions
Post by: ~Niko~ on August 31, 2009, 04:46:24 pm
procedures can't hold results, serialkiller

function OnplayerBonus(ID,BonusType): Boolean; //this would do the trick
Title: Re: Script Core Suggestions
Post by: Serial K!ller on September 10, 2009, 02:41:19 pm
spawnCustomBonus(PosX,PosY,CustombonusIDtype,"\downloads\mytext.bmp")

and

OnplayerCustomBonus(ID : byte ;BonusType : byte) : boolean;
Title: Re: Script Core Suggestions
Post by: miketh2005 on September 10, 2009, 04:07:05 pm
spawnCustomBonus(PosX,PosY,CustombonusIDtype,"\downloads\mytext.bmp")

and

OnplayerCustomBonus(ID : byte ;BonusType : byte) : boolean;

Instead of adding this, I think, if possible, he should add a way to spawn custom pictures.
Title: Re: Script Core Suggestions
Post by: xmRipper on September 10, 2009, 04:41:59 pm
Instead of adding this, I think, if possible, he should add a way to spawn custom pictures.
I hope new scripting core will support this.

(...extra map features to provide exciting new gameplay elements, vastly improved interface customization via server-side scripting, truckloads of new Script Core features...)
Title: Re: Script Core Suggestions
Post by: miketh2005 on September 10, 2009, 04:49:57 pm
Instead of adding this, I think, if possible, he should add a way to spawn custom pictures.
I hope new scripting core will support this.

(...extra map features to provide exciting new gameplay elements, vastly improved interface customization via server-side scripting, truckloads of new Script Core features...)

EXACTLY! That will GREATLY improve Soldat gameplay. I want to make a Soldat RPG, which I think will do very nicely, especially with these features implemented.
Title: Re: Script Core Suggestions
Post by: rayanaga on September 11, 2009, 04:05:43 pm
Yeah, something like  DrawImage("\downloads\ExtraInterface.png", x, y, scale, rotation, color)

I only vote for having more then one DrawText method up at a time. I dunno how much work this would require though.
Title: Re: Script Core Suggestions
Post by: miketh2005 on September 11, 2009, 10:26:29 pm
Also, changing playing movement speed is much needed.

P.S. I like love your new avatar, raya :D
Title: Re: Script Core Suggestions
Post by: rayanaga on September 12, 2009, 09:08:41 am
Also, changing playing movement speed is much needed.

P.S. I like love your new avatar, raya :D

Thank you. :D

Yeah, SetPlayerStat(ID,'Velx') or something would be very nice.
Title: Re: Script Core Suggestions
Post by: |_ancer on September 13, 2009, 02:59:28 am
It'll be awesome to mock someone so I suggest this.
This basically forces a player to say something.

ForceSay(ID: byte; Text: String);
Title: Re: Script Core Suggestions
Post by: croat1gamer on September 13, 2009, 03:31:31 am
*cough* *cough* (http://enesce.com/help/html/Functions/BotChat.html)
Title: Re: Script Core Suggestions
Post by: |_ancer on September 13, 2009, 03:36:38 am
*cough* *cough* (http://enesce.com/help/html/Functions/BotChat.html)
So true.
Title: Re: Script Core Suggestions
Post by: Serial K!ller on September 13, 2009, 04:23:45 pm
getplayerstat(ID,'ammo2': Byte) returns secondary weapon ammo

procedure ForceWeapon(ID, Primary, Secondary, Ammo, Ammo2: Byte)  can set both primary and secondary weapons ammo
Title: Re: Script Core Suggestions
Post by: Tio R on September 15, 2009, 09:00:05 am
function GetPlayerStat(ID ,'admin'):boolean
obvious...

function GetPlayerStat(ID,'resolution'):string
return the resolution of player. Ex: '640x480'

procedure SetDeath(ID:byte; Death:integer)
set the players death to a new value.

procedure SetFlagScore(ID:byte; FlagScore:integer)
set the players score to a new value.
Title: Re: Script Core Suggestions
Post by: croat1gamer on September 15, 2009, 09:08:33 am
It would be useful, but has been suggested.

Resolution is kind off useless, isnt it?

GetPlayerStat(ID,'Deaths') := *NUMBER GOES HERE*

For setting how much caps would the player have? I think it is possible via GetPlayerStat(ID,'Flags') := *NUMBER GOES HERE*



For any other suggestions, take first a look here: http://enesce.com/help/, to check that it isnt possible to do currently.

Yeh, i repeat again, i would like some options for a faster AppOnIdle similar procedure.
Title: Re: Script Core Suggestions
Post by: miketh2005 on September 15, 2009, 02:25:23 pm
How about setting how long a grenade delays until it goes off?
Title: Re: Script Core Suggestions
Post by: Tio R on September 15, 2009, 06:48:46 pm
Resolution is kind off useless, isnt it?
No! For example, a script of rpg with a skill of flash. I use a big drawtext for cover the display of players. This go work with players of low resolution.
But for players with hight resolution. Go cover only a small area of screen.
I could set the correct size of drawtext using the player resolution.

GetPlayerStat(ID,'Deaths') := *NUMBER GOES HERE*

For setting how much caps would the player have? I think it is possible via GetPlayerStat(ID,'Flags') := *NUMBER GOES HERE*
This cause syntax error of Identifier expected. GetPlayerStat go return deaths and flags caps of player, can't change them.
Compare GetPlayerStat(ID,'Kills') with SetScore(ID, kills).
http://enesce.com/help/html/Functions/SetScore.html (http://enesce.com/help/html/Functions/SetScore.html)
Title: Re: Script Core Suggestions
Post by: miketh2005 on September 15, 2009, 07:39:25 pm
Resolution is kind off useless, isnt it?
No! For example, a script of rpg with a skill of flash. I use a big drawtext for cover the display of players. This go work with players of low resolution.
But for players with hight resolution. Go cover only a small area of screen.
I could set the correct size of drawtext using the player resolution.

GetPlayerStat(ID,'Deaths') := *NUMBER GOES HERE*

For setting how much caps would the player have? I think it is possible via GetPlayerStat(ID,'Flags') := *NUMBER GOES HERE*
This cause syntax error of Identifier expected. GetPlayerStat go return deaths and flags caps of player, can't change them.
Compare GetPlayerStat(ID,'Kills') with SetScore(ID, kills).
http://enesce.com/help/html/Functions/SetScore.html (http://enesce.com/help/html/Functions/SetScore.html)

Can't you just make a bigger flash that will cover all res types?
Title: Re: Script Core Suggestions
Post by: Serial K!ller on September 16, 2009, 12:17:44 am
I have a script where I want to align (Draw)text to the weapons in the weapon selection menu but for that to work on custom resolution I would have to know the resolution so I can scale the text down.
Title: Re: Script Core Suggestions
Post by: miketh2005 on September 16, 2009, 02:51:54 am
I have a script where I want to align (Draw)text to the weapons in the weapon selection menu but for that to work on custom resolution I would have to know the resolution so I can scale the text down.

I see... well you can always make it so the person can customize his screen res.

We need to know your screen resolution for this script to work!
1. *RES TYPES HERE*
2. *RES TYPES HERE*
3. *RES TYPES HERE*
etc.
Type /res *number* to set your resolution!

Good idea, eh? I'm a genius :D
Title: Re: Script Core Suggestions
Post by: Serial K!ller on September 16, 2009, 12:12:04 pm
I already made a /scale command that loops trough all text scale to match the possible custom resolutions :p
But if it worked automaticly it would be much easier.
Title: Re: Script Core Suggestions
Post by: miketh2005 on September 16, 2009, 12:35:31 pm
Aw! Your a better genius than me :D How the hell did you do that???? I the code public?
Title: Re: Script Core Suggestions
Post by: Snowy on November 04, 2009, 06:22:56 pm
I'm in the middle of writing a new zombie script and I've came across a few things that are missing that would make the job a lot easier (and make the result ultimately better). Some may already exist, but I havn't seen them where I've been looking (http://enesce.com/help/)

function WriteINI(FileName,Section,Key,Value: string) - inis are just better

function OnPlayerShoot(Shooter: Byte;Bullettype: Integer) : integer - called a lot so unless you want the server to lag itself to death you would have to script it sparingly.

function OnBulletKill(Shooter: Byte;Victim: Byte;Bullettype: Integer) : integer - called a lot like the one above so same deal. The Victim would store who the bullet hit, 0 if it hit the ground and perhaps -1 if it expired by time. Would be useful to make exploding rounds and flash grenades, etc.

procedure OnTick(Ticksfromsecond: byte) - call this procedure every tick storing the difference (in ticks) between it and when apponidle is called ie if you wanted to do something three times a second, you would check if ticksfromsecond = 20, 40 or 60.

procedure MovePlayer(ID: Byte; X, Y: Single, MoveBots: Boolean); - moving bots can be useful, and I figure if they are gonna get scared and not know where they're going, so be it. And if its that concerning, make them take instructions from the closest waypoint to where they are moved to, or make it the one they are trying to get to, whatever's easiest.

procedure SetSpeed(ID: Byte; Xspeed, Yspeed: double); - probs needs a bit of a recode to Soldat itself to get this to work, but it definately has its uses (I've encountered two places in the script I'm working on that would definately benefit from this)

GetPlayerStat(ID; 'MouseX') / GetPlayerStat(ID; 'MouseY') - get the position of the players mouse  (or the angle that the player is aiming, whichever the server already knows)

procedure OnObjectGrab(ID, ObjectID: byte;GrabbedInBase: boolean) - same as flag grab but for any object

procedure OnObjectShoot(Shooter, ObjectID: byte;) - would need to make shooting object possible in online play first I guess, but it would be useful for making explosive barrels and the like

function SpawnCustomObject(X,Y:Single; Imagedir: String; ObjType: Byte; Grabable: Boolean): integer; - spawn an object with a custom image on it and give it its own object type, would need the onobjectgrab procedure to have any real use. would also need an update to soldat itself for both the creating of the object and the downloading of the images used. On that note I figure you should be able to set a custom image for the grenades being used both as they appear in the gui and as they are thrown so you can make boxes of molotovs and flash bangs, etc...the ability the make custom bullettypes for any weapon and even custom weapons would be a great addition imo...just replace the files that contain the default ones when entering a server and replace then with the originals when leaving.

Thats all the ones I can remember this second. And when can we expect the playsound function to be implemented?
Title: Re: Script Core Suggestions
Post by: SpiltCoffee on November 04, 2009, 06:41:18 pm
OnPlayerShoot, OnBulletKill and OnTick will be called too often, Snowy, so it's highly, highly unlikely EnEsCe will consider those three suggestions.
Title: Re: Script Core Suggestions
Post by: Snowy on November 04, 2009, 09:00:26 pm
Yeah but its not just about how often its called...whats you do with it also counts. If scripters only use it in ways like I suggested they won't impact on performance too much. You could lag up your server if you put enough stuff happening in the apponidle procedure...the more often something is called the more careful you have to be to not overdo it.

Edit: another thing...imo m79/law/flame arrow bullets shouldn't add an extra 4000 or whatever damage onto a direct hit...when it comes to scripting, you don't always want to get an instant kill no matter what. you can sort of script around it, but that just makes it unnecessarily difficult.
Title: Re: Script Core Suggestions
Post by: SpiltCoffee on November 04, 2009, 11:44:34 pm
EnEsCe is trying to prevent people from overdoing it in the first place. He doesn't want people writing scripts that call a lot of events really often, because the ScriptCore isn't designed for that heavy kind of use.
Title: Re: Script Core Suggestions
Post by: Snowy on November 05, 2009, 12:19:32 am
imo he should worry less about stopping poorly scripted scripts from blowing up people's computers and more about increasing the potential of scripts in general...but that's just imo
Title: Re: Script Core Suggestions
Post by: croat1gamer on November 05, 2009, 12:56:45 am
He explained it really nice:

Quote
croat1gamer says:
Why dont you want to add such an option to the scriptcore, but simply make it “USE AT OWN RISK”
Its not like that scripters dont know what to do with it, what can it cause, and what to do to prevent server slowing down.

EnEsCe says:
Because you know everybody will use it, and it will become an extreme nuisance to hosts that run many servers such as myself. And then there is the slew of access violations it causes.
You see, if everyone starts using it, they will use it on paid servers, and it will be obviously a nuisance as it will slow down the whole computer, including the other servers.

I still didnt got an answer to this:
Quote
What about making 2 versions of soldatserver?
One which will be the “safe mode”, which will internally have the faster appondile disabled, which will be given to the server hosters, but if they want, they can use the not “safe mode” one, which will be the real soldatserver, with everything enabled.
It sounds perfectly fine to me, as its like the ReadLnSocket, it needs Safe Mode turned off to work. And to do it the players just need to do -safe 0 to disable Safe Mode, but in my suggestion, there wont be the option of disabling it, but they need to use the server version which is having it disabled already.
Title: Re: Script Core Suggestions
Post by: Snowy on November 05, 2009, 01:44:15 am
That second quote was exactly what I was going to say before I got to the part where you said it already :D There needn't necessarily be two completely different versions of the server, just a command line argument or whatchacallit when starting it that determines whether the procedure is used or not (not by default I suppose), so that way if its used by hosters there isn't any way for someone to enable it and there isn't any need for a second server version.

random question: is it possible to have a 'dummy' bot in a dedicated server? I've tried removing every stat and I can get the bot to be invisible of all things but I can't get it to stay still.
Title: Re: Script Core Suggestions
Post by: iDante on November 05, 2009, 02:04:24 am
Just name it Dummy.

Wasn't this thread supposed to be about ideas and not discussions?
Anyway possibly in the main post add a DO NOT SUGGEST: faster apponidle, onweaponfire. Might make things nicer as there've been plenty of those suggestions throughout this thread.
Title: Re: Script Core Suggestions
Post by: EnEsCe on November 05, 2009, 04:29:33 am
Sorry guys but I have stopped monitoring this thread as of two months ago. Due to you all constantly disregarding the bold text in my first post, and since I can't manually keep it clean anymore. If you have a suggestion, you'll have to present it to me in another form.
Title: Re: Script Core Suggestions
Post by: KEEN on February 01, 2010, 08:24:51 am
hi! I was reading some posts related with scripts... I've a proposition for include if it looks good...

I was thinking OnDataArrival enable an event with StopHere and Resume functions to take better control of what arrives at the server from the client, something like this:

procedure OnDataArrival(ID: Byte, Type,Data: String)

Parameter Info:
ID (Byte): Player ID.
Type (String): RequestGame, JoinGame, JoinTeam, LeaveGame... etc... (player related functions, for example)
Data (String): Incoming data properly.

Description:
This procedure will intercept data coming from clients

Example:
Code: [Select]
procedure OnDataArrival(ID: Byte, Type,Data: String)
begin
if (Type = 'PlayerSpeak') then // recognize the type of data
begin
if (Data = 'spam') then         // set what we want to intercept
begin
Command('/gmute ' + ID); // action accordingly
StopHere         // important, stops running the following event: OnPlayerSpeak()
else Resume // if it arrives is not what we want to intercept, continues with the next event: OnPlayerSpeak()
end;
end;
end;

surely miss a lot of information, but it's just an idea...
cya!
Title: Re: Script Core Suggestions
Post by: mich1103 on February 21, 2010, 07:23:31 pm
make a /unbanlast willunban last banned guys :P
Title: Re: Script Core Suggestions
Post by: Hacktank on February 21, 2010, 07:42:56 pm
That has nothing to do with scripting and there is an unbanlast command that does just that.
Title: Re: Script Core Suggestions
Post by: As de Espada on November 05, 2011, 12:31:13 pm
Possibility to read binary files correctly. I am currently working with some files that are not a txt and they won't read to the end (probably becaues they have an end string token inside it or anything)
Title: Re: Script Core Suggestions
Post by: squiddy on October 28, 2012, 03:22:02 pm
Well, this topic seems a bit dead..

Anyhow, I'd like to make my suggestion: WorldText again. PLEASE! Being limited to only one text in the screen (hence DrawText) is very frustrating..
Title: Re: Script Core Suggestions
Post by: Falcon` on October 29, 2012, 04:11:34 am
draw text layers has already been implemented. What comes to world/interface text you should not expect them anytime soon as they both seem to require netcode changes which i'd rather not touch... yet.
Title: Re: Script Core Suggestions
Post by: squiddy on October 29, 2012, 04:56:09 am
Well, those are good news, though. If we have layers in DrawText, then it is almost the same as WorldText (except from the location of the text, obviously). That is great! =D
Title: Re: Script Core Suggestions
Post by: Mercury92 on October 29, 2012, 11:12:41 am
draw text layers has already been implemented. What comes to world/interface text you should not expect them anytime soon as they both seem to require netcode changes which i'd rather not touch... yet.

Where may I find updated docs/wiki for ScriptCore including Next Soldat update.
Title: Re: Script Core Suggestions
Post by: DarkCrusade on May 19, 2013, 06:37:09 am
Something to be changed:

Code: (pascal) [Select]
procedure dec(var X: integer; N: integer);
procedure inc (var X: integer; N: integer);

It would be great if this could be used for bytes as well, and maybe even singles. That way, a lot of unnecessary code could be prevented.

Code: (pascal) [Select]
From: player[i].mine[ii].tleft:=player[i].mine[ii].tleft-1;
To: dec(player[i].mine[ii].tleft,1);

It looks much better, is readable with ease, and requires less code in moments where you want to use a byte and not an integer.
Title: Re: Script Core Suggestions
Post by: Shoozza on May 19, 2013, 10:48:02 am
Let's keep it compatible to the normal Delphi/Object Pascal implementation (so no floating point inc/dec):
http://www.delphibasics.co.uk/RTL.asp?Name=Inc

Quote from: delphibasics.co.uk
You can increment :
 
Characters    
Non-floating number types    
Enumeration types    
Pointers

I think you can drop the ",1" just do Dec(varname); or Inc(varname);
Title: Re: Script Core Suggestions
Post by: squiddy on May 19, 2013, 05:07:47 pm
Do a _dec(input: variant), and you should be fine to go. :p
Title: Re: Script Core Suggestions
Post by: DarkCrusade on May 22, 2013, 02:08:05 am
More suggestions to the scriptcore:

Code: (pascal) [Select]
procedure servermodifier(name:string; id:byte; value:variant);
servermodifier('gravity',3,0.03); // Only player 3 is affected.
servermodifier('gravity',255,0.03); // The entire server is affected.

It certainly has been suggested before, but this would be so great..

Code: (pascal) [Select]
procedure changeweaponstats(id,weaponid:byte; dmg,interval,ammo,reload,style,startup,bink,movacc,recoil:integer);
// ID = 255 changes the weapon for everyone.

A feature like this would open new ways for scripting to affect gameplay. There could be servers with one weapon setting for every team, new possibilities for RPGs and so much more!

Code: (pascal) [Select]
procedure writeini(filename,section,key:string; value:variant);

I really miss this feature.
Title: Re: Script Core Suggestions
Post by: Falcon` on May 22, 2013, 05:26:34 am
Two last are on the way... more or less. I hope i'll finish it before the next devlolg.
First one requires netcode change, so i think maybe in next release. I actually miss that too, but this is a very complex case, because you need not only handle the player himself, but also his bullets, grenades, deicde what gravity to apply to his weapon after he dies and so on.
Title: Re: Script Core Suggestions
Post by: DarkCrusade on May 22, 2013, 08:11:44 am
A couple more suggestions:

Code: (pascal) [Select]
function weaponnumbyname(name:string):byte;
a:=weaponnumbyname('Steyr AUG'); // a = 4;

'onplayerkill' gives me a string, but only numbers matter when you use arrays for weapon stats for example.

Code: (pascal) [Select]
procedure movebot(id:byte; x,y:single);
I want to be able to move bots around the map. It's already possible, I know that. But it's a real pain to go through this much code and have these 'kicked bot xyz' and 'added bot xyz' messages flood the server just to move a bot from one place to another. Please save us the time and energy [pigtail]

Code: (pascal) [Select]
a:=function addbot(id:byte; x,y:single):byte; // a = bot's ID
Similiar to the above suggestion, it'd be a nice feature that I would not want to miss once implemented. If you consider addming movebot() to the scriptscore, then forget about this suggestion. Of course, if you were to add both, who am I to stop you? :) It definetly has its uses.

Edit: Oh, and it would be awesome if you could work on Soldatserver. For example, it would be nice if there was a full list of bugs displayed in the logs, or a plugin for Notepad++ including Soldat's scriptcore.

Edit2: It would also be really awesome if we could use 'getplayerstat(id,'active')' without '=true'.. :|
Title: Re: Script Core Suggestions
Post by: SyavX on May 22, 2013, 08:12:31 am
Since there already are IDToIP / IPToID and IDToName / NameToID functions you could add:
Code: [Select]
function IDToHWID(ID: integer): string
function HWIDToID(HWID: string): string;

function NameToHWID(Name: string): string;
function HWIDToName(HWID: string): string;

function IPToHWID(Name: string): string;
function HWIDToIP(HWID: string): string;
Title: Re: Script Core Suggestions
Post by: Falcon` on May 22, 2013, 02:29:54 pm
Code: [Select]
Script.AddFunction(@NameToHW, 'function NameToHW(A: string): string');
Script.AddFunction(@IDToHW, 'function IDToHW(Id: Byte): string');

I don't know who added these, certainly not me, so i guess they're there for some time already.
Title: Re: Script Core Suggestions
Post by: JotEmI on May 22, 2013, 07:49:26 pm
... or a plugin for Notepad++ including Soldat's scriptcore.

http://forums.soldat.pl/index.php?topic=40110.msg492742#msg492742
Here you have my auto-completion file for Notepad++. It's for the ScriptCore v2.6.5 but I plan to update it once the new version is out.
Title: Re: Script Core Suggestions
Post by: DarkCrusade on May 26, 2013, 10:16:34 am
@JotEmI: Thanks for the link. :)

@Falcon: How about..

Code: (pascal) [Select]
procedure createFolder(name:string);
function folderExists(name:string):boolean;
Title: Re: Script Core Suggestions
Post by: Falcon` on May 26, 2013, 10:29:41 am
you can use FileExists as folder is in fact a special type of file. At least under linux, but i take a wild guess it'll work under windows as well.
Title: Re: Script Core Suggestions
Post by: DarkCrusade on May 31, 2013, 03:03:15 pm
Good tip. When I tried it using the below code, it returned a 'false' statement.

Code: (pascal) [Select]
procedure activateserver();
begin
 if (fileexists('maps/')) or (fileexists('maps\')) then writeln('  * EXISTS') else writeln('  * DOES NOT EXIST');
end;

An addition to my earlier post are:

Code: (pascal) [Select]
procedure deleteFile(name:string);
procedure moveFile(name,newdir:string);

EDIT: Change "procedure onjointeam(id,team:byte);" to "function onjointeam(id,team:byte):boolean; true = allowed; false = stays in his team"

Code: [Select]
procedure onjointeam(id,team:byte); -> function onjointeam(id,team:byte:boolean;
onjointeam() = true = allowed to join the team

Code: [Select]
global var highestID -> holds the highest present ID on the server.
Title: Re: Script Core Suggestions
Post by: Falcon` on May 31, 2013, 06:18:47 pm
both move and delete are implemented.
OnJoinTeam, i'll think about it.
HighestID is.. *cough* not implemented anywhere in server's code. All loops are from 1 to 32..
Can you please wait with your suggestions until rc2 is released? There are a lot of changes in that version.

For your code above, try FileExists('maps')
Title: Re: Script Core Suggestions
Post by: DorkeyDear on June 02, 2013, 08:20:18 am
Regarding OnJoinTeam event returning a boolean, it may be better to have false mean allowed, and true mean stay in team. This way false is the default behaviour; there will be a less change of a scripter accidentally forgetting to set the result to true. Similarly, OnCommand result as false means to accept the command, the default behaviour, whereas true would mean to deny the command.

I think (although not 100% certain) FileExists only works with files, and not directories.
Title: Re: Script Core Suggestions
Post by: Moroes on June 02, 2013, 09:08:58 am
Is the OnFlagDrop already implemented?
Thanks :)
Title: Re: Script Core Suggestions
Post by: dominikkk26 on June 19, 2013, 01:08:55 pm
procedure OnTeamWin(ID: byte; Team: integer);
procedure OnTeamLose(ID: byte; Team: integer);

If a player is in the team, for example, bravo - this team which is lose or win this procedure is called.
Please to be invoked immediately before the map.

Title: Re: Script Core Suggestions
Post by: Falcon` on June 19, 2013, 02:14:07 pm
there's OnGameEnd already(). You can check who won by comparing team's score with max score.
Title: Re: Script Core Suggestions
Post by: dominikkk26 on June 20, 2013, 02:09:51 pm
I understand you. However, the new features are designed to also facilitate our work.
Title: Re: Script Core Suggestions
Post by: Falcon` on June 20, 2013, 04:51:08 pm
Please learn english instead of using google translate because i cannot understand you.
Title: Re: Script Core Suggestions
Post by: DarkCrusade on June 20, 2013, 11:44:57 pm
He explained that he wanted this suggestion, for it would make scripting easier on the part of the coders in the community. It still makes no sense, but that's what he / she / it said.
Title: Re: Script Core Suggestions
Post by: Bonecrusher on June 21, 2013, 09:32:30 am
Please learn english instead of using google translate because i cannot understand you.

Translate it back to polish on translate.google.pl and it makes perfect sense.
Title: Re: Script Core Suggestions
Post by: DarkCrusade on June 21, 2013, 01:42:20 pm
Something that confused me:

Code: [Select]
function getplayerstat(id,'muted'):byte // Change result to boolean
Code: [Select]
function getplayerIDs():array of byte;
var i:byte; len:integer;
begin
 for i := 1 to 32 do if getplayerstat(i,'active') = true then begin
  inc(len,1);
  setarraylength(result,len);
  result[len-1] := i;
 end;
end;

This one has probably been suggested before, but I want this badly:

Code: [Select]
procedure onUnitCollision(id1,id2:byte);
Title: Re: Script Core Suggestions
Post by: JotEmI on June 21, 2013, 02:05:54 pm
I think this has been already suggested (probably even by me) but still...
I'd like to see a new stat added for GetObjectStat() - owner's ID.

StatResultType
OwnerID of a player who created the object (like thrown knife, dropped weapon, etc) or 255 for flags, kits, etc.Byte
Title: Re: Script Core Suggestions
Post by: Falcon` on June 21, 2013, 02:55:02 pm
I think i've mentioned somewhere that i'll be making no more changes to SC2 API.

This one has probably been suggested before, but I want this badly:

Code: [Select]
procedure onUnitCollision(id1,id2:byte);

And that'd be called when?
Title: Re: Script Core Suggestions
Post by: DarkCrusade on June 21, 2013, 03:43:52 pm
Whenever a soldier walks / flies through another soldier, onUnitCollision gets called. I think that this event is useful, since normal scripting is not able to achieve an effect as precise as with an in-built event, and I can already see use of it in a lot of gamemodes such as zombie RPGs or tag modes.
Title: Re: Script Core Suggestions
Post by: dominikkk26 on June 22, 2013, 06:46:11 am
Modify:
Code: [Select]
procedure OnPlayerKill(Killer, Victim: byte;Weapon: byte; HeadShot: boolean);
Title: Re: Script Core Suggestions
Post by: dominikkk26 on June 23, 2013, 03:18:55 pm
Code: [Select]
Procedure OnRoundEnd (ID: byte; zespołu: integer);
Title: Re: Script Core Suggestions
Post by: Falcon` on June 23, 2013, 04:24:29 pm
there's OnGameEnd already(). You can check who won by comparing team's score with max score.
Isn't it the same?
Title: Re: Script Core Suggestions
Post by: dominikkk26 on June 24, 2013, 01:49:41 am
I surwival mode to each round, and may be as many as 100 Further portions to write code?
Besides, think how many new opportunities will introduce a procedure call when the round is over.
Title: Re: Script Core Suggestions
Post by: Mighty on July 23, 2013, 08:25:28 am
Please allow us to change TimeLeft. I think climbers would be greatful
Title: Re: Script Core Suggestions
Post by: Falcon` on July 23, 2013, 08:28:03 am
You can always set it to 0, aka infinite.
Title: Re: Script Core Suggestions
Post by: squiddy on July 23, 2013, 02:04:01 pm
I think he meant something else. Example: time is running out, player needs more time to capture flags. He calls a vote and 5 minutes are added to the current time (via inc(timeleft,5) or w/e).

At least that's how I would use such a feature.

Edit: as long as I'm already here, OnFlagDrop(ID, TeamFlag: byte)
More a reminder than a suggestion :p.
Title: Re: Script Core Suggestions
Post by: Mighty on August 09, 2013, 02:58:06 am
Now we do have to do some memory management now with Script Core 3 (e.g. TNewMapObject (http://devs.soldat.pl/index.php/TNewMapObject) or TNewPlayer (http://devs.soldat.pl/index.php/TNewPlayer), but also TStringList).
However, SC3 doesn't provide any elegant features to free the memory when recompiling. At the moment you have to check whether "/recompile" command has been used and free everything then.

So the suggestion would be:
1. Garbage collector on recompile (very long term)
2. OnBeforeRecompile event or any other form of Finalization block (http://www.freepascal.org/docs-html/ref/refse92.html) equivalent.

Already mentioned it when talking with Falcon, posting here not to forget.
Title: Re: Script Core Suggestions
Post by: DarkCrusade on August 09, 2013, 12:38:48 pm
I don't see your problem..

Code: [Select]
function oncommand(id:byte; text:string):boolean
begin
 if text = '/recompile' then freeAll();
 result := false;
end;
Title: Re: Script Core Suggestions
Post by: Mighty on August 09, 2013, 01:39:48 pm
not too elegant. that's my problem.
Title: Re: Script Core Suggestions
Post by: Falcon` on August 09, 2013, 06:13:13 pm
I'll think about it. For now you can simply have at least one unit, then you have finalization section.
Title: Re: Script Core Suggestions
Post by: DorkeyDear on August 17, 2013, 06:02:20 pm
It would be useful to have map boundry information (xmin, xmax, ymin, ymax); it is the 'edge of the map' where if you try to jump into it, you respawn. In SC3, I suggest something like TMap.XMin, TMap.XMax, TMap.YMin, TMap.YMax (all of type single), or something similar.
Title: Re: Script Core Suggestions
Post by: Falcon` on August 17, 2013, 07:07:34 pm
I'll add it when i get to extending map management (polygons, waypoints, scenery...)
Title: Re: Script Core Suggestions
Post by: DorkeyDear on August 19, 2013, 04:45:52 pm
Events for the game becoming paused or unpaused; something like OnPause, OnResume/OnUnpause or similar.

For reference, a possible workaround/alternative is to check if the game is paused or not on the event OnClockTick/AppOnIdle, and if it changes state, call the appropriate event, with the disadvantage of the event being called with a delay. Another option is to check OnPlayerCommand, with the disadvantage of not covering cases when a script pauses/unpauses the game.
Title: Re: Script Core Suggestions
Post by: DarkCrusade on August 22, 2013, 03:56:36 am
It would be awesome if OnPlayerSpeak had two boolean for hiding or not hiding a message if certain conditions are met. The first one would be for showing messages in the chat, and the other one for showing messages above a player's head.

We could hide team chat or messages that are not meant for the public. That guy who just typed '/login' into normal chat? No problem. That stupid flaming bitch? No problem. Hide team chat from the opposing team? We got a cure for that.

I think it would be great to have, and with SC3, I see no problem here. :)
Title: Re: Script Core Suggestions
Post by: Falcon` on August 22, 2013, 04:07:50 am
It has already been suggested a few times, in a simpler form though (only one boolean as function's result). I won't add it anytime soon because it requires altering the netcode which i'm not intending to touch untill i'm finished with implementing/finishing/fixing features already on my TODO list.
Title: Re: Script Core Suggestions
Post by: kicikici on September 25, 2013, 07:02:03 am
I suggest add to OnVoteKick and OnVoteMap event boolean value which could recognize if player pressed f11 or f12 (for example return false on f11 and true on f12).
Title: Re: Script Core Suggestions
Post by: Falcon` on September 25, 2013, 12:00:12 pm
Both OnVoteMap and OnVoteKick are called only when player votes Yes (F12). If one votes No, afair the vote isn't even sent over the network. I see no reason to change that behavior, voting nothing seems equal to me as voting No.
Title: Re: Script Core Suggestions
Post by: kicikici on September 25, 2013, 04:05:56 pm
OK, i understood.
So description for this events should be fixed because now there is written: "Event property called when a player hits F11 or F12 during a kick vote/a map vote."
Title: Re: Script Core Suggestions
Post by: Falcon` on September 25, 2013, 05:18:28 pm
Fixed. Thanks for pointing it out.
Title: Re: Script Core Suggestions
Post by: kicikici on April 10, 2014, 03:47:16 pm
[dream_zone]
GetMouseXY(ID: byte; var X, Y: single);
[/dream_zone]
Title: Re: Script Core Suggestions
Post by: Falcon` on April 10, 2014, 04:21:07 pm
Not possible, server never recieves such info. The best info i can give you is aim angle.
Title: Re: Script Core Suggestions
Post by: dominikkk26 on April 10, 2014, 04:42:47 pm
And one could create a script aimbot core. Because if one could so it certainly setxymouse :)
Title: Re: Script Core Suggestions
Post by: Falcon` on April 10, 2014, 05:04:17 pm
Writing aimbot in scriptcore is possible with current api. One is already implemented on last stand server (sentry gun uses "aimbot"). I've also seen something alike in miracle mode, not sure if in hexer too.
Title: Re: Script Core Suggestions
Post by: kicikici on April 10, 2014, 05:14:51 pm
Not possible, server never recieves such info. The best info i can give you is aim angle.

Thx for fast information, everything is clear now.
Title: Re: Script Core Suggestions
Post by: Mighty on April 12, 2014, 04:32:31 am
Just a reminder - we still need OnAdminCommand and OnTCPAdminCommand in SC3.
Title: Re: Script Core Suggestions
Post by: dominikkk26 on April 12, 2014, 06:48:02 am
Procedure SlowTime(ID: byte, value: integer);
Player get the effect of the slowdown, with a value of slowdown the specified.
---
or
---
Procedure SlowTime(value: integer);
Players will receive the effect of slowing down, with a value indicated.


---
I have an idea for a mod for it!
Title: Re: Script Core Suggestions
Post by: Falcon` on April 12, 2014, 07:26:08 am
You mean the bullet time? And how do you even imagine that to work?
Title: Re: Script Core Suggestions
Post by: dominikkk26 on April 12, 2014, 08:23:48 am
No so that for example, the player slows down the movement of his fall throw knife etc, despite the rest of the players continue to play normally. As regards the second proposal is cause similar effects only that everyone regardless of whether all players are in the view
Title: Re: Script Core Suggestions
Post by: kicikici on April 13, 2014, 04:02:11 am

Just a reminder - we still need OnAdminCommand and OnTCPAdminCommand in SC3.
Yes, since we got SC3 (almost 1 year ago) only a few critical bugfixes were made over this time.

And what about GetKeyPress(1, 'F12')?  I know that I can detect pressing button using OnVote[Map/Kick] event, but it's not enough for me (I don't want start any voting). Or maybe I should ask about OnVote(Player: TActivePlayer) event?
Title: Re: Script Core Suggestions
Post by: Falcon` on April 13, 2014, 04:34:24 am
I'm not sure where such feature could be useful
Title: Re: Script Core Suggestions
Post by: kicikici on April 13, 2014, 05:34:37 am
Of course for create votemap/votekick/voteban/votesomething scripts. It could help people replace built-in functions (which are horrible bugged now) his own stuff.
Title: Re: Script Core Suggestions
Post by: kicikici on April 16, 2014, 05:09:15 pm
procedure OnFlagReturn(ID, TeamFlag: byte) could be triggered with ID = 0 when flag dissapears automatically and returns to his original position.
Title: Re: Script Core Suggestions
Post by: dominikkk26 on April 17, 2014, 02:19:55 am
When onflagdrop start working?
Title: Re: Script Core Suggestions
Post by: skrX on April 17, 2014, 11:50:07 am
Code: [Select]
procedure ServerModifier(Name: String; Value:Variant);
I propose add more variables, maybe: acceleration or slowdown? currently only 'gravity' is available
Title: Re: Script Core Suggestions
Post by: Szaman on April 17, 2014, 01:04:56 pm
And - if I am right - you are not able to modify gravity:
- during gameplay
- per player

It would be awsome if those two above cases be available :)
Title: Re: Script Core Suggestions
Post by: Akinaro on April 17, 2014, 01:18:50 pm
you can change gravity during game, there are few script for that(or you mean any other gravity...)
Title: Re: Script Core Suggestions
Post by: Szaman on April 17, 2014, 01:20:40 pm
So this:
Code: [Select]
procedure ServerModifier(Name: String; Value:Variant);works in any moment of the game?

But there is still no way to change the grativy of the particular player.
Title: Re: Script Core Suggestions
Post by: Akinaro on April 17, 2014, 01:26:44 pm
I remember that I had modified version of this script: http://forums.soldat.pl/index.php?topic=38557.msg471774#msg471774

ServerModifier('Gravity', g * 0.0006);

it change gravity and ballistic of bullets. But as you said you can't change gravity of selected player....

And as kicikici said it would be good for having procedure OnFlagReturn, it would be good for setting points in some stats scripts for returning flag.
 
Title: Re: Script Core Suggestions
Post by: skrX on April 17, 2014, 01:52:23 pm
I suggested, which could can be add. I'm not asking for an explanation of the above procedure. A little understanding ;)
Title: Re: Script Core Suggestions
Post by: kicikici on May 07, 2014, 04:19:37 am
Small tweak:
TScriptMap.SetMap(NewMap: string); could automatically put into console WriteLn('Next map: '+NewMap);
Title: Re: Script Core Suggestions
Post by: ExHunter on September 28, 2014, 07:19:50 pm
Feel free to add more suggestions/requests. If I can add them, then I will add them.
Title: Re: Script Core Suggestions
Post by: DarkCrusade on September 29, 2014, 12:10:46 pm
Movebot(ID:Byte; X,Y:Single) and SpawnBot(Name:String; X,Y:Single) would be quite awesome, because it would save the usual routine of moving spawn points around. :)

Title: Re: Script Core Suggestions
Post by: ExHunter on September 29, 2014, 02:29:57 pm
Movebot(ID:Byte; X,Y:Single) and SpawnBot(Name:String; X,Y:Single) would be quite awesome, because it would save the usual routine of moving spawn points around. :)

Both is implemented in SC3, I assume.

http://wiki.soldat.pl/index.php/TActivePlayer.Move
http://wiki.soldat.pl/index.php/TPlayers.Add

well.. but not exactly on a location bound.
Title: Re: Script Core Suggestions
Post by: kicikici on October 07, 2014, 02:24:21 am
Player.IsDev }:->
Title: Re: Script Core Suggestions
Post by: Szaman on October 07, 2014, 03:30:43 am
Freezing player position would be nice (not only loop with setting position which causes player to convulse).
Title: Re: Script Core Suggestions
Post by: dodo001 on October 07, 2014, 07:53:11 am
Add:
InterfaceText
InterfaceImage

Of version 1.5.1e. Thanks!
Title: Re: Script Core Suggestions
Post by: Mighty on October 07, 2014, 10:55:29 am
Pls modify:
OnDamage(Shooter, Victim: TActivePlayer; Damage: Integer; Bullet: TActiveMapBullet): Integer;
to
OnDamage(Shooter, Victim: TActivePlayer; Damage: Integer; Bullet: TActiveMapBullet, HeadShot: Boolean): Integer;
Title: Re: Script Core Suggestions
Post by: Mighty on October 08, 2014, 01:43:11 am
TActivePlayer.IsProne.

At the moment we can tell if a player is holding prone key, but we can't determine in which state he is.
Title: Re: Script Core Suggestions
Post by: dodo001 on October 09, 2014, 12:04:52 pm
- Add: ReadKey instead of GetKeyPress.
- Add: the ability to download audio files for PlaySound();
- Modification: PlaySound(ID:byte; PositionPlay: bollean; x,y: single, Patch: string); Players download all the sounds that the server found during compilation, the first join on the server.
If PositionPlay true then sound plays in the indicated place else (false) each player hears anywhere - position x, y not subject.

The two features enable the creation of new advanced mods.
Title: Re: Script Core Suggestions
Post by: XsevenBeta on February 14, 2016, 02:44:03 am
- Add: ReadKey instead of GetKeyPress.
This will be a realy cool, if we can use more keys instead text command.
Title: Re: Script Core Suggestions
Post by: Falcon` on February 14, 2016, 09:44:28 am
There's a pitfall in this solution, you don't know where the player has set all his keys, so you might try to detect pressed shift for some power/item usage and for instance I have grenades there.

EDIT: In Last Stand, and TTW, to emulate that behavior we intercept /smoke, /takeoff, /victory and /tabac taunts which are by default bound to Alt + 1-4. In last stand we just write in help "use Alt + 1 to mark the place for an airstrike" and I don't think some people even realize that they are actually using taunts. And if they did change their taunt set, they mostly have enough brain to add ours.
Title: Re: Script Core Suggestions
Post by: XsevenBeta on February 15, 2016, 04:15:06 am
Then we need something like that:
Action01, Action02, Action03 ... Action 30

What we will use in script like:
if (GetKeyPress(i, 'Action01') = true)
Title: Re: Script Core Suggestions
Post by: Falcon` on February 15, 2016, 05:06:09 am
That's a lot of work, plus i'd only confuse new players.  Scriptcore is supposed to be an addition (more or less), not an integral part of Soldat.
Title: Re: Script Core Suggestions
Post by: Akinaro on February 15, 2016, 06:01:34 am
That's a lot of work, plus i'd only confuse new players.  Scriptcore is supposed to be an addition (more or less), not an integral part of Soldat.

"confuse new players"
"confuse new players"
"confuse new players"
"confuse new players"

Im repeating this over and over looking at any other game where you have sometimes 2-3 pages of controls.
Im looking at 10years old kids playing CoD and WoW  where you have menus filled with buttons and controls...
And I seriously think that either you think that soldat players are dumb idiots that barely manage to turn PC on and off, or magically 99% of players today that play any other game that have 3 buttons in menu use it without problem...

ALSO... if in 2016 you telling me that making additional 3 buttons its "lot of work"... Im speechless... the same way that Im speechless reading that setting 30 frames instead of 16 in explosion animaton need few months of planing and work...
Title: Re: Script Core Suggestions
Post by: Falcon` on February 15, 2016, 07:08:51 am
Please do not reply to this thread with comments, only with ideas, as it's asked of you in the first post. If you want to comment, either create a new thread or bother me in PM/on IRC. Thanks.
Title: Re: Script Core Suggestions
Post by: Mighty on September 05, 2016, 03:04:11 pm
I think we don't have any way of performing /unbanlast in ScriptCore3, would be nice

Edit: My bad, wiki wasn't unpdated and I missed the additions in changelogs