[SOLVED] Counting the gold

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
UnTrustable
Posts: 758
Joined: Wed Jan 31, 2007 11:34 am
Location: The Netherlands
Contact:

[SOLVED] Counting the gold

Post by UnTrustable »

Hello,

First i have to say that i am not a professional in what i do whether it is about making sprites or scripts, or decorate...

I am in a big need of advise or better... the final solution to the following problem.

I made a custom inventory named gold, and linked to that more gold-actors, so that no matter what the gold is named or looked like, it will be
gold.
I tried many things, and i cant figured out where things go wrong...
I tried to call it inventory, and since THAT didnt work, i called it Ammo... and even THAT doesnt work... so im out of idea's now.
Spoiler:
Now, ..in game, a script is counting whatever gold each player is collecting.. or at least, THAT is the meaning of this.
But it does NOT...
Why not?
Is it because the "Gold00 = (CheckActorInventory(0, "Gold"));" is not working as the Wiki says it does?
Is it because ...?? what??
I tried to check out the ammo, as you can see in the Script code, but the CheckActorInventory does NOT check anything..
It returns a value '1'...
What do i do wrong? It took me my entire weekend, and still got nothing.... and that makes me sad... :cry:

Spoiler:
Last edited by UnTrustable on Wed Mar 23, 2016 2:21 pm, edited 1 time in total.
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

Re: [HELP] Counting the gold

Post by Blue Shadow »

Pickup states can only be used with [wiki=Classes:CustomInventory]CustomInventory-derived[/wiki] items, and non other.

Code: Select all

ACTOR Riches : Inventory
{
    Inventory.MaxAmount 1000
}

ACTOR RichesItem1 : CustomInventory
{
    // Properties and flags here

    States
    {
    Spawn:
        RICH A -1
        Stop
    Pickup:
        TNT1 A 0 A_GiveInventory("Riches", 10)
        Stop
    }
}
User avatar
UnTrustable
Posts: 758
Joined: Wed Jan 31, 2007 11:34 am
Location: The Netherlands
Contact:

Re: [HELP] Counting the gold

Post by UnTrustable »

I can not say if the decorate you suggested me is working.
I tried to copy and paste your code...so IF that one is good now, the Script is still not checking the gold each player have...
Can you help me there too alittle...?
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

Re: [HELP] Counting the gold

Post by Blue Shadow »

I see you're trying to check the inventory of actors tagged from 1 to 8. Are the players given tags (tids) from 1 to 8? Note that [wiki=TID]tids[/wiki] and [wiki=PlayerNumber]player numbers[/wiki] are two different things.
User avatar
UnTrustable
Posts: 758
Joined: Wed Jan 31, 2007 11:34 am
Location: The Netherlands
Contact:

Re: [HELP] Counting the gold

Post by UnTrustable »

Blue Shadow wrote:I see you're trying to check the inventory of actors tagged from 1 to 8. Are the players given tags (tids) from 1 to 8? Note that [wiki=TID]tids[/wiki] and [wiki=PlayerNumber]player numbers[/wiki] are two different things.
I tried soo many things during the past weeks, the code might become a mess now.
So im completely out of idea's, and still not know WHAT is wrong about it, and what to change to make it work...
i really need some guidance in this.
User avatar
UnTrustable
Posts: 758
Joined: Wed Jan 31, 2007 11:34 am
Location: The Netherlands
Contact:

Re: [HELP] Counting the gold

Post by UnTrustable »

okay... i gave the player the said NEW tid.
Now the script is counting the "CheckActorInventory"...
Still working on it.... :wink:.. Problem is still not solved.... but its almost there...
User avatar
UnTrustable
Posts: 758
Joined: Wed Jan 31, 2007 11:34 am
Location: The Netherlands
Contact:

Re: [HELP] Counting the gold

Post by UnTrustable »

Okay.. .problem solved.

Thanks guys.
You saved me from becoming completely madness.
Locked

Return to “Editing (Archive)”