I'm making an item for a mod which team asked me not to use ZScript. It should be an CustomInventory that, when picked up, would pass two arguments to a global script.
The idea is that the mappers could simple set the args in the item on their maps and the item would execute the script871 with proper vars when picked up.
However, it seems to always pass zero values. My guess is that, as the item gets excluded from the game when a player gets it, the player is the activator of the script and it is his arguments, and not the CustomInventory's, that are being passed.
The CustomInventory actually uses 3 args: the args[2] define its skin and is not related to the problem. Args[0] and args[1] are the ones that really matter, as follows:
Code: Select all
actor CODEXPAGE : CustomInventory 12045
{
//$Category Unbroken Stuff//Artifacts
+INVENTORY.AUTOACTIVATE
+INVENTORY.ALWAYSPICKUP
+INVENTORY.QUIET
Inventory.PickupMessage "New Codex entry."
States
{
Spawn:
FLOP Y 0
//this part simply uses args[2] to choose a skin, and is not important now
(...)
Pickup:
TNT1 A 0 ACS_ExecuteAlways(871, 0, Args[0], Args[1])
Stop
}
}
I've already tried to pass the values both as user_vars:
Code: Select all
Spawn:
FLOP Y 0
TNT1 A 0 A_SetUserVar("user_categoria", Args[0]
TNT1 A 0 A_SetUserVar("user_pagina", Args[1])
(...)
Pickup:
TNT1 A 0 ACS_ExecuteAlways(871, 0, "user_categoria", "user_pagina")
Stop
Code: Select all
Pickup:
TNT1 A 0 A_GiveInventory("CodexChapterDummy", Args[0])
TNT1 A 0 A_GiveInventory("CodexIndexDummy", Args[1])
Stop
}
}
actor CodexChapterDummy : Inventory { Inventory.MaxAmount 99 -INVBAR }
actor CodexIndexDummy : Inventory { Inventory.MaxAmount 99 -INVBAR }Thanks in advanced.