cubescript updates : events fixed, cleaned & doc'd,+ finishing compatibility system.
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6475 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -0,0 +1 @@
|
||||
// Makes old cubescripts compatible with newer versions of the game
|
||||
+3
-6
@@ -587,12 +587,9 @@ docident [onChangeVote] [If this alias exists it will be run every time a vote i
|
||||
docident [onVoteEnd] [If this alias exists it will be run every time a vote passes or fails.];
|
||||
docident [votepending] [Determines if there is a vote pending or not.];
|
||||
docexample [echo $votepending] [Output: if there is currently a vote pending, returns 1, else returns 0.];
|
||||
docident [onDeathOther] [If this alias exists it will be run every time anybody but yourself dies.];
|
||||
docident [onDeathSelf] [If this alias exists it will be run every time you yourself die.];
|
||||
docident [onSpawnOther] [If this alias exists it will be run every time anybody but yourself spawns.];
|
||||
docident [onSpawnSelf] [If this alias exists it will be run every time you yourself spawn.];
|
||||
docident [onKill] [If this alias exists it will be run every time you kill an enemy.];
|
||||
docident [onTK] [If this alias exists it will be run every time you kill a teammate.];
|
||||
docident [onSpawn] [If this alias exists it will be run every time someone spawns.];
|
||||
docident [onKill] [If this alias exists it will be run every time a player is killed.];
|
||||
docident [onFlag] [If this alias exists it will be run every time a flag action occurs.];
|
||||
docident [mdldyncache] [];
|
||||
docargument [V] [] [min 1/max 32/default 2];
|
||||
docident [mdlstatcache] [];
|
||||
|
||||
+23
-59
@@ -1787,39 +1787,6 @@ addOnLoadAlways [
|
||||
</references>
|
||||
</scriptalias>
|
||||
|
||||
<scriptalias name="onDeathOther">
|
||||
<description>If this alias exists it will be run every time anybody but yourself dies.</description>
|
||||
<references>
|
||||
<identifierReference identifier="onDeathSelf"/>
|
||||
<identifierReference identifier="onSpawnOther"/>
|
||||
<identifierReference identifier="onSpawnSelf"/>
|
||||
</references>
|
||||
</scriptalias>
|
||||
<scriptalias name="onDeathSelf">
|
||||
<description>If this alias exists it will be run every time you yourself die.</description>
|
||||
<references>
|
||||
<identifierReference identifier="onDeathOther"/>
|
||||
<identifierReference identifier="onSpawnOther"/>
|
||||
<identifierReference identifier="onSpawnSelf"/>
|
||||
</references>
|
||||
</scriptalias>
|
||||
<scriptalias name="onSpawnOther">
|
||||
<description>If this alias exists it will be run every time anybody but yourself spawns.</description>
|
||||
<references>
|
||||
<identifierReference identifier="onDeathOther"/>
|
||||
<identifierReference identifier="onDeathSelf"/>
|
||||
<identifierReference identifier="onSpawnSelf"/>
|
||||
</references>
|
||||
</scriptalias>
|
||||
<scriptalias name="onSpawnSelf">
|
||||
<description>If this alias exists it will be run every time you yourself spawn.</description>
|
||||
<references>
|
||||
<identifierReference identifier="onDeathOther"/>
|
||||
<identifierReference identifier="onDeathSelf"/>
|
||||
<identifierReference identifier="onSpawnOther"/>
|
||||
</references>
|
||||
</scriptalias>
|
||||
|
||||
<scriptalias name="onCallVote">
|
||||
<description>If this alias exists it will be run every time a vote is called.</description>
|
||||
<references>
|
||||
@@ -1855,20 +1822,26 @@ addOnLoadAlways [
|
||||
</variable>
|
||||
|
||||
<scriptalias name="onKill">
|
||||
<description>If this alias exists it will be run every time you kill an enemy.</description>
|
||||
<references>
|
||||
<identifierReference identifier="onTK"/>
|
||||
</references>
|
||||
</scriptalias>
|
||||
|
||||
<scriptalias name="onTK">
|
||||
<description>If this alias exists it will be run every time you kill a teammate.</description>
|
||||
<references>
|
||||
<identifierReference identifier="onKill"/>
|
||||
</references>
|
||||
<description>If it exists, this alias will be executing when any player get killed, receiving a few arguments : </description>
|
||||
<arguments>
|
||||
<argument token="actor" description="The client number of the actor" valueNotes="integer" />
|
||||
<argument token="target" description="The client number of the target" valueNotes="integer" />
|
||||
<argument token="gun" description="The number of the gun used" valueNotes="integer" />
|
||||
<argument token="gib" description="Is it a gib or a normal frag" valueNotes="integer (0 or 1)" />
|
||||
</arguments>
|
||||
</scriptalias>
|
||||
|
||||
<scriptalias name="add2alias">
|
||||
<scriptalias name="onFlag">
|
||||
<arguments>
|
||||
<argument token="action" description="The action that occured" valueNotes="integer (0 = stolen, 1 = dropped, 2 = lost, 3 = returned, 4 = scored, 5 = ktfscore, 6 = failed to score, 7 = reset)" />
|
||||
<argument token="actor" description="The client number of the actor" valueNotes="integer"/>
|
||||
<argument token="flag" description="The flag owner team" valueNotes="integer (0 = CLA, 1 = RVSF)" />
|
||||
</arguments>
|
||||
<description>If defined, this will be executed each time a flag action occurs.</description>
|
||||
</scriptalias>
|
||||
|
||||
|
||||
<scriptalias name="add2alias">
|
||||
<description>This will append the passed 2nd argument to any existing content of the alias named in the 1st argument. Several popular aliases have predefined shortcuts using this scriptalias: addOnQuit, addOnLoadOnce, addOnLoadAlways. Check config/scripts.cfg for possible omissions in that list.</description>
|
||||
<examples>
|
||||
<example>
|
||||
@@ -1904,21 +1877,12 @@ echo foo
|
||||
<identifierReference identifier="addOnQuit"/>
|
||||
</references>
|
||||
</scriptalias>
|
||||
|
||||
<scriptalias name="onDeathSelf">
|
||||
<description>This will be executed each time the player dies.</description>
|
||||
</scriptalias>
|
||||
|
||||
<scriptalias name="onDeathOther">
|
||||
<description>This will be executed each time another player dies.</description>
|
||||
</scriptalias>
|
||||
|
||||
<scriptalias name="onSpawnSelf">
|
||||
<description>This will be executed each time the player spawns.</description>
|
||||
</scriptalias>
|
||||
|
||||
<scriptalias name="onSpawnOther">
|
||||
<description>This will be executed each time another player spawns.</description>
|
||||
<scriptalias name="onSpawn">
|
||||
<arguments>
|
||||
<argument token="player" description="The client number of the player who spawned" valueNotes="integer" />
|
||||
</arguments>
|
||||
<description>If defined, this will be executed each time a player spawns.</description>
|
||||
</scriptalias>
|
||||
|
||||
<variable name="positiontype">
|
||||
|
||||
@@ -712,7 +712,7 @@ void findplayerstart(playerent *d, bool mapcenter, int arenaspawn)
|
||||
d->o.z = 4;
|
||||
}
|
||||
entinmap(d);
|
||||
if(identexists("onSpawn"))
|
||||
if(identexists("onSpawn")/* && (m_teammode && d->team == player1->team)*/)
|
||||
{
|
||||
defformatstring(onspawn)("onSpawn %d", d->clientnum);
|
||||
execute(onspawn);
|
||||
@@ -902,8 +902,8 @@ void dokill(playerent *pl, playerent *act, bool gib, int gun)
|
||||
{
|
||||
if(pl->state!=CS_ALIVE || intermission) return;
|
||||
|
||||
defformatstring(killevent)("onKillEvent %d %d %d %d", act->clientnum, pl->clientnum, gun, gib ? 1 : 0);
|
||||
if(identexists("onKillEvent")) execute(killevent);
|
||||
defformatstring(killevent)("onKill %d %d %d %d", act->clientnum, pl->clientnum, gun, gib ? 1 : 0);
|
||||
if(identexists("onKill")) execute(killevent);
|
||||
|
||||
string pname, aname, death;
|
||||
copystring(pname, pl==player1 ? "you" : colorname(pl));
|
||||
@@ -1256,9 +1256,9 @@ void flagmsg(int flag, int message, int actor, int flagtime)
|
||||
const char *teamstr = m_ktf ? "the" : own ? "your" : "the enemy";
|
||||
const char *flagteam = m_ktf ? (teammate ? "your teammate " : "your enemy ") : "";
|
||||
|
||||
if(identexists("onFlagEvent"))
|
||||
if(identexists("onFlag"))
|
||||
{
|
||||
defformatstring(onflagevent)("onFlagEvent %d %d %d", message, actor);
|
||||
defformatstring(onflagevent)("onFlag %d %d %d", message, actor, flag);
|
||||
execute(onflagevent);
|
||||
}
|
||||
|
||||
|
||||
@@ -571,6 +571,11 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
|
||||
else // new client
|
||||
{
|
||||
conoutf(_("connected: %s"), colorname(d, text));
|
||||
if(identexists("onNewPlayer"))
|
||||
{
|
||||
defformatstring(onnewplayer)("onNewPlayer %d", d->clientnum);
|
||||
execute(onnewplayer);
|
||||
}
|
||||
}
|
||||
copystring(d->name, text, MAXNAMELEN+1);
|
||||
loopi(2) d->setskin(i, getint(p));
|
||||
|
||||
Reference in New Issue
Block a user