Official Soldat Forums

Server Talk => Scripting Discussions and Help => Topic started by: Swompie on April 13, 2010, 01:17:14 pm

Title: Scripting Suggestions
Post by: Swompie on April 13, 2010, 01:17:14 pm
Ok, I've decided to make this topic since eC doesn't watch the old Scripting Core Suggestions thread anymore...

Things you should check before you post a suggestion:


Implemented stuff through this topic



Suggestions

Title: Re: Scripting Suggestions
Post by: Gizd on April 13, 2010, 02:52:34 pm
  • procedure OnPlayerShoot(Shooter, Bulletstyle: byte);
  • procedure OnTick(Ticks: integer);
Those will not be implemented. OnShoot would be called too many times(imagine 32 players shooting minigun, instant crash), OnTick too I think.
Title: Re: Scripting Suggestions
Post by: Hacktank on April 13, 2010, 04:32:57 pm
function GetWaypointStat(ID: byte; Stat: string): Variant;
procedure SetWaypointStat(ID: byte; Stat: string;Value: Variant);

This would add another dimension to customizability (zombie RPG scripts for example :P)


function GetBotStat(ID: byte; Stat: string): Variant;
target: byte // current target id of aggression, 0 for idle
waypoint: byte // current waypoint bot is following
string: friend // the friend name
state: byte // bot state 0 = idle/following waypoints, 1 = attacking, 2 = attacking flagger, 3 = fleeing with flag, ect

procedure SetWaypointStat(ID: byte; Stat: string;Value: Variant);
all of the things above

More to come.
Title: Re: Scripting Suggestions
Post by: mich1103 on April 13, 2010, 04:40:33 pm
OnKnifeThrow
(If you dont want knife throwing in your server you KillObjects (kill the knife in air))
Title: Re: Scripting Suggestions
Post by: Hacktank on April 13, 2010, 05:33:50 pm
OnWeaponChange already does this.
Title: Re: Scripting Suggestions
Post by: Stuffy on April 14, 2010, 05:27:13 am
pow() or power() function, at the moment you have to do stupid loops.
Title: Re: Scripting Suggestions
Post by: Swompie on April 15, 2010, 01:03:59 pm
Updated :O

Yeah, I think alot of other math functions should be implemented too.

One question Hacktank, why would you want to modify the waypoints?
GetBotStat is actually something nice & new, I like it!



edit
What you guys think about bows back to all gamemodes?
Title: Re: Scripting Suggestions
Post by: Gizd on April 15, 2010, 02:07:56 pm
OnKnifeThrow
(If you dont want knife throwing in your server you KillObjects (kill the knife in air))
Flying knife is a bullet not object.

Oh, GetBulletStat(),KillBullet() etc :D
Title: Re: Scripting Suggestions
Post by: Swompie on April 15, 2010, 02:10:47 pm
Swompie slaps Gizd with a huge Scripting Manual (http://devs.soldat.pl/wiki/index.php?title=GetObjectStat)
Style #25..
Title: Re: Scripting Suggestions
Post by: dnmr on April 15, 2010, 02:13:40 pm
Swompie slaps Gizd with a huge Scripting Manual (http://devs.soldat.pl/wiki/index.php?title=GetObjectStat)
Style #25..
the knife is a bullet until it collides with something. Then it becomes an object (hence it can't deal damage any more and you can pick it up)

On a side note, this thread is turning into a mess of a discussion already <.< Not good
Title: Re: Scripting Suggestions
Post by: Gizd on April 15, 2010, 02:36:04 pm
Well, dnmr, what have you expected...
Title: Re: Scripting Suggestions
Post by: SpiltCoffee on April 16, 2010, 03:23:59 am
The thread might be messy, but Swompie is taking note of all the suggested additions to the ScriptCore, so it's all good.

I reckon, if you're gonna recommend SetPlayerStat have a vest value, also recommend that GetPlayerStat to have a vest value. :D
Title: Re: Scripting Suggestions
Post by: Gizd on April 16, 2010, 08:57:33 am
also recommend that GetPlayerStat to have a vest value. :D
It does -.-
Title: Re: Scripting Suggestions
Post by: SpiltCoffee on April 16, 2010, 09:03:43 am
http://enesce.com/help/html/Functions/GetPlayerStat.html

I don't see it. :/
Title: Re: Scripting Suggestions
Post by: Swompie on April 16, 2010, 09:04:21 am
Swompie slaps Gizd with a huge Scripting Manual (http://devs.soldat.pl/wiki/index.php?title=GetObjectStat)
Style #25..
the knife is a bullet until it collides with something. Then it becomes an object (hence it can't deal damage any more and you can pick it up)

On a side note, this thread is turning into a mess of a discussion already <.< Not good
I still can learn things..  :-X

Anyway, less discussing and more suggestions are appreciated.

Edit
This manual ftw. (http://devs.soldat.pl/wiki/index.php?title=GetPlayerStat)
Title: Re: Scripting Suggestions
Post by: DorkeyDear on April 16, 2010, 10:14:31 am
function ReadDataFile(Filename: string): string;
Same exact thing as ReadFile, except doesn't "quit" reading after that one character that makes it stop reading :P (I forget what exactly it is right now).
Title: Re: Scripting Suggestions
Post by: tk on April 16, 2010, 10:38:09 am
Quote
pow() or power() function, at the moment you have to do stupid loops.
http://forums.soldat.pl/index.php?topic=33387.0
Both scripted and built in functions have to do stupid loops.
Title: Re: Scripting Suggestions
Post by: Swompie on April 16, 2010, 11:15:45 am
But if it was implemented we hadn't to dig through all the scripts and then copy&paste it into our script. :P
Title: Re: Scripting Suggestions
Post by: Stuffy on April 16, 2010, 01:29:36 pm
tk, I love you!
Title: Re: Scripting Suggestions
Post by: Swompie on April 20, 2010, 11:31:59 am
Anyone else than me wants plain bullets spawned through CreateBullet() visible to anyone no matter which weapon he carries?
Title: Re: Scripting Suggestions
Post by: dnmr on April 20, 2010, 12:27:14 pm
Anyone else than me wants plain bullets spawned through CreateBullet() visible to anyone no matter which weapon he carries?
of course
Title: Re: Scripting Suggestions
Post by: DarkCrusade on May 01, 2010, 03:41:02 am
DoDamage should return the bulletstyle.
OnPlayerSpeak should return a boolean also to mute players/disable commands.
Title: Re: Scripting Suggestions
Post by: Gizd on May 01, 2010, 05:29:32 am
DoDamage should return the bulletstyle.
How would that be any useful?
Title: Re: Scripting Suggestions
Post by: DarkCrusade on May 01, 2010, 07:20:10 am
Imagine >.<

For example you wouldn't need to change the weapons.ini to change damage dealt by certain guns.
Or set the damage to 0 for certain conditions like a that makes you invincible to CERTAIN bullets.
So much stuff you could do ...
Title: Re: Scripting Suggestions
Post by: SpiltCoffee on May 01, 2010, 08:29:00 am
Do you mean OnPlayerDamage? Because DoDamage is a procedure, and even if it was a function, anything it returns (besides maybe how much of the player's health was lost?) would be useless.
Title: Re: Scripting Suggestions
Post by: DorkeyDear on May 01, 2010, 09:15:42 am
Edit my ReadDataFile suggestion please:
function ReadBinaryFile(const Filename: string): string;
Identical to ReadFile, except that it ignores the feature where it stops reading once it reaches the character 0x1A (26 dec).
http://forums.soldat.pl/index.php?topic=35628.0
http://forums.soldat.pl/index.php?topic=26661.msg428455#msg428455

I think everybody has been wishing for the OnPlayerSpeak event to no longer being threaded (reason why it cannot return a value), and to allow it to return a boolean, which action is very similar to OnCommand and OnPlayerCommand return values. That is, allowing or disallowing the message to be relayed to all the other clients. (This was in addition to DarkCrusade's comment)
http://forums.soldat.pl/index.php?topic=26661.msg327943#msg327943 - Also includes another idea: having the Text parameter of OnPlayerSpeak be reference variable, so it can be edited. This also requires OnPlayerSpeak to not be threaded.

Some topic on Soldat Forums mentioned:
function GetWaypointStat(const WId: byte; const Stat: string): variant;
procedure SetWaypointStat(const WId: byte; const Stat: string; const Value: variant);
But it can be understandable the reason why these would not be implemented. It would require sending waypoint data after players have already joined. Since you cannot manipulate the server (with scripting) so only certain players only see certain things (like bots following a waypoint), you cannot edit the waypoints; otherwise, there would be complications of what one player sees compared to another player sees a bot doing.
It would probably also take a lot of effort to edit the code such that certain bots can only follow certain waypoints, but that would be an interesting idea to see.
http://forums.soldat.pl/index.php?topic=26661.msg426548#msg426548
http://forums.soldat.pl/index.php?topic=22560.msg262527#msg262527

This (http://forums.soldat.pl/index.php?topic=22560) topic provides many other suggestions which could be added to the list, if you want.

This is more of a bug fix request, but I'll mention it anyways: INCLUDE pre-processor directive would be nice if it were working.
{$INCLUDE ./shared/binary.pas}
Title: Re: Scripting Suggestions
Post by: DarkCrusade on May 01, 2010, 09:49:08 am
Do you mean OnPlayerDamage? Because DoDamage is a procedure, and even if it was a function, anything it returns (besides maybe how much of the player's health was lost?) would be useless.

Sorry, yeah I was talking about OnPlayerDamage.
Title: Re: Scripting Suggestions
Post by: Swompie on May 01, 2010, 12:55:42 pm
Updated & heavily edited my first post, I like it much more now  :-*
Title: Re: Scripting Suggestions
Post by: LORD KILLA on May 15, 2010, 12:12:21 pm
This dies, :(
Title: Re: Scripting Suggestions
Post by: DarkCrusade on June 12, 2010, 12:57:08 pm
What about this:

Code: (pascal) [Select]
Function OnHit(ID,Bullet:Byte):Boolean;    // ID: Player being hit, Bullet: ID of the bullet
begin
  Result := false;                                  // set to true to cancel hit registration
end;

OnHit triggers whenever a player is hit by a bullet. The only thing it does is manipulating the hit registration. This way you are able to neglect the instant kill effect of M79 and LAW or not getting pushed by shotgun pellets. There would be new possibilities for RPG mods either (like some skill that turns you into dust, you get invisible and bullets just fly through you)

Code: (pascal) [Select]
Function OnPolygonTouch(ID,Type:Byte):Boolean;    // ID: Player who touches a polygon
begin                                                                // Type: Polygon type
  Result := false;                                                 // set to true if he shall fall through
end;

Allow different players different paths or special places (mainly for new subgame modes / RPGs)
Title: Re: Scripting Suggestions
Post by: Gizd on June 12, 2010, 01:10:26 pm
@up
  • There will be no procedure which triggers whenever a player shoots.
  • There will be no event which triggers each tick or millisecond.
Idk how would the OnPolyTouch be implemented but I guess it would trigger really really often.
Title: Re: Scripting Suggestions
Post by: DarkCrusade on June 12, 2010, 01:14:24 pm
OnHit wouldn't trigger whenever someone shoots. It'll trigger whenever a player is being hit :3
Title: Re: Scripting Suggestions
Post by: Gizd on June 13, 2010, 03:28:05 am
OnHit wouldn't trigger whenever someone shoots. It'll trigger whenever a player is being hit :3
That won't change frequency a lot.
Title: Re: Scripting Suggestions
Post by: Swompie on June 13, 2010, 04:12:49 am
OnHit wouldn't trigger whenever someone shoots. It'll trigger whenever a player is being hit :3
That won't change frequency a lot.
How 'bout OnPlayerDamage.
And still it wouldn't be possible to negate the insta-kill explosives, because it still had to be removed the hardcoded part..
Title: Re: Scripting Suggestions
Post by: Hacktank on June 13, 2010, 06:14:44 am
OnHit wouldn't trigger whenever someone shoots. It'll trigger whenever a player is being hit :3
That won't change frequency a lot.
How 'bout OnPlayerDamage.
And still it wouldn't be possible to negate the insta-kill explosives, because it still had to be removed the hardcoded part..

Ohh, but you can now. I figured out how!

When your hit with a law/m79 it automaticly setts your health to somewhere around -300 through -400. But you can completly negate this in onplayerdamage() by using result := -)getplayerstat(victim,'health') - DAMAGEYOUREALLYWANT). It works perfectly.
Title: Re: Scripting Suggestions
Post by: DarkCrusade on June 13, 2010, 06:21:03 am
Or you just set a bullets damage to -99999 and set the health back to the original value in OnPlayerDamage
Title: Re: Scripting Suggestions
Post by: Hacktank on June 13, 2010, 06:38:57 am
That is pretty much exactly what i just said. Also I am talking current release version w/o setplayerstat(). Which will fail unless it has: health, vest, primary/secondary ammo, nades, and jet.
Title: Re: Scripting Suggestions
Post by: DarkCrusade on June 13, 2010, 10:27:36 am
More:

Code: (pascal) [Select]
GetPlayerStat(ID,'Programmes'); // Returns the amount of programs running behind Soldat
GetPlayerStat(ID,'TimeConnected'); // Returns the time (in seconds) a player is connected

Makes things easier
Title: Re: Scripting Suggestions
Post by: dnmr on June 13, 2010, 02:35:34 pm
wtf is programmes.. why would you need it?
And you can calculate timeconnected with two lines of code <.<
Title: Re: Scripting Suggestions
Post by: DarkCrusade on June 13, 2010, 02:47:17 pm
First: Just some random idea that came up to me when I worked on AntiCheat :3
Second: Coders are lazy, man
Title: Re: Scripting Suggestions
Post by: dnmr on June 13, 2010, 02:57:48 pm
First: Just some random idea that came up to me when I worked on AntiCheat :3
...
Second: Coders are lazy, man
exactly why i think you shouldnt even bother asking for it to be implemented <.<
Title: Re: Scripting Suggestions
Post by: mich1103 on June 13, 2010, 05:55:34 pm
wtf is programmes.. why would you need it?
And you can calculate timeconnected with two lines of code <.<
Maybe to se if there is a hack on or something like that !
Title: Re: Scripting Suggestions
Post by: DarkCrusade on June 14, 2010, 07:54:39 am
What about this:

Code: (pascal) [Select]
GiveBonus(ID,0); // Ends all timed bonuses (berserker,predator,flamegod)
GiveBonus(ID,BonusID,Time); // Time = any integer value (in seconds)
Title: Re: Scripting Suggestions
Post by: Swompie on June 14, 2010, 07:58:43 am
Yeah, bring enesce to change some hardcoded stuff..
Title: Re: Scripting Suggestions
Post by: DarkCrusade on June 14, 2010, 10:33:29 am
What about some kind of scriptable GUI?

Code: (pascal) [Select]
Function CreateGUI(ID,Transparency:Byte; XPosition,YPosition,ScaleX,ScaleY:Single; Title:String; Colour:LongInt): Byte; // Returns the ID of the GUI, position and scale should be understandable
Function TextField(GUIID:Byte; XPosition,YPosition:Single; Title:String; Colour:LongInt): Byte; // Creates a textfield, the player is able to write something
Function CreateButton(GUIID:Byte; XPosition,YPosition,XScale,YScale:Single; Title:String; Colour:LongInt): Byte; // Creates a button, that players are able to press

Procedure OnPressButton(ID,ButtonID:Byte); // Triggers whenever a player hits a button
Procedure OnTextInput(ID:Byte; Input:String); // Triggers whenever a player uses a text field

Useful for account creation and some kind of ingame dictionary that helps people to get into subgamemodes and stuff. New vote options are available either and it should also be mentioned that this could be used for private chatting!
Title: Re: Scripting Suggestions
Post by: DorkeyDear on June 17, 2010, 07:56:51 pm
procedure CreateDirectory(const Path: string); or procedure CreateFolder(const Path: string);
procedure CreateFile(const Path: string);
I guess they could be combined. Note that CreateFile is already possible via WriteFileing an empty string.


From: June 17, 2010, 09:10:08 pm
function DirectoryExists(const Path: string): boolean;
similar to FileExists, except this works for directories (a.k.a. folders), and not files.
This can also be a used with one-another as a method to tell if a specific existing path is a directory or file, or does not exist.
Title: Re: Scripting Suggestions
Post by: DorkeyDear on June 21, 2010, 12:25:46 pm
function ReadAccess(const Path: string): boolean;
returns whether or not I have read access to the file

function WriteAccess(const Path: string): boolean;
returns whether or not I have write access to the file

function ExecuteAccess(const Path: string): boolean;
returns whether or not I have execution access to the file
this probably will rarely if ever be used, but could possibly be used with shellexec.

My main aggravation currently is how I have a directory that does not exist, I cannot even check if it exists or not (or even create it), and when writing in a non-existent directory in ActivateServer, it causes a map loading error (at least when starting the server).

It would probably be more appropriate to have the events OnActivateServer and OnActivateScript, but due to capability reasons, this probably will never happen. OnActivateServer guarantees nobody in the server when called and can be used for initializing databases (and occurring the checks if it already exists less frequently), while OnActivateScript (on compile / recompile) does not guarantee nobody on the sever, and this is equivalent to the currently known ActivateServer. I do not really expect this (and the word "On" is optional :P).
Title: Re: Scripting Suggestions
Post by: Swompie on June 21, 2010, 02:10:51 pm
Added ;)
Title: Re: Scripting Suggestions
Post by: Gizd on June 26, 2010, 08:32:47 am
procedure OnJoinTeam(ID, TeamA, TeamB: byte);
TeamA - team player was in before
TeamB - team player joined
Title: Re: Scripting Suggestions
Post by: Hacktank on June 27, 2010, 04:14:00 pm
^
|
If you do getplayerstat(ID,'team') in OnJoinTeam it will return the previous team.

procedure ForceWeapon(ID, Primary, Secondary, Ammoprimary,AmmoSecondary: Byte); ......
Title: Re: Scripting Suggestions
Post by: Gizd on June 28, 2010, 12:29:46 am
^
|
If you do getplayerstat(ID,'team') in OnJoinTeam it will return the previous team.
And if you do GetPlayerStat(ID,'Primary') in OnWeaponChange it will return new weapon.
Title: Re: Scripting Suggestions
Post by: As de Espada on June 28, 2010, 12:43:28 pm
some particle support would be good (like jets and sparks)
procedure createParticles(r;g;b; speed; direction; speedRange=0; directionRange=0, amount=1);
this way we don't need to use explosions to make a sign
Title: Re: Scripting Suggestions
Post by: Swompie on June 28, 2010, 01:43:48 pm
some particle support would be good (like jets and sparks)
procedure createParticles(r;g;b; speed; direction; speedRange=0; directionRange=0, amount=1);
this way we don't need to use explosions to make a sign
Haha, yeah that would be really funny and cool, may could be done with InterfaceText and InterfaceImage or how they are called, but such a function would make scripting much more exciting and servers cooler.

gonna update first post tommorow.
Title: Re: Scripting Suggestions
Post by: Norbo on June 28, 2010, 03:13:43 pm
I think particles would be too heavy for soldat, and cause alot of lag and other problems.
Title: Re: Scripting Suggestions
Post by: Neosano on June 28, 2010, 04:22:42 pm
I think particles would be too heavy for soldat, and cause alot of lag and other problems.
bullshit. Jets don't lag, so why would some particles lag?
Title: Re: Scripting Suggestions
Post by: Gizd on June 29, 2010, 12:25:31 am
would make scripting much more exciting
???
Title: Re: Scripting Suggestions
Post by: Norbo on June 29, 2010, 06:51:07 am
i think he means make the scripts more exciting, not the actual coding part :D
Title: Re: Scripting Suggestions
Post by: Falcon` on June 29, 2010, 07:29:29 am
Remove ItemID from Intefrace/WorldText/Image functions and BigText from DrawText, and make them return an ID of Text, what will allow scripter to place as much texts on screen as he needs. You may say "then you can spam/crash some server". Well, true but there's some reason why all scripts in soldatcentral are moderated, isn't there?
Title: Re: Scripting Suggestions
Post by: Swompie on June 29, 2010, 08:45:12 am
Tbh, I think we can live with just 3 layers for DrawText, even though a few more would be quite possible.
BUT: Instead of adding new stuff I really liked a more stable server than more features ;) (Yeah, anyone wants that \o/, don't we?)

I'm not sure how helpful the Image function will be in future, but when we will be able to use custom pictures (combined with UsePackage (http://enesce.com/help/html/Functions/UsePackage.html) procedure) it would be even more helpful and nice instead of having a set of images which can't be really used for alot of things.
Title: Re: Scripting Suggestions
Post by: DorkeyDear on July 05, 2010, 11:47:28 am
Having CrossFunc (or an equivalent function) throw exceptions not caught in the invoked function.
It is probably already possible via the use of the exception-related function, but it would require some extra code in every function that is expected to be CrossFunced.

function FuncIdtoName(const Id: cardinal): string;
function FuncNametoId(const Name: string): cardinal;
Any equivalent CrossFunc function(s) (including ThreadFunc) would be necessary if you want to CrossFunc using the id.
Although, I haven't actually tested if function identifiers are local to the script or not, but if they are, then the "equivalent CrossFunc" would have to be local to the script.
This may make CrossFuncing more efficient (but I'm not fully aware of the inner-workings of CrossFunc, so I really don't know).
The main reason to this is the ExceptionProc function/variable (haven't tested which it is) that is modified when an exception is thrown. This will make debugging a little easier.

For those who aren't aware, the exception-related functions:
Code: [Select]
procedure RaiseLastException;
procedure RaiseException(Ex: TIFException; Param: string);
function ExceptionType: TIFException;
function ExceptionParam: string;
function ExceptionProc: Cardinal;
function ExceptionPos: Cardinal;
function ExceptionToString(er: TIFException; Param: string): string;
Title: Re: Scripting Suggestions
Post by: DorkeyDear on July 09, 2010, 04:33:15 pm
GZip support. I'm not aware of the compressing and decompressing algorithms, but I'm sure they would be much faster if built into the Soldat Server rather than scripted.
Title: Re: Scripting Suggestions
Post by: Falcon` on July 11, 2010, 04:30:46 pm
Fix weapon parameter in OnPlayerDamage (2.7.X)

FFS, i was shooting from statgun and it was set to 4 (steyer)... Yes, i had steyer in hand. Is it linked to GetPlayerStat(Shooter, 'Primary') or what?
Title: Re: Scripting Suggestions
Post by: Swompie on July 12, 2010, 07:18:11 am
Statguns don't have their own weapon ID, not yet ;)
Title: Re: Scripting Suggestions
Post by: Falcon` on July 12, 2010, 07:42:27 am
then.. fix it :P It should have, shouldn't it?

Also some new raycast parameter that tells if it should fail on Player-Collide polygons  or not would be nice
Title: Re: Scripting Suggestions
Post by: DorkeyDear on July 14, 2010, 11:36:13 am
Having the OnGameEnd (http://enesce.com/help/index.html?Events/OnGameEnd.html) event return a string for the new map. This will allow custom map lists that are dynamic based on whatever the script would like.
function OnGameEnd(): string;
Title: Re: Scripting Suggestions
Post by: dnmr on July 14, 2010, 01:56:53 pm
Having the OnGameEnd (http://enesce.com/help/index.html?Events/OnGameEnd.html) event return a string for the new map. This will allow custom map lists that are dynamic based on whatever the script would like.
function OnGameEnd(): string;

dont you get enough info using onmapchange?
Title: Re: Scripting Suggestions
Post by: DarkCrusade on July 14, 2010, 01:59:38 pm
Procedure OnKeyPress(ID:Byte; Key:String);

Cool new options for scripting (admin commands, new player commands..).
Title: Re: Scripting Suggestions
Post by: croat1gamer on July 14, 2010, 02:24:42 pm
What would be if i hold a key?
Its same as OnFire and a faster AppOnIdle.
Title: Re: Scripting Suggestions
Post by: DarkCrusade on July 14, 2010, 02:32:05 pm
This is more accurate than AppOnIdle where the user needs to press the button the moment the procedure gets called. This means that a key press will be recognized once a second.

OnKeyPress will be called everytime a player presses a key. The script will not care about the duration, it'll be called only once. This means that a player can have more taunts than usual for example. The normal taunts for messages and the new ones for commands. Also this is very useful for RPG servers and those who claim to be one.
Title: Re: Scripting Suggestions
Post by: Swompie on July 15, 2010, 06:42:15 am
Still being called to often.
Title: Re: Scripting Suggestions
Post by: DarkCrusade on July 15, 2010, 07:02:50 am
You could just ignore the buttons that are already used by default.
Title: Re: Scripting Suggestions
Post by: Mighty on July 16, 2010, 08:47:42 am
the game would also have to know user's key settings, ignoring default wouldn't be enough
Title: Re: Scripting Suggestions
Post by: DarkCrusade on July 16, 2010, 09:40:25 am
Not a big deal..
Title: Re: Scripting Suggestions
Post by: zyxstand on July 16, 2010, 09:45:24 am
so all key presses should be sent to server? or only certain ones? which ones?
onkeypress would be called wayyy too often and easily spammable. maybe the following would be a better alternative:

My suggestion:

SetTaunt(ID:byte, taunt:string)

example:
Code: [Select]
procedure OnPlayerSpeak(ID: Byte; Text: string);
var MedTaunt, BomTaunt:string;
begin
  MedTaunt := ReadFile('taunts\MedicTaunt.txt');
  BomTaunt := ReadFile('taunts\BomberTaunt.txt');
  if (Text = '!medic') then
  begin
    SetTaunt(ID, MedTaunt);
    WriteConsole(ID, 'You are now a MEDIC.  Press Alt+W to heal teammate.', $A00000);
  end
  else if (Text = '!bomb') then
  begin
    SetTaunt(ID, BomTaunt);
    WriteConsole(ID, 'You are now a BOMBER.  Press Alt+W to place mine.', $A00000);
  end;
end;

Allow the server to edit individual players' in-game taunt layout.  This way, scripted game modes can simply say "press Alt + W to plant mine."
Of course, the client's taunt file would never be edited, and would be used if a server doesn't use custom taunt settings, so as to not affect regular game play.


Also:
Could you organize the suggestions so far into categories?
One called "filesystem" (for all file/directory-related suggestions), another for Events, one for Functions, and an "other" category.  Much appreciated!
Title: Re: Scripting Suggestions
Post by: mich1103 on July 16, 2010, 10:35:59 am
My suggestions !

ServerModifier('Temperature',Rain);

Example :
Code: [Select]
procedure AppOnIdle(Ticks: integer);
begin
 if timeleft = 180 then begin
  ServerModifier('Temperature',SandStorm);
 WriteConsole(0,'Incoming sand storm !',$EE81FAA1);
end;
 end;




I don't know if that will cause a problem with the map setting ...  :-\
Title: Re: Scripting Suggestions
Post by: DarkCrusade on July 16, 2010, 11:06:23 am
@zxy: Wouldn't it be acceptable, if the scripter himself decides which keys will call OnKeyPress? Like you had a variable in your const part:

Keys = 'T|Z|U|I|O';

OnKeyPress would only be triggered by T,Z,U,I and O.

@mich: Sounds like something so unnecessary that it wouldn't even be considered to be put on the TODO list. Yet I could need this for one of my projects ... 
Title: Re: Scripting Suggestions
Post by: mich1103 on July 16, 2010, 11:10:19 am
Yeah but it would be nice to have it !
i don't think it will be a problem for EnEsCe (He can make it easily i think  :P )
Title: Re: Scripting Suggestions
Post by: zyxstand on July 16, 2010, 11:36:48 am
@DarkC:
well i feel like what i'm suggesting is more ideal because it really doesn't require so much network code editing i feel.  i guess it can be placed in parallel to OnKeyPress - I'm sure E can decide better which would be better to work on.
I am also of the opinion that OnKeyPress should not be called for already-in-use keys (asdw qerfx) - too much event calling there....

@mich:
What do you mean by temperature? do you mean weather?
Your idea would allow for the map-format to remain unchanged, but probably does require a bit too much in-game map-code reworking... plus i turn these features off cuz my comp ain't the sharpest pencil in a geek's bag pack...
Title: Re: Scripting Suggestions
Post by: DarkCrusade on July 16, 2010, 11:57:39 am
Still it would be nice to have it, not only because ServerModifier can only modify the gravity yet. I'd totally use this feature, because I am working on a Pokemon script for Soldat [pigtail]

The command would be more like

Code: (pascal) [Select]
Procedure ServerModifier('Weather', Value:Byte);
'Weather': Name of the variable being modified.
Value: 0: no weather, 1: rain, 2: sandstorm, 3: snow
Title: Re: Scripting Suggestions
Post by: zyxstand on July 16, 2010, 12:07:24 pm
I am working on a Pokemon script for Soldat
: no weather, 1: rain, 2: sandstorm, 3: snow[/i]

...........oh dear........ let me in on the loop (PM me?). it sounds interesting, mainly cuz i can't imagine how it's going to go down.
Title: Re: Scripting Suggestions
Post by: Falcon` on July 23, 2010, 10:02:30 am
Fix GetPlayerStat(ID, 'Ammo').
God, it sometimes returns so fucking fake values....

Test it yourself, called somewhere at OnWeaponChage with bunch of ForceWeapons
Title: Re: Scripting Suggestions
Post by: DarkCrusade on July 23, 2010, 10:24:38 am
No problem with GetPlayerStat(). It's OnWeaponChange. For example if you access 'Primary' and the ID switched weapons it'll return SecondaryNum ;)
Title: Re: Scripting Suggestions
Post by: Falcon` on July 23, 2010, 10:36:05 am
I already noticed this. But it sometimes returned max ammo, while i had only half or so.
Title: Re: Scripting Suggestions
Post by: DorkeyDear on July 23, 2010, 02:09:54 pm
A scripting event (or some other method) to filter what is seen by admins or on the console itself (more specifically of interest to me, admin-port dump).
Title: Re: Scripting Suggestions
Post by: DarkCrusade on July 23, 2010, 02:29:14 pm
Function OnVoteKick(Voter,Target:Byte):Boolean;
begin
  Result := false;
end;

Voter: ID of the player who voted
Target: ID to be kicked
Result: Set to true to disallow the cast of the vote


Function OnVoteMap(ID:Byte; Map:String):Boolean;
begin
  Result := false;
end;

Voter: ID of the player who voted
Map: Mapname of the voted map
Result: Set to true to disallow the cast of the vote


Function OnVoteKickEnd(Voter,Target:Byte; Success:Boolean):Boolean;
begin
  Result := false;
end;

Voter: ID of the player who voted
Target: ID to be kicked
Success: Kicked=true
Result: Set to true to disallow the vote cast


Function OnVoteMapEnd(Voter:Byte; Map:String; Success:Boolean):Boolean;
begin
  Result := false;
end;

Voter: ID of the player who voted
Map: Map to be played
Success: Successful = true
Result: Set to true to disallow the vote cast

Quite obvious suggestion. We have scripted long enough without it..
Title: Re: Scripting Suggestions
Post by: frosty on July 25, 2010, 09:43:59 pm
Suggestion for GetPlayerStat:

is Visible? (boolean) (checks to see if the user is in pred mode or not)

just a suggestion, might make it a bit easier for other devs
Title: Re: Scripting Suggestions
Post by: DarkCrusade on July 26, 2010, 03:20:10 am
Maybe a bit more advanced:

Function GetPlayerStat(ID,'Mode'):Byte;

Result = 1: Normal
Result = 2: Berserker
Result = 3: Predator
Result = 4: Flamegod


Returns 1 if player is dead.
Title: Re: Scripting Suggestions
Post by: mich1103 on July 26, 2010, 10:46:37 am
Nice suggestion !  ;D
Aleady suggested but EnEsCe didn't read it ...  >:(
Function GetPlayerStat(ID,'Hair'):Byte;
1= Army
2= Punk
3= Mr.T style
4= Dreadlocks
5= Normal

Why should this be added ?
Because in rpg server player will be auto assigned classe if the player have a dreadlock hair :P

We could do the same thing with the hat,helmet or the skin :P


Title: Re: Scripting Suggestions
Post by: DarkCrusade on July 26, 2010, 11:27:35 am
Code: [Select]
Function GetGostekStat(ID,'Stat'):Variant;

Chain: Dogtags: Byte
Hat: Hatstyle: Byte
Hair1: Hairstyle: Byte
Hair2: Colour of the hair: Longint
Face: Colour of the face: Longint
Body: Colour of the body: Longint
Legs: Colour of the legs: Longint

Same added for SetPlayerStat() would be nice ;)
Title: Re: Scripting Suggestions
Post by: frosty on July 26, 2010, 12:59:31 pm
Nice suggestion !  ;D

Dark, nice ;D
Title: Re: Scripting Suggestions
Post by: Falcon` on November 27, 2010, 07:40:23 am
/me revives the dead topic

If soldat will be ever developed, please add something like "Dummy=true/false" to .bot files, so i don't have to name bot "Dummy" to make it not moving/shooting/interacting
Title: Re: Scripting Suggestions
Post by: dnmr on November 27, 2010, 07:53:55 am
/me revives the dead topic

If soldat will be ever developed, please add something like "Dummy=true/false" to .bot files, so i don't have to name bot "Dummy" to make it not moving/shooting/interacting
+1000 votes