Author Topic: Script Core Suggestions  (Read 85578 times)

0 Members and 2 Guests are viewing this topic.

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: Script Core Suggestions
« Reply #240 on: June 21, 2013, 09:32:30 am »
Please learn english instead of using google translate because i cannot understand you.

Translate it back to polish on translate.google.pl and it makes perfect sense.

Im chill like that

DarkCrusade

  • Guest
Re: Script Core Suggestions
« Reply #241 on: June 21, 2013, 01:42:20 pm »
Something that confused me:

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

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

Code: [Select]
procedure onUnitCollision(id1,id2:byte);
« Last Edit: June 21, 2013, 02:07:45 pm by DarkCrusade »

Offline JotEmI

  • Soldier
  • **
  • Posts: 188
Re: Script Core Suggestions
« Reply #242 on: June 21, 2013, 02:05:54 pm »
I think this has been already suggested (probably even by me) but still...
I'd like to see a new stat added for GetObjectStat() - owner's ID.

StatResultType
OwnerID of a player who created the object (like thrown knife, dropped weapon, etc) or 255 for flags, kits, etc.Byte

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Script Core Suggestions
« Reply #243 on: June 21, 2013, 02:55:02 pm »
I think i've mentioned somewhere that i'll be making no more changes to SC2 API.

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

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

And that'd be called when?
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: Script Core Suggestions
« Reply #244 on: June 21, 2013, 03:43:52 pm »
Whenever a soldier walks / flies through another soldier, onUnitCollision gets called. I think that this event is useful, since normal scripting is not able to achieve an effect as precise as with an in-built event, and I can already see use of it in a lot of gamemodes such as zombie RPGs or tag modes.

Offline dominikkk26

  • Camper
  • ***
  • Posts: 404
    • PMGsite
Re: Script Core Suggestions
« Reply #245 on: June 22, 2013, 06:46:11 am »
Modify:
Code: [Select]
procedure OnPlayerKill(Killer, Victim: byte;Weapon: byte; HeadShot: boolean);

Offline dominikkk26

  • Camper
  • ***
  • Posts: 404
    • PMGsite
Re: Script Core Suggestions
« Reply #246 on: June 23, 2013, 03:18:55 pm »
Code: [Select]
Procedure OnRoundEnd (ID: byte; zespołu: integer);

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Script Core Suggestions
« Reply #247 on: June 23, 2013, 04:24:29 pm »
there's OnGameEnd already(). You can check who won by comparing team's score with max score.
Isn't it the same?
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 dominikkk26

  • Camper
  • ***
  • Posts: 404
    • PMGsite
Re: Script Core Suggestions
« Reply #248 on: June 24, 2013, 01:49:41 am »
I surwival mode to each round, and may be as many as 100 Further portions to write code?
Besides, think how many new opportunities will introduce a procedure call when the round is over.

Offline Mighty

  • Camper
  • ***
  • Posts: 276
Re: Script Core Suggestions
« Reply #249 on: July 23, 2013, 08:25:28 am »
Please allow us to change TimeLeft. I think climbers would be greatful
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Script Core Suggestions
« Reply #250 on: July 23, 2013, 08:28:03 am »
You can always set it to 0, aka infinite.
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 squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
Re: Script Core Suggestions
« Reply #251 on: July 23, 2013, 02:04:01 pm »
I think he meant something else. Example: time is running out, player needs more time to capture flags. He calls a vote and 5 minutes are added to the current time (via inc(timeleft,5) or w/e).

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

Edit: as long as I'm already here, OnFlagDrop(ID, TeamFlag: byte)
More a reminder than a suggestion :p.
« Last Edit: July 23, 2013, 02:09:01 pm by squiddy »
www.soldatx.com.br - The brazilian Soldat community.

Offline Mighty

  • Camper
  • ***
  • Posts: 276
Re: Script Core Suggestions
« Reply #252 on: August 09, 2013, 02:58:06 am »
Now we do have to do some memory management now with Script Core 3 (e.g. TNewMapObject or TNewPlayer, but also TStringList).
However, SC3 doesn't provide any elegant features to free the memory when recompiling. At the moment you have to check whether "/recompile" command has been used and free everything then.

So the suggestion would be:
1. Garbage collector on recompile (very long term)
2. OnBeforeRecompile event or any other form of Finalization block equivalent.

Already mentioned it when talking with Falcon, posting here not to forget.
« Last Edit: August 09, 2013, 02:59:54 am by Mighty »
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

DarkCrusade

  • Guest
Re: Script Core Suggestions
« Reply #253 on: August 09, 2013, 12:38:48 pm »
I don't see your problem..

Code: [Select]
function oncommand(id:byte; text:string):boolean
begin
 if text = '/recompile' then freeAll();
 result := false;
end;

Offline Mighty

  • Camper
  • ***
  • Posts: 276
Re: Script Core Suggestions
« Reply #254 on: August 09, 2013, 01:39:48 pm »
not too elegant. that's my problem.
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Script Core Suggestions
« Reply #255 on: August 09, 2013, 06:13:13 pm »
I'll think about it. For now you can simply have at least one unit, then you have finalization section.
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: Script Core Suggestions
« Reply #256 on: August 17, 2013, 06:02:20 pm »
It would be useful to have map boundry information (xmin, xmax, ymin, ymax); it is the 'edge of the map' where if you try to jump into it, you respawn. In SC3, I suggest something like TMap.XMin, TMap.XMax, TMap.YMin, TMap.YMax (all of type single), or something similar.

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Script Core Suggestions
« Reply #257 on: August 17, 2013, 07:07:34 pm »
I'll add it when i get to extending map management (polygons, waypoints, scenery...)
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: Script Core Suggestions
« Reply #258 on: August 19, 2013, 04:45:52 pm »
Events for the game becoming paused or unpaused; something like OnPause, OnResume/OnUnpause or similar.

For reference, a possible workaround/alternative is to check if the game is paused or not on the event OnClockTick/AppOnIdle, and if it changes state, call the appropriate event, with the disadvantage of the event being called with a delay. Another option is to check OnPlayerCommand, with the disadvantage of not covering cases when a script pauses/unpauses the game.

DarkCrusade

  • Guest
Re: Script Core Suggestions
« Reply #259 on: August 22, 2013, 03:56:36 am »
It would be awesome if OnPlayerSpeak had two boolean for hiding or not hiding a message if certain conditions are met. The first one would be for showing messages in the chat, and the other one for showing messages above a player's head.

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

I think it would be great to have, and with SC3, I see no problem here. :)