Page 1 of 1
Need help with item pickup thats inaccessible by player
Posted: Fri Aug 03, 2012 1:43 pm
by Lollipop
* I need to make a pickup that is intended to act as a marker in the iventory
* I need to know if it is possible to make is possible only for some classes to pick up some pickups? and is it then possible to determine how many of that pickup the classes can have?
Spoiler: fail code so far (Open)Actor rock : custominventory
{
Inventory.PickupMessage "A rock, actually quite usefull"
inventory.pickupsound "misc/p_pkup"
States
{
Spawn:
ROK3 A -1
Stop
Pickup:
TNT1 A 0 A_giveinventory ("Rock", 1)
Stop
}
}
the problem is that then I pick it up the game crashes now, even though there "stop" in the pickup command.
I fixed the problem with the image not showing up with adding S_START and S_END markers in the right places, S_START above the image and S_ENd below with nothing else in between.
RE: Need help with item pickup thats inaccessible by player
Posted: Fri Aug 03, 2012 6:57 pm
by ninja2000
Class 1 <- Cant pick up
Class 2 <- Can
The item to pick is an rock spawner that after picking up will spawn the rock in the inventory... if Class 1 will try to pick up the spawner there will be (if class = 2 -> perform pick up).
RE: Need help with item pickup thats inaccessible by player
Posted: Fri Aug 03, 2012 7:12 pm
by Neewbie
Actor rock : custominventory
{
Inventory.ForbiddenTo "YOURGODDAMNCLASSHERE"
Inventory.PickupMessage "A rock, actually quite usefull"
inventory.pickupsound "misc/p_pkup"
States
{
Spawn:
ROK3 A -1
Stop
Pickup:
TNT1 A 0 A_giveinventory ("Rock", 1)
Stop
}
}
There it shouldn't crash anymore xD
RE: Need help with item pickup thats inaccessible by player
Posted: Sun Aug 05, 2012 7:03 pm
by Lollipop
well, then I spawn it into the map it dont have any prite at all, and then I actually pick it up the game crashes -.-
RE: Need help with item pickup thats inaccessible by player
Posted: Sun Aug 05, 2012 7:09 pm
by Combinebobnt
When you pickup rock, it gives you rock again, which will continue to give you itself forever. This infinite loop will cause the game to crash.
RE: Need help with item pickup thats inaccessible by player
Posted: Thu Aug 09, 2012 9:56 am
by Lollipop
I have changed the code to what neewbie have told, but it wont work even with the stop command -.\\
RE: Need help with item pickup thats inaccessible by player
Posted: Thu Aug 09, 2012 9:10 pm
by Llewellyn
Try this:
Code: Select all
Actor rockPickup: customInventory
{
Inventory.forbiddenTo "YOURGODDAMNCLASSHERE"
Inventory.pickupMessage "You collected a rock."
inventory.pickupSound "misc/p_pkup"
Inventory.Amount 1
Inventory.MaxAmount 10
States
{
Spawn:
ROK3 A -1
Stop
Pickup:
TNT1 A 0 A_Print("PickedUp")
Stop
}
}
RE: Need help with item pickup thats inaccessible by player
Posted: Fri Aug 10, 2012 4:12 pm
by Lollipop
Ill try that next time I get access to the data
EDIT: LOOOOL! now I cant pick it up at all XD
RE: Need help with item pickup thats inaccessible by player
Posted: Fri Aug 10, 2012 11:18 pm
by Llewellyn
I edited it, I assumed you were going to put something in the Pickup state, because if you don't then it doesn't pick up.
RE: Need help with item pickup thats inaccessible by player
Posted: Sun Aug 12, 2012 8:53 am
by Lollipop
so now it prints the pickup message, does that mean it works? I mean do I have it in my inventory so I can accesss it ith an ACS script?
this is really important information as its vital for my project that I can access it in such a way.
RE: Need help with item pickup thats inaccessible by player
Posted: Sun Aug 12, 2012 6:41 pm
by Llewellyn
Lollipop wrote:
so now it prints the pickup message, does that mean it works? I mean do I have it in my inventory so I can accesss it ith an ACS script?
this is really important information as its vital for my project that I can access it in such a way.
Try the PrintINV console command.
RE: Need help with item pickup thats inaccessible by player
Posted: Sun Aug 12, 2012 7:27 pm
by Bloax
By the way, CustomInventory is not a good base actor to use.
I can't remember exactly why, but it's something about it being mostly for inventory-only items. (And gained by being given by the appropriate base actor for items, Inventory.)
RE: Need help with item pickup thats inaccessible by player
Posted: Mon Aug 13, 2012 12:20 am
by Llewellyn
Bloax wrote:
By the way, CustomInventory is not a good base actor to use.
I can't remember exactly why, but it's something about it being mostly for inventory-only items. (And gained by being given by the appropriate base actor for items, Inventory.)
Probably something about only being able to keep one of them across mapchange.
RE: Need help with item pickup thats inaccessible by player
Posted: Mon Aug 13, 2012 4:40 am
by Ijon Tichy
no, that applies to all inventories
there have been problems repeatedly with using a custominventory as a counter
just use a normal Inventory if inventory.restrictedto is in
RE: Need help with item pickup thats inaccessible by player
Posted: Mon Aug 13, 2012 8:30 am
by Lollipop
so forget custominventory and use the inventory actor that custominventory inhertitages from anyway? I also wanna ask if inventory.restrictedto can have multiple classes in it? like:
can have: miner, adv miner (just as scetch)
cannot have: swordsman, archer, pikeman
I also want to know if adding a spawn number works like if I would add a spawn number to a monster?
EDIT: I would also like to know how to spawn an item by its name, would be much easyer than useing spawn numbers, and i think ill run out of numbers also, so i have made this script
#include "zcommon.acs" //I allways include this
script 1 (void)
{
thing_spawn(1, "rockpickup", 0, 0);
}
I hope for help :(
NOTE: I wish to announce that I do know how to spawn it now, I do want to have several actors allowed to pick it up.