playMaker

Author Topic: Check Spawn Point for any object  (Read 1584 times)

heavygunner

  • Sr. Member
  • ****
  • Posts: 344
Check Spawn Point for any object
« on: January 10, 2019, 07:16:01 AM »
I have few spawn points in map. On those spawn points guns & power ups will spawn. Once player picked that, spawnpoint become empty.

How can I check for empty spawn points and If it's empty, spawn another object there?

Athin

  • Full Member
  • ***
  • Posts: 163
Re: Check Spawn Point for any object
« Reply #1 on: January 10, 2019, 10:45:39 PM »
Hey,

I think you've asked this before in another post already?

What you can do though is just simply have a Bool if the spawn point is empty or full.  If its false or empty just spawn the object that is set to spawn there again and set the Bool to true until its pick up again.

heavygunner

  • Sr. Member
  • ****
  • Posts: 344
Re: Check Spawn Point for any object
« Reply #2 on: January 11, 2019, 09:42:47 AM »
Hey,

I think you've asked this before in another post already?

What you can do though is just simply have a Bool if the spawn point is empty or full.  If its false or empty just spawn the object that is set to spawn there again and set the Bool to true until its pick up again.

Yes, I did. I couldn't get it done perfectly.
Btw, How to check spawnpoint empty or not ?

Currently, I solved this issue by having a Trigger on Spawnpoint, If no trigger detected, spawn new object.

Still, wanna know how to check spawnpoint empty or no via bool?

Phuzz

  • Full Member
  • ***
  • Posts: 101
    • Bzilla Games
Re: Check Spawn Point for any object
« Reply #3 on: January 11, 2019, 11:18:48 AM »
If the spawn points aren't random, you can have all the Vectors in a Bool Hashtable, and just switch them true or false based if it is occupied or not. Then you can use Hashtable Get to test if the bool is true or false.
Bzilla Games "Education with a Tickle!"
Qbucket Games "Voxel Games"

Athin

  • Full Member
  • ***
  • Posts: 163
Re: Check Spawn Point for any object
« Reply #4 on: January 12, 2019, 04:17:12 AM »
Hey,

The bool can be a simple system.  If the item is there or the game starts with it there set it to true.  Once a player picks it up, set the bool to false at the same time.  Now that its false, the game will know that its empty and to spawn a new item.  When it does spawn the item again then set the bool back to true.

I dunno if this exact way will work with your setup but the idea behind it should fit perfectly with what you're asking for unless I've miss something.

Thanks