Author Topic: anyone else getting this Inventory item issue.  (Read 1218 times)

0 Members and 1 Guest are viewing this topic.

Offline stateofpsychosis

anyone else getting this Inventory item issue.
« on: November 05, 2014, 11:28:37 AM »
Once in a while I'll set up an item to pick up in a room with lots of other items as well...

and when I type 'get battery' for example... a cable ends up in my inventory

I've checked my Main.sc, my Game.sh, game.ini and my roomscript... nothing is wrong that could be causing this..

It's strange everything is perfect, but it still does this once in a while with certain objects.

Does anyone know if there's a cause/solution for this?
I've been just doing work arounds.. like if i move the item to another room the problem stops happening
« Last Edit: November 05, 2014, 12:04:52 PM by stateofpsychosis »



Offline Cloudee1

Re: anyone else getting this Inventory item issue.
« Reply #1 on: November 05, 2014, 02:11:15 PM »
I have never had any issues that I wasn't the cause of. If you want, post some code and we'll see if we cant get it figured out.

Specifically, the inventory defines in the game.sh file. The bit in the mainscript about a quarter of the way down where they are listed, not necesarily the instances at the bottom though, as well as your get statements that give the ego the item.

My initial guess is that there is something being overlooked between the game.sh file where the inventory items are defined and given a number and the send gEgo get statements that assign the owner by the numbers.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline stateofpsychosis

Re: anyone else getting this Inventory item issue.
« Reply #2 on: November 05, 2014, 02:39:50 PM »
okay it's a global said statement so here's that part of it:

Code: [Select]
(if(Said('use>'))
(if(Said('/scissors>'))
(if(Said('//firework'))
(if(send gEgo:has(INV_SCISSORS))
(if(send gEgo:has(INV_FIREWORK))
Print("You carefully cut away the cardboard from the firework and remove the explosive shell discarding the rest.")
(send gEgo:get(INV_EXPLOSIVE))
(send gEgo:put(INV_FIREWORK))
)
(else Print("You don't have any fireworks."))
)
(else Print("You don't have any scissors."))))
)


here's the whole game.sh inventory section so far
Code: [Select]
(define INV_NOTHING           0)
(define INV_SHOVEL            1)
(define INV_MATCHES           2)
(define INV_LIGHTER           3)
(define INV_DEADLIGHTER       4)
(define INV_SCISSORS          5)
(define INV_TAPE              6)
(define INV_SMOKES            7)
(define INV_KEYS              8)
(define INV_MOUSETRAP         9)
(define INV_FIREWORK         10)
(define INV_EXPLOSIVE        11)
(define INV_CABLE            12)
(define INV_FUSE             13)
(define INV_BATTERY          14)
(define INV_SMOKE            15)
(define INV_FLINT            16)
(define INV_MINE             17)
(define INV_TIMEBOMB         18)

and here's that bit in the main script you wanted ( the initialization section i presume)
Code: [Select]
(Inv:
add(
{Nothing}
{shovel}
{matches}
{lighter}
{deadlighter}
{scissors}
{tape}
{smokes}
{keys}
{mousetrap}
{firework}
{proxbomb}
{timebomb}
{explosive}
{cable}
{battery}
{flint}
{fuse}
{smoke}
)
)

so do the numbers in the game.sh matter? i thought they were just to number what spot they are at in your inventory..

lol still new at this but I'm figuring out most of it on my own :P

you're right though. it definitely is something I did, but can't put my finger on it.

Offline stateofpsychosis

Re: anyone else getting this Inventory item issue.
« Reply #3 on: November 05, 2014, 02:41:35 PM »
lol while posting this i think i realized my error

the order has to match between the initialization section and the defines don't they?

Offline stateofpsychosis

Re: anyone else getting this Inventory item issue.
« Reply #4 on: November 05, 2014, 03:18:18 PM »
yea that was it

total blond moment :P


SMF 2.0.14 | SMF © 2017, Simple Machines
Simple Audio Video Embedder

Page created in 0.09 seconds with 23 queries.