an inventory item that gives its self back infinately

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Virtue
Posts: 919
Joined: Sun Nov 19, 2006 8:15 am
Location: Manchester UK

an inventory item that gives its self back infinately

Post by Virtue »

Is it possible? or at least, is it possible to constantly drop an item that gives the other item infinately? Im basically working on an Aliens style tracker that constantly scans using A_CheckSightOrRange using an inventory item.
User avatar
Sephiron
Posts: 300
Joined: Mon Jun 28, 2010 1:56 pm
Location: Michigun, pew pew!

Re: an inventory item that gives its self back infinately

Post by Sephiron »

Couldn't you just have the state that drops the item loop?
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: an inventory item that gives its self back infinately

Post by Gez »

No, that'd require ACS or my ScriptedPowerup effect that never made it into ZDoom.

The issue is that CustomInventory items go through all their states instantaneously. So any loop you can achieve would be a 0-tic infinite loop; with the new item spawned and picked up in the same tic and so on.
User avatar
David Ferstat
Posts: 1113
Joined: Wed Jul 16, 2003 8:53 am
Location: Perth, Western Australia
Contact:

Re: an inventory item that gives its self back infinately

Post by David Ferstat »

Have you checked out the [wiki]Inventory[/wiki] page? There are a number of tools there, both ACS and DECORATE, for manipulating Inventory items.

Specifically, I can see [wiki]CheckInventory[/wiki]and [wiki]GiveInventory[/wiki].


I suggest a really basic ACS script, called as often as you think fit, something like this:

Code: Select all

if CheckInventory("SpecialInventoryItem") < 1
     GiveInventory("SpecialInventoryItem", 1);
This script counts how many of SpecialInventoryItem you have; if you have less than 1, it gives you another.
User avatar
Demolisher
Posts: 1749
Joined: Mon Aug 11, 2008 12:59 pm
Graphics Processor: nVidia with Vulkan support
Location: Winchester, VA
Contact:

Re: an inventory item that gives its self back infinately

Post by Demolisher »

Gez wrote:No, that'd require ACS or my ScriptedPowerup effect that never made it into ZDoom.
Why didn't that make it in? That was a fabulously implemented idea (At least on the outside).
User avatar
Virtue
Posts: 919
Joined: Sun Nov 19, 2006 8:15 am
Location: Manchester UK

Re: an inventory item that gives its self back infinately

Post by Virtue »

I dont get why you cant loop inventory objects, they should work like any other Things.
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: an inventory item that gives its self back infinately

Post by XutaWoo »

Ben2k9 wrote:I dont get why you cant loop inventory objects, they should work like any other Things.
They do.

If you loop any actor into a 0-tic state, then ZDoom will crash regardless of what kind of actor it is.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: an inventory item that gives its self back infinately

Post by NeuralStunner »

Pretty sure CustomInventory ignores Loop.
User avatar
Demolisher
Posts: 1749
Joined: Mon Aug 11, 2008 12:59 pm
Graphics Processor: nVidia with Vulkan support
Location: Winchester, VA
Contact:

Re: an inventory item that gives its self back infinately

Post by Demolisher »

NeuralStunner wrote:Pretty sure CustomInventory ignores Loop.
Why? It can still be useful with A_JumpIf.
User avatar
Cronyne
Posts: 39
Joined: Sun Dec 06, 2009 3:56 pm

Re: an inventory item that gives its self back infinately

Post by Cronyne »

Can't you just make the Use state run a GiveInventory script?
User avatar
Virtue
Posts: 919
Joined: Sun Nov 19, 2006 8:15 am
Location: Manchester UK

Re: an inventory item that gives its self back infinately

Post by Virtue »

Cronyne wrote:Can't you just make the Use state run a GiveInventory script?
doesnt work.
User avatar
Cronyne
Posts: 39
Joined: Sun Dec 06, 2009 3:56 pm

Re: an inventory item that gives its self back infinately

Post by Cronyne »

Any reason why? I've seen DECORATE refer to ACS scripts.
User avatar
Demolisher
Posts: 1749
Joined: Mon Aug 11, 2008 12:59 pm
Graphics Processor: nVidia with Vulkan support
Location: Winchester, VA
Contact:

Re: an inventory item that gives its self back infinately

Post by Demolisher »

Yea, me too, unless you provide us with details, your "doesnt work" is not going to be taken seriously.

However, if it is an acs problem, try not forgetting #Library "WHATEVER", the loadacs lump, with the library name in it, and check script refs.
User avatar
Virtue
Posts: 919
Joined: Sun Nov 19, 2006 8:15 am
Location: Manchester UK

Re: an inventory item that gives its self back infinately

Post by Virtue »

oh I thought you meant A_giveinventory, sorry
User avatar
Cronyne
Posts: 39
Joined: Sun Dec 06, 2009 3:56 pm

Re: an inventory item that gives its self back infinately

Post by Cronyne »

Oh. That would cause confusion. =P

Well, give it a shot!
Locked

Return to “Editing (Archive)”