#Script Errors

1 messages · Page 1 of 1 (latest)

warped wagon
sage frigate
#

yeah

warped wagon
#

sec, it got crowded

#

hmm

#

This is a bit intricate for this early in the morning.
But if you are absolutely certain that the Object should exist, then I believe it is a problem caused by Script Execution Order

#

make a new script, and make it a merger of all 3 scripts - just to check -
and if it works, then you can test while moving things out of the main script.

sage frigate
#

okay

#

Wait but

#

I cannot merge the 3 scripts

warped wagon
#

It is possible to control Script Execution Order, but it is rather recommended to rewrite the functionality to be handled in a top-down execution approach, or with an OOP approach (Object Oriented Programming)

sage frigate
#

it goes into different objects

warped wagon
#

Why does it have to be different objects?

sage frigate
#

pickupscript has to be in the object that the player can pick up, inventoryslots goes into the inventory slots, and the inventory can go anywhere

#

I can merge 2

warped wagon
#

alright, do that then

sage frigate
#

hm but

warped wagon
#

remember: I only suspect this is the issue. I need to wake up a bit more if I am to truly debug that code as it is. One script is more simple to work around.

sage frigate
#

inventoryslots & pickupscript is in a LOT of objects

#

wouldn't it be messed up?

warped wagon
#

Hm. Perhaps you should explain why you've structured it as you have.

#

Another tip - is to add Debug.Logs everywhere
so you see which code is executing before/after one another

sage frigate
#

ooh

#

I realized this containedItem = tempitems[slotcode];

#

i didn't have to instantiate it

warped wagon
#

alright

#

Any errors left?

sage frigate
#

I think i had to do a null check

#

no errors!

#

:D

#

ty rovsau

warped wagon
#

Nice ^^