include("../navbar.php");
?>
Mit, Scripting?
-
- Posts:49
- Joined:Fri Jan 15, 2016 3:42 pm
Just wondering what, if any, changes have been made to the scripting system since the old game.
- Mit
- Site Admin
- Posts:260
- Joined:Thu Oct 29, 2015 11:19 pm
- Location:UK
- Contact:
Re: Mit, Scripting?
Quite a bucketload of new stuff.. not sure how far back we need to go.. :]
Will take me a while to update all the docs for it, but here's a random grab from some of the code lists that have been added in the past few months..
Events :
Will take me a while to update all the docs for it, but here's a random grab from some of the code lists that have been added in the past few months..
Events :
Sys functions :"EntityDestroyed", "EntityDamaged", "EntityPickup", "EntityUpdate", "ProductionRunStart", "ProductionRunEnd", "PickupBuilding","KillWildlife","FireWeapon","WorldUpdate", "BuildingDamaged", "WeaponHitGround","WeaponHitPlayer", "MapClick","OnTheHour", "TenToTheHour", "FiveToTheHour", "CrowFlagTouch", "CrowFlagTouchAny", "CrowExit", "Subgame", "HarvestDay","RaceStart", "RaceEnd", "FlagPickup","FlagCapture","HornballGoal","EnterGameZone","ExitGameZone", "SubgameChallengeStart", "SubgameChallengeCountdownStart", "DayOfYear","ViewTournament", "RaceWinner"
New globals:"sysGetNearestPlayer","sysGetSecondaryConstructionPrice", "sysIsInBuildZone", "sysIsInNoBuildZone", "sysIsInScriptZone", "sysAddWealth","sysRemoveWealth", "sysConstructBuilding", "sysGetCrowFlagState", "sysSetCrowFlagState", "sysGetPlayerListScore", "sysNumPlayersInRCMode", "SubgameGetStat", "SubgameGetNumPlayers", "SubgameGetNumPlayersOnTeam", "SubgameIncrementStat", "SubgameDecrementStat", "SubgameGetTimerRemaining", "SubgameGetScore", "SubgameGetHighestPlayerListScore", "SubgameNumPlayersWithPlayerListScore", "SubgameGetPlayerWithPlayerListScore", "SubgameIsPlayerInGame", "SubgameGetPlayer", "SubgameChallengeGetPlayer", "sysNumPlayersInBuildZone","sysNumPlayersInScriptZone", "sysNumPlayersWithPlayerVarVal", "sysGenerateTopPlayerVarsList","sysGetTopPlayer", "sysGetExportPrice", "EntityCreate", "EntityAddToWorld", "EntitySetPosition", "EntitySetRotation", "EntitySetModel", "EntitySetAnimation", "EntityMoveTo", "EntitySetBehaviour", "EntityDelete", "EntityDeleteAll", "EntityCommandCode", "EntitySetValue","EntitySetControlFlag", "EntityActivateUpdateEvent","EntitySetGraphics",
"SubgameJoin", "SubgameLeave", "SubgameEventAll", "SubgameMessageAll","SubgameSoundAll", "SubgameEventTeam","SubgameMessageTeam", "SubgameSoundTeam","SubgameSetStat", "SubgameSetTimer", "SubgameKillTimer", "SubgameReset", "SubgameRegisterEvent", "SubgameActivateScoreboard", "SubgameSetScore", "SubgameIncrementScore","SubgameActivatePlayerListScores","SubgameActivateUI", "SubgameWebpostDuelScore", "sysBuildingActivateStockroom", "sysBuildingActivateBuyItem", "sysBuildingActivateSetPrices", "sysBuildingActivateSellItem"
OSD Elements:"gPlayerCrowX", "gPlayerCrowY","gBuildingDamage", "gBuildingTeam", "gEventWorldX", "gEventWorldY",
"gPlayerRot", "gClickX", "gClickY", "gPlayerNetWorth", "gBuildingCapacity", "gBuildingSpaceRemaining", "gNumTowns","gTotalMoneySupply","gGlobalAverageWealth", "gNumAlive"
Other bits and pieces :"BLINKINGWARNINGTEXT", "EXITIMAGE", "SLIDER", "AMOUNTPRICEVALUE", "COUNTDOWN", "LAYERRECT"
- New subgame system ; (as used by all the bongochimp games, and the RC KOTH and Duel games).. this is a helper system that lets you easily add players to a subgame/group, and then trigger events and messages for all the players in the subgame/group. Server auto-handles the removal of players from the subgame/group when they leave and etc.
- Lotsa additions to the entity controls - some of the bongochimp games uses entities (e.g. pickup entities for the crates).
- Not sure if we had the keyvalue system last time you were about? You can create stored variables just by name now, e.g. "$gServerKey[Brian] = 1" (automatically creates a new stored variable called 'Brian' ) - similar per-player system on $gPlayerKey
- Supports += , -= etc
- Now supports variable function indirection.. e.g. can do things like..
which is very useful for certain thingsCode: Select all
$maFunctionList[] = { "MyFunc", "MyOtherFunc", "AThirdFunc" } $callFunc = $maFunctionList[$inputVal] $callFunc()
- You can also pass arrays as variables now - I use that a lot on current servers.. for instance theres just one function for all the different skills, and each skill just has an (easily updated) array defining the skill names, prices, descriptions etc that is passed into the 'DisplaySkillList' function.
- And of course theres a pile of new * server commands too ; e.g. *eventallinscriptzone [zoneIDnum] [eventname] [params], *subgamedebug, subgamereset [subgamenum], *flagsetcapturedest [flagnum] [buildingnum], *setplayerlistscore [player] [score],*setallplayervar [playervarNum] [value]
-
- Posts:49
- Joined:Fri Jan 15, 2016 3:42 pm
Re: Mit, Scripting?
Lots of nice stuff. I still have to figure out how to use Arrays.
Is it safe to assume there havn't been any syntex changes?
Still 128 building and server vars and 64 player vars?
I've been working on the scripts I had been making for Zoric before player worlds went away, hoping to have them ready before the hopeful return of player owned worlds. Have the servers and clients from that time but unfortunatly there doesn't seem to be a way to do a local connection for testing.
Is it safe to assume there havn't been any syntex changes?
Still 128 building and server vars and 64 player vars?
I've been working on the scripts I had been making for Zoric before player worlds went away, hoping to have them ready before the hopeful return of player owned worlds. Have the servers and clients from that time but unfortunatly there doesn't seem to be a way to do a local connection for testing.
-
- Posts:189
- Joined:Thu Jan 14, 2016 1:57 am
Re: Mit, Scripting?
after a quick glance over that list of script goodness I have one question off the top of my head --
Does this work yet?:
event("killwildlife","wildlifetype#")
Does this work yet?:
event("killwildlife","wildlifetype#")
- Mit
- Site Admin
- Posts:260
- Joined:Thu Oct 29, 2015 11:19 pm
- Location:UK
- Contact:
Re: Mit, Scripting?
yup, i used that on aramathea to award people 'Hides' when they speared a 'cow-thing'.
-
- Posts:189
- Joined:Thu Jan 14, 2016 1:57 am
Re: Mit, Scripting?
can we get a setting on weapons where certain weapon can only kill a certain wildlife type as well? =)