Author Topic: Scripting Engine Suggestions  (Read 25527 times)

0 Members and 1 Guest are viewing this topic.

Offline freestyler

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 326
Re: Scripting Engine Suggestions
« Reply #60 on: September 20, 2007, 08:33:31 am »
BulletTime(Time: byte);
forces bullettime (slows the game for all players, no matter where they are) for specified amount of time.


Offline sai`ke

  • Camper
  • ***
  • Posts: 318
  • Can't be arsed to remove christmas avatar
Re: Scripting Engine Suggestions
« Reply #62 on: September 20, 2007, 12:34:26 pm »
What about DoDamage(id,damage,shooter) so you can write who did damage. Because elsewhere it's written as suicide.
Dont suggest: Adding/Changing new parameters to any functions/events
Um, if you wanted to you might be able to give the command he suggests a different name like DoDamageBy or something :p
#soldat.ttw #ttw.gather --- Quakenet!
http://ttwforums.com

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Scripting Engine Suggestions
« Reply #63 on: September 20, 2007, 01:49:28 pm »
Just use CreateBullet with fists and try to find your own way to fix the damage.
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Aquarius

  • Soldier
  • **
  • Posts: 234
Re: Scripting Engine Suggestions
« Reply #64 on: September 21, 2007, 03:09:55 am »
Suggestion: add "Position" stat to GetPlayerStat function, it would inform if a player is standing, crouching or in prone position.

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Scripting Engine Suggestions
« Reply #65 on: September 21, 2007, 02:38:06 pm »
suggestion for position
if standing, return "|"
if crouching and facing left, return "\"
if crouch and facing right, return "/"
if prone, return "_"
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Scripting Engine Suggestions
« Reply #66 on: September 21, 2007, 04:49:24 pm »
suggestion for position
if standing, return "|"
if crouching and facing left, return ""
if crouch and facing right, return "/"
if prone, return "_"
the facing left and right stuff is pointless sense EnEsCe already added a thing to get a player's direction (left or right, not like an angle or cursor xy or something)



Suggestions:
  • function ThreadedCrossFunc(const Params: array of Variant; ProcName: string);

exactly the same thing as CrossFunc except it calls the procedure / function threaded (obviously doesn't return a value)
  • Ability to make it so you can't use CrossFunc on a specified script (so if you have an encrypted (or unencrypted) script, you can make it so ppl don't call anything inside of it through another script)
  • Something so you can have optional arguments in a function / procedure; ex: making DoDamage(ID: byte; Damage: single; (Owner: byte)); where as it still works like DoDamage(1,4000) but you could also do DoDamage(1,4000,2) like php can do... doubtful sense you didn't "create" pascal / delphi, but still wanted to throw it out there.

    Date Posted: September 21, 2007, 04:43:24 pm
  • OnFlagReturn does not get called when the server returns the flag (from it being untouched for too long)

    Date Posted: September 21, 2007, 05:18:15 pm
  • Having the variables DeathmatchPlayers, AlphaPlayers, BravoPlayers, CharliePlayers, DeltaPlayers, Spectators still existing, but also having an array Players: array[0..5]; same along with the team's scores, but array[1..4] instead.. would make it much easier to check that information sense the majority of things uses numbers for doing stuff with teams, and this would be easier for a for loop... (i know you can do this yourself, but it would take extra lines, which nobody wants)

    Date Posted: September 21, 2007, 05:32:32 pm
    Bonuses are now registered on the server, right?
    I don't remember if i already suggested this but having an event procedure OnGrabBonus(ID, Bonus: byte); where as Bonus is the same numbers as GiveBonus..

Offline Aquarius

  • Soldier
  • **
  • Posts: 234
Re: Scripting Engine Suggestions
« Reply #67 on: September 21, 2007, 06:17:17 pm »
How about OnPlayerTeamSpeak?

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Scripting Engine Suggestions
« Reply #68 on: September 21, 2007, 06:45:37 pm »
if ContainsString(Text,'^') ...

Date Posted: September 21, 2007, 07:40:28 pm
OnFlagReturn does not get called when the server returns the flag (from it being untouched for too long)

wouldn't this work?
Code: [Select]
procedure OnFlagReturn(ID,Team:byte);
begin
  if (ID = 255) then exit;
end;
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Scripting Engine Suggestions
« Reply #69 on: September 21, 2007, 07:23:55 pm »
if Text[1] = '^' ... would probably be better...

No, "OnFlagReturn does not get called..."
I'm NOT asking how to make it so anything under OnFlagReturn is not called when the server returns the flag.

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Scripting Engine Suggestions
« Reply #70 on: September 21, 2007, 08:12:07 pm »
is Text[1] the same as GetPiece(whatever) ? (whatever would be what you need to get first char in text)
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Scripting Engine Suggestions
« Reply #71 on: September 21, 2007, 09:57:24 pm »
- Making some functions unable to be called by CrossFunc would be pointless, as the user could easily just edit out whatever method is used to make that function un-callable. And no one has requested a script to be encrypted so meh.
- Optional arguements is supported by Delphi/Pascal itself, however the script parser does not support it and I can't change that.
- Ill fix the flag thing, with ID 255.
- Pre-defined variables can only be Byte/Integer/String, not arrays or other variables.

And I think the ^ isnt shown in the Text variable for chat in the current released version, something MM changed.... It will be in 2.6.3 though.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Scripting Engine Suggestions
« Reply #72 on: September 22, 2007, 08:09:43 am »
Quote
- Pre-defined variables can only be Byte/Integer/String, not arrays or other variables.
im never going to remember that; sry if i suggest more stuff that isn't any of those 3 related to built-in variables

  • A ARGB function that does exactly the same thing as RGB except there are 4 arguments and the first one is the set alpha amount.. or RGBA, i don't really know whats "proper" if either one is :P ... its so ppl who don't know how the $________ is set up can still set alpha.
« Last Edit: September 22, 2007, 08:28:19 am by DorkeyDear »

Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: Scripting Engine Suggestions
« Reply #73 on: September 22, 2007, 08:27:12 am »
  • A ARGB function that does exactly the same thing as RGB except there are 4 arguments and the first one is the set alpha amount.. or RGBA, i don't really know whats "proper" if either one is :P ... its so ppl who don't know how the $________ is set up can still set alpha.
I can't check right now, since my computer is down and I'm running off of an Ubuntu Live CD, but check if the script engine supports the SHL operator; if it does, you can make your own:

Code: [Select]
function ARGB(alpha: byte; Red: byte; Green: byte; Blue: byte): Cardinal;
begin
  result :=(alpha shl 24) or (red shl 16) or (green shl 8) or blue;
end;

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Scripting Engine Suggestions
« Reply #74 on: September 22, 2007, 08:33:00 am »
  • A ARGB function that does exactly the same thing as RGB except there are 4 arguments and the first one is the set alpha amount.. or RGBA, i don't really know whats "proper" if either one is :P ... its so ppl who don't know how the $________ is set up can still set alpha.
I can't check right now, since my computer is down and I'm running off of an Ubuntu Live CD, but check if the script engine supports the SHL operator; if it does, you can make your own:

Code: [Select]
function ARGB(alpha: byte; Red: byte; Green: byte; Blue: byte): Cardinal;
begin
  result :=(alpha shl 24) or (red shl 16) or (green shl 8) or blue;
end;
I know, i know, but then there was no point in adding RGB sense you could have made it yourself... but it was added :) (same with Distance function, and i bet other functions too)


  • A OnRoundStart event for survival mode
  • A OnRoundEnd event for survival mode
« Last Edit: September 22, 2007, 08:50:14 am by DorkeyDear »

Offline xmRipper

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 742
    • Personal
Re: Scripting Engine Suggestions
« Reply #75 on: September 22, 2007, 11:01:46 am »
  • A OnRoundStart event for survival mode
  • A OnRoundEnd event for survival mode
+1
Co-Founder / CTO @ Macellan
Founder Turkish Soldat Community

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Scripting Engine Suggestions
« Reply #76 on: September 23, 2007, 04:37:38 am »
- Added DisableScript variable
  Setting this variable to TRUE will disable your script.
- Added DoDamageBy function
  Identical to DoDamage, however the person doing damage can be specified.

(Yes I know it links to DoDamage)

Date Posted: September 23, 2007, 07:23:05 pm
- Added OnScriptCrash option to server.ini. Values are recompile, ignore, shutdown, or disable.
  Recompile will /recompile the script, ignore will ignore the crash, shutdown will shutdown the server, and disable will disable the script.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Scripting Engine Suggestions
« Reply #77 on: September 23, 2007, 05:22:09 am »
You should add a server shutdown option to OnScriptCrash, I would use that ;D
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Scripting Engine Suggestions
« Reply #78 on: September 23, 2007, 05:50:20 am »
Oh yeah shutdown is there too, forgot to write it there >_<

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Scripting Engine Suggestions
« Reply #79 on: September 23, 2007, 06:47:27 am »
Is it possible to make MovePlayer move the camera of a spectating player to the specified spot? That would be awesome ;D
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host