Author Topic: Scripting Suggestions  (Read 12447 times)

0 Members and 1 Guest are viewing this topic.

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Scripting Suggestions
« 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:
  • Check if it has been suggested already.
  • Think about your suggestion twice before you post it.
  • If the proc./func. doesn't explain itself add an description of it.


Implemented stuff through this topic

  • Nothing.


Suggestions

  • function WriteINI(FileName, Section, Key: string): boolean;
  • function Power(Base, Exponent: double): double;
  • function GetBotStat(ID: byte; Stat: string): variant; [Click! for more info]
  • function ReadBinaryFile(const Filename: string): string; [Click! for more info]
  • Add Jet fuel, grenades, vest values to SetPlayerStat();
  • Allow to use all bulletstyles with CreateBullet();
  • Make OnPlayerSpeak(); return a boolean [Click! for more info]
  • Make plain bullets visible no matter which weapon players hold
  • procedure CreateDirectory/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.
  • 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.



    This stuff will never implemented

  • There will be no procedure which triggers whenever a player shoots.
  • There will be no event which triggers each tick or millisecond or too often in general.
  • There will be no function(s) which allow to get info or modify waypoints.
« Last Edit: June 21, 2010, 02:09:53 pm by Swompie »

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Scripting Suggestions
« Reply #1 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.

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Scripting Suggestions
« Reply #2 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.


Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Scripting Suggestions
« Reply #3 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))

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Scripting Suggestions
« Reply #4 on: April 13, 2010, 05:33:50 pm »
OnWeaponChange already does this.


Offline Stuffy

  • Soldier
  • **
  • Posts: 182
  • Very stuffy.
    • Climb-Zone Forum
Re: Scripting Suggestions
« Reply #5 on: April 14, 2010, 05:27:13 am »
pow() or power() function, at the moment you have to do stupid loops.
The truth is out there? Does anyone know the URL?
The URL is here

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Scripting Suggestions
« Reply #6 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?

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Scripting Suggestions
« Reply #7 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

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Scripting Suggestions
« Reply #8 on: April 15, 2010, 02:10:47 pm »

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: Scripting Suggestions
« Reply #9 on: April 15, 2010, 02:13:40 pm »
Swompie slaps Gizd with a huge Scripting Manual
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

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Scripting Suggestions
« Reply #10 on: April 15, 2010, 02:36:04 pm »
Well, dnmr, what have you expected...

Offline SpiltCoffee

  • Veteran
  • *****
  • Posts: 1579
  • Spilt, not Split!
    • SpiltCoffee's Site
Re: Scripting Suggestions
« Reply #11 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
When life hands you High Fructose Corn Syrup, Citric Acid, Ascorbic Acid, Maltodextrin, Sodium Acid Pyrophosphate,
Magnesium Oxide, Calcium Fumarate, Yellow 5, Tocopherol and Less Than 2% Natural Flavour... make Lemonade!

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Scripting Suggestions
« Reply #12 on: April 16, 2010, 08:57:33 am »
also recommend that GetPlayerStat to have a vest value. :D
It does -.-

Offline SpiltCoffee

  • Veteran
  • *****
  • Posts: 1579
  • Spilt, not Split!
    • SpiltCoffee's Site
Re: Scripting Suggestions
« Reply #13 on: April 16, 2010, 09:03:43 am »
« Last Edit: April 16, 2010, 10:55:53 pm by SpiltCoffee »
When life hands you High Fructose Corn Syrup, Citric Acid, Ascorbic Acid, Maltodextrin, Sodium Acid Pyrophosphate,
Magnesium Oxide, Calcium Fumarate, Yellow 5, Tocopherol and Less Than 2% Natural Flavour... make Lemonade!

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Scripting Suggestions
« Reply #14 on: April 16, 2010, 09:04:21 am »
Swompie slaps Gizd with a huge Scripting Manual
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.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Scripting Suggestions
« Reply #15 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).

Offline tk

  • Soldier
  • **
  • Posts: 235
Re: Scripting Suggestions
« Reply #16 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.
« Last Edit: April 16, 2010, 10:42:53 am by tk »

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Scripting Suggestions
« Reply #17 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

Offline Stuffy

  • Soldier
  • **
  • Posts: 182
  • Very stuffy.
    • Climb-Zone Forum
Re: Scripting Suggestions
« Reply #18 on: April 16, 2010, 01:29:36 pm »
tk, I love you!
The truth is out there? Does anyone know the URL?
The URL is here

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Scripting Suggestions
« Reply #19 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?

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: Scripting Suggestions
« Reply #20 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

DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #21 on: May 01, 2010, 03:41:02 am »
DoDamage should return the bulletstyle.
OnPlayerSpeak should return a boolean also to mute players/disable commands.

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Scripting Suggestions
« Reply #22 on: May 01, 2010, 05:29:32 am »
DoDamage should return the bulletstyle.
How would that be any useful?

DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #23 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 ...

Offline SpiltCoffee

  • Veteran
  • *****
  • Posts: 1579
  • Spilt, not Split!
    • SpiltCoffee's Site
Re: Scripting Suggestions
« Reply #24 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.
When life hands you High Fructose Corn Syrup, Citric Acid, Ascorbic Acid, Maltodextrin, Sodium Acid Pyrophosphate,
Magnesium Oxide, Calcium Fumarate, Yellow 5, Tocopherol and Less Than 2% Natural Flavour... make Lemonade!

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Scripting Suggestions
« Reply #25 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 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}
« Last Edit: May 01, 2010, 09:32:00 am by DorkeyDear »

DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #26 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.

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Scripting Suggestions
« Reply #27 on: May 01, 2010, 12:55:42 pm »
Updated & heavily edited my first post, I like it much more now  :-*

Offline LORD KILLA

  • Camper
  • ***
  • Posts: 254
  • Happie
Re: Scripting Suggestions
« Reply #28 on: May 15, 2010, 12:12:21 pm »
This dies, :(

DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #29 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)

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Scripting Suggestions
« Reply #30 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.

DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #31 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

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Scripting Suggestions
« Reply #32 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.

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Scripting Suggestions
« Reply #33 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..

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Scripting Suggestions
« Reply #34 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.


DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #35 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

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Scripting Suggestions
« Reply #36 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.


DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #37 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

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: Scripting Suggestions
« Reply #38 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 <.<

DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #39 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

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: Scripting Suggestions
« Reply #40 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 <.<

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Scripting Suggestions
« Reply #41 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 !

DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #42 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)

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Scripting Suggestions
« Reply #43 on: June 14, 2010, 07:58:43 am »
Yeah, bring enesce to change some hardcoded stuff..

DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #44 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!

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Scripting Suggestions
« Reply #45 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.
« Last Edit: June 17, 2010, 09:10:08 pm by DorkeyDear »

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Scripting Suggestions
« Reply #46 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).

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Scripting Suggestions
« Reply #47 on: June 21, 2010, 02:10:51 pm »
Added ;)

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Scripting Suggestions
« Reply #48 on: June 26, 2010, 08:32:47 am »
procedure OnJoinTeam(ID, TeamA, TeamB: byte);
TeamA - team player was in before
TeamB - team player joined

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Scripting Suggestions
« Reply #49 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); ......


Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Scripting Suggestions
« Reply #50 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.

Offline As de Espada

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1493
  • Mapper
    • My maps
Re: Scripting Suggestions
« Reply #51 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
All my maps | my latest map: SoldatX Racing Mappack
me making a map on youtube: ctf_FastMade

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Scripting Suggestions
« Reply #52 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.

Offline Norbo

  • Camper
  • ***
  • Posts: 338
Re: Scripting Suggestions
« Reply #53 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.

Offline Neosano

  • Camper
  • ***
  • Posts: 253
  • IIAWAK!
Re: Scripting Suggestions
« Reply #54 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?
KAWAAAAAAAIIIIIIIIII

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Scripting Suggestions
« Reply #55 on: June 29, 2010, 12:25:31 am »
would make scripting much more exciting
???

Offline Norbo

  • Camper
  • ***
  • Posts: 338
Re: Scripting Suggestions
« Reply #56 on: June 29, 2010, 06:51:07 am »
i think he means make the scripts more exciting, not the actual coding part :D

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Scripting Suggestions
« Reply #57 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?
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Scripting Suggestions
« Reply #58 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 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.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Scripting Suggestions
« Reply #59 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;

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Scripting Suggestions
« Reply #60 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.
« Last Edit: July 09, 2010, 04:44:35 pm by DorkeyDear »

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Scripting Suggestions
« Reply #61 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?
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Scripting Suggestions
« Reply #62 on: July 12, 2010, 07:18:11 am »
Statguns don't have their own weapon ID, not yet ;)

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Scripting Suggestions
« Reply #63 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
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Scripting Suggestions
« Reply #64 on: July 14, 2010, 11:36:13 am »
Having the OnGameEnd 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;

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: Scripting Suggestions
« Reply #65 on: July 14, 2010, 01:56:53 pm »
Having the OnGameEnd 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?

DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #66 on: July 14, 2010, 01:59:38 pm »
Procedure OnKeyPress(ID:Byte; Key:String);

Cool new options for scripting (admin commands, new player commands..).

Offline croat1gamer

  • Veteran
  • *****
  • Posts: 1327
  • OMG CHANGING AVATAR!!! ^ω^
Re: Scripting Suggestions
« Reply #67 on: July 14, 2010, 02:24:42 pm »
What would be if i hold a key?
Its same as OnFire and a faster AppOnIdle.
Last year, I dreamt I was pissing at a restroom, but I missed the urinal and my penis exploded.

DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #68 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.

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Scripting Suggestions
« Reply #69 on: July 15, 2010, 06:42:15 am »
Still being called to often.

DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #70 on: July 15, 2010, 07:02:50 am »
You could just ignore the buttons that are already used by default.

Offline Mighty

  • Camper
  • ***
  • Posts: 276
Re: Scripting Suggestions
« Reply #71 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
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #72 on: July 16, 2010, 09:40:25 am »
Not a big deal..

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: Scripting Suggestions
« Reply #73 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!
Can't think of anything original to put here...

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Scripting Suggestions
« Reply #74 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 ...  :-\

DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #75 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 ... 

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Scripting Suggestions
« Reply #76 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 )

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: Scripting Suggestions
« Reply #77 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...
Can't think of anything original to put here...

DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #78 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

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: Scripting Suggestions
« Reply #79 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.
Can't think of anything original to put here...

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Scripting Suggestions
« Reply #80 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
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #81 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 ;)

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Scripting Suggestions
« Reply #82 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.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Scripting Suggestions
« Reply #83 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).

DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #84 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..
« Last Edit: July 23, 2010, 06:14:36 pm by DarkCrusade »

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: Scripting Suggestions
« Reply #85 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
check out my server! click here

If at first you don't succeed, Improvise! :D

DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #86 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.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Scripting Suggestions
« Reply #87 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


« Last Edit: July 26, 2010, 10:49:46 am by mich1103 »

DarkCrusade

  • Guest
Re: Scripting Suggestions
« Reply #88 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 ;)

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: Scripting Suggestions
« Reply #89 on: July 26, 2010, 12:59:31 pm »
« Last Edit: July 26, 2010, 01:02:58 pm by frosty »
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Scripting Suggestions
« Reply #90 on: November 27, 2010, 07:40:23 am »
* FalconPL 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
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: Scripting Suggestions
« Reply #91 on: November 27, 2010, 07:53:55 am »
* FalconPL 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