How to release possessed Robot?

21 views
Skip to first unread message

Martin Anon

unread,
Aug 14, 2015, 10:12:25 PM8/14/15
to ReplicaIsland Coding Community

Hi all. I'm a bit late to the party..as usual :)

Hoping somebody could show me how to release a possesed charactor.

What I've done is added another droid (BigRobot) and another button that I use to control him.  I want to be able to possess him whenever he's needed. I can get possession, and then I can get control back to my main charactor again, however, once he's been possesed he cannot be possessed again! He also continues to show the sparks.
What should I be doing to release him in a way that lets me repossess him again?

My coding background is vb6, and this is my first adventure into Java and Chris's RI code is a fantastic way for me to learn, thanks Chris.

Chris Pruett

unread,
Aug 15, 2015, 2:10:46 AM8/15/15
to replica-island-...@googlegroups.com
It’s been a while, but maybe take a look at the robot spawner object rather than the BroBots themselves?  The spawner can be possessed multiple times and doesn’t throw components away (I think).


--
You received this message because you are subscribed to the Google Groups "ReplicaIsland Coding Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to replica-island-coding...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Martin Anon

unread,
Aug 18, 2015, 9:48:24 AM8/18/15
to ReplicaIsland Coding Community

Hi Thanks for the reply.

I checked out the spawner but it cannot be possessed, I think in an earlier version it could be. Turrets and switches can be possessed and a quick look at those has helped me on my way.

I keep seeing mention of a peice of code released by you called spritetest, do you know of any links for the source? I'd really like to study it.

Thanks again for your help.

Leo Cedric

unread,
Sep 16, 2015, 5:56:35 AM9/16/15
to ReplicaIsland Coding Community
Hi Martin, hoping to give you a direction here, its been a while since i had to deal with this scenario.

basically possession work by Swapping component in and out of an object.

1- if you make use of ChangeComponentsComponent.class  , you should be abble to define for your "main character" and your "second character" what component to swamp in and out like Chris did with "public GameObject spawnEnemyBrobot("  inside "GameObjectFactory"

2- you should also be able to define a condition when the swap need to happen, like "during Collision" inside "HitReactionComponent" or even "on touch of screen button" , the key here will be to ensure that you "activate" and ensure to "deactivate" the swap to restore initial components. you can also look at the method "setPingPongBehavior".

cheers
Reply all
Reply to author
Forward
0 new messages