playMaker

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

heavygunner

  • Full Member
  • ***
  • Posts: 161
    • View Profile
Check Spawn Point for any object
« on: January 10, 2019, 05: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: 112
    • View Profile
Re: Check Spawn Point for any object
« Reply #1 on: January 10, 2019, 08: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

  • Full Member
  • ***
  • Posts: 161
    • View Profile
Re: Check Spawn Point for any object
« Reply #2 on: January 11, 2019, 07: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: 102
    • View Profile
    • Bzilla Games
Re: Check Spawn Point for any object
« Reply #3 on: January 11, 2019, 09: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: 112
    • View Profile
Re: Check Spawn Point for any object
« Reply #4 on: January 12, 2019, 02: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