The Daily Click ::. Forums ::. Klik Coding Help ::. Spread Value - Adding new objects to the spread.
 

Post Reply  Post Oekaki 
 

Posted By Message

Rob Westbrook



Registered
  25/05/2007
Points
  193

360 OwnerVIP Member
21st July, 2008 at 00:16:20 -

I've had a look around on the forums and haven't been able to find an answer to this.

I've created a minimap in my Sinistar-esque game using spread values to link the minimap blips to the planetoids dotted around the level, and also a blip that follows the player around. The planetoids are created in a fastloop at the start of the stage that uses a global value "planetoid_amount" initially set to the number of planetoids. As the loop goes through its iterations it creates planetoids and blips counts down the "planetoid_amount" GV until it reaches 0, whereupon the loop stops and the ID values of the planetoids and blips are spread.

That all works perfectly, and I've set it up so that the blips disappear when their respective planetoids get destroyed. What I need to do now, and have been unable to figure out for myself, is how to create new planetoids and blips with matching IDs so that the minimap is accurate. A new planetoid would be created when another one is destroyed.

Any help would be greatly appreciated.

 
There are 10 types of people in the world: Those who understand binary and those who don't.

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
21st July, 2008 at 01:17:28 -

I don't really understand the problem, but I'm going to at least attempt to help.
Without seeing how you coded it I don't know, but I don't see why the blips need IDs.

Normally MMF is pretty clever at handling multiples of objects - if you have the same number of objectA and objectB, and say "always: set objectA position to objectB position" it will automatically match each objectA to a different objectB (sorted by fixed values - ie. how recently they were created)- they won't all converge on a single instance of objectB. If you have different kinds of blip it's different, but I assume a blip is a blip is a blip.

Either way, every time you use spread value, it over-rides whatever the previous values were so I can't see where the problem arises. Suggest you search here and at the clcikteam forums for minimap examples - it should be quite simple if you're going about it in the right way.

 
n/a

Rob Westbrook



Registered
  25/05/2007
Points
  193

360 OwnerVIP Member
21st July, 2008 at 02:59:35 -

Well what do you know... I went and purged all the spread values and instead ran a fastloop that constantly keeps the number of planetoids and number of blips the same. Simple really...

Thanks a lot for your advice, I've overcome a major hang-up in my progress now.

 
There are 10 types of people in the world: Those who understand binary and those who don't.
   

Post Reply



 



Advertisement

Worth A Click