Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: TheRagMan on September 06, 2012, 10:06:19 AM
-
i was trying to set up a game action where i can take and put object around(not drag)
the synth logic was this:
if push E and trigger obj tag "object" store in var and destroy obj
if push F create obj in var
it doesnt work eheheh... i believe that the VAR get corrupted after i destroy the original object cause it works without the destroyself..i can clone.
Can anyone explain me the logic behind this? what's the problem?a gameobject var doesnt store all of an object? i cant believe that's just a link.. :/ Thx in advance
-
Hi,
if you delete a gameObject, any reference to it will become null. This is the expected behavior
Could you explain a bit more in details what you want to achieve, then we'll be able to assist better.
bye,
Jean
-
-Take an object from the floor
-Put the object on the floor :)
i just want an inventory, i was trying with a G.object var as inventory slot and a simple cut & paste logic.
-
HI,
ok, I think the problem is that your representation of the object should not be the actual reference in your system.
you need to maintain a reference in your game, and when the user is picking an object, store this reference instead of the visual representaiton of it ( the gameObject lying on the floor).
Then if you delete the object, no problem, it was just a visual representation of it.
But as is it's difficult to give you more details, since I am not sure what kind of data you want to convey when picking an object or playing an object.
bye,
Jean
-
Oh...Ok... the difference between reference and representation explain...a lot.
I'm just using bootcamp as test field and trying to do some interactions with junk.
i'have no big plans just learning some basic standard dynamics.. as figure out how to take/leave an object from the floor.
so... can u give me an url with some info? and maybe just tell me the right logic behind a clean simple inventory sys?
how can i store the reference of the obj? is it wrong the " store,destroy, create" logic?
thx in advance.
-
HI,
I am in the middle of travelling, can you bump this thread next week, and I will reply with a concrete example.
bye,
Jean
-
bumped as requested. thx again.
-
Hi,
Here we go, thanks for bumping this.
I updated ArrayMaker package and included a new inventory scene.
basically, study this, and come back to me if you have questions, this is using quite advanced technics and tricks, so don't worry if you don't fully grasp everything on the first run, come back to me if you need clarifications on the features and how they work,
https://hutonggames.fogbugz.com/default.asp?W715 (https://hutonggames.fogbugz.com/default.asp?W715)
bye,
Jean