Posted By
|
Message
|
MBK
Registered 07/06/2007
Points 1578
|
30th June, 2009 at 19:14:07 -
I've asked PixelThief a few days ago, but either I misunderstood his answer and did something wrong, or it just plain don't work with my code because of some strange anomaly.
Anyway, I'd like to know how to get the Instance of an Active to retain its Spread ID value that it's first given, and for all other instances that follow to be the next value up from the last placement.
i.e. Lets say you place an object into the level editor after spreading a value 1 through that object. That single instance is given a value, but when I place the object again (a second instance of the same object), what happens is that the values switch places. Instead of just adding to the last instances' value and giving that value to the second instance, it tends to give the highest numbered value to the first instance. How do I prevent that from happening and make it so it just adds to the value for each additional instance?
I'm gonna try what PixelThief said again in seperate code and see if it works. Maybe it's my code interfering with his trick.
Click Me! http://www.create-games.com/project.asp?view=main&id=1444
http://www.mediafire.com/download.php?aoo1dnnlq5i
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
|
easyname
Registered 15/04/2008
Points 450
|
30th June, 2009 at 19:19:11 -
Maybe
Spread value 0 in alterable value A
Set alterable value A No. objects(object)-value a
?
I think that would work.
Edited by easyname
n/a
|
OMC What a goofball
Registered 21/05/2007
Points 3516
|
30th June, 2009 at 19:24:37 -
I believe that's the same answer Pixelthief gave and I believe it should work. O_o
If not, you could just set the value to the number of objects on creation.
|
MBK
Registered 07/06/2007
Points 1578
|
2nd July, 2009 at 05:55:55 -
Originally Posted by OldManClaytonI believe that's the same answer Pixelthief gave and I believe it should work. O_o
If not, you could just set the value to the number of objects on creation.
Upon creation? .. interesting idea, cause then I might not have to mess with spread values at all ... I'd have to make a coding so that when the character gets close to specific places during runtime, then an instance of the object will be created setting its alterable value to the amount of instances currently on screen, and then make it so when the object is no longer on screen, it gets destroyed. What's the best way to do that? .. Arrays? .. Inis?, I'm gonna have to learn those, heh.
Btw OMC, if you could try putting it into my latest project source, (I tried and failed, it just wouldn't work) that'd be right good of you, cause then I'd know if it's just my dumbassitude or if it just plain won't mesh well with the code I have because of conflicting data somewhere.
Edit: This is not going to work though because I need the spread values for other reasons as well.
I'm going to try PT's advice in a new code and mix it with OMC's advice of upon creation and see what happens. It should work then and then I'll have to hunt down why it won't in my 2.5d code. Thank You guys, you got me headed in the right direction.
Edited by MBK
Click Me! http://www.create-games.com/project.asp?view=main&id=1444
http://www.mediafire.com/download.php?aoo1dnnlq5i
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
|
|
|