Author Topic: Scripting Suggestions  (Read 12445 times)

0 Members and 1 Guest are viewing this topic.

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