IO System
IO System was introduced in
Zombie Panic! to simplify some unnecessary entities for Objective maps. IO System also supports some minor scripting, but not much as it was never designed with that in mind.
Usage
This page is in need of information.
Can you help out? Click here to add more.
Example
This example is directly from zp_haunted.io file
Function OnRoundStart()
{
FireOutput "bookbtn0" "DeActivate" "" 1.0
FireOutput "bookbtn1" "DeActivate" "" 1.0
}
Function OnOutputSent( EntityID, EntityName, OutputName, OutputValue, OutputDelay )
{
if EntityName is "wpn_give"
// Give the player the shotgun
GiveItem {OutputValue} "weapon_dbarrel"
end
if EntityName is "me_book"
FireOutput "bookbtn1" "Activate" "" 1.0
end
if EntityName is "book_place1"
FireOutput "bookbtn0" "Activate" "" 1.0
end
// The player participated in finding the anomalies
if EntityName is "anomaly0"
Participated {OutputValue} "HOUSEOFHORRORS"
FireOutput "book_check" "IncreaseValue" "" 0.0
elseif EntityName is "anomaly1"
Participated {OutputValue} "HOUSEOFHORRORS"
FireOutput "book_check" "IncreaseValue" "" 0.0
elseif EntityName is "anomaly2"
Participated {OutputValue} "HOUSEOFHORRORS"
FireOutput "book_check" "IncreaseValue" "" 0.0
elseif EntityName is "anomaly3"
Participated {OutputValue} "HOUSEOFHORRORS"
FireOutput "book_check" "IncreaseValue" "" 0.0
elseif EntityName is "anomaly4"
Participated {OutputValue} "HOUSEOFHORRORS"
FireOutput "book_check" "IncreaseValue" "" 0.0
elseif EntityName is "anomaly5"
Participated {OutputValue} "HOUSEOFHORRORS"
FireOutput "book_check" "IncreaseValue" "" 0.0
end
// Our book was set, and we found all anomalies!
if EntityName is "book_set_snd"
FireOutput "world_ending" "StartShake" "" 0.0
FireOutput "end_fog" "StartFog" "" 1.0
FireOutput "anomaly_ach" "GiveAchievement" "" 3.0
end
}Functions & Commands
| Function | Description |
|---|---|
| Function OnMapStart() | Called when the map has just been loaded |
| Function OnRoundStart() | Called when the round starts |
| Function OnMapEnd() | Called when the map ends. |
| Function OnPlayerSpawned(Player) | The player who just spawned |
| Function OnInputReceived(EntityID, Action, Value) | Example |
| Function OnOutputSent(EntityID, EntityName, OutputName, OutputValue, OutputDelay) | Example |
| Command | Description |
|---|---|
| FireOutput "my_target" "MyInput" "MyValue" 5.0 | Fires an output from the target entity |
| ASCall "MyFunction()" | Fires an AngelScript function |
| Wait 2.5 | Waits until next line gets fired. |
| Break {param} if "MyValue" | Stops the function. The lines after the break will be ignored. |
| if EntityName == "apple" | An if statement block |
| elseif EntityName is "orange" | Ditto, same as if, but for elseif |
| else | Ditto. |
| end | Ends the if/else/elseif statement blocks |
| PrintToConsole "Message here" | Prints a message to the host console |
| PrintToChat "Message here" | Prints a message to everybody's chat |
| GiveItem 0 "item_name" | Gives a specific item to the player. |
| Participated 0 "ID_Name" | Tells which player participated a certain event. |
| AddToSpawnList Ammo "item_name" 5 | Adds an item to the spawn list. |
| SpawnItems | Spawns the items from the AddToSpawnList (and purges the list after) |