Posted By
|
Message
|
Aptennap
Registered 23/04/2004
Points 916
|
1st November, 2008 at 20:25:26 -
I have these events:
Always
-Spread in Value A of 'object'
Every 1 seconds
-Create 'object'
The problem is that the newest created object gets 0 as his value A. I want the object that is already created to have 0.
Oh sweet mary.
|
Silveraura God's God
Registered 08/08/2002
Points 6747
|
2nd November, 2008 at 03:01:16 -
So umm:
( Spread Value of A 'object' ) + 1
http://www.facebook.com/truediamondgame
|
Aptennap
Registered 23/04/2004
Points 916
|
2nd November, 2008 at 08:25:35 -
No, that's not what the problem is.
-First an object is created, is ValA is 0.
-Another instance of that object is created, now that ValA is 0, and the already existing object gets 1.
-Another instance is created, now he gets 0 in his ValA.
See?
Oh sweet mary.
|
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
|
2nd November, 2008 at 09:25:47 -
Instead of using spread values you will need to use your own system.
When you create an object set it's Alt Val A to the number of objects. This will work as long as objects are not destroyed. If you need to destroy objects then you should have a counter with has the max number of objects that ever occured. eg:
> Create Object
> Set Value A to "Stored Number"
> Add 1 to "Stored Number"
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy
|
Aptennap
Registered 23/04/2004
Points 916
|
2nd November, 2008 at 11:44:15 -
Oke thank you(1 more word).
Oh sweet mary.
|
Jon Lambert Administrator
Vaporware Master
Registered 19/12/2004
Points 8235
|
2nd November, 2008 at 13:58:26 -
When you use spread value in an alterable value, the numbers are distributed from newest to oldest. So when you create a new object, it gets zero, and the second newest one gets one, etc.
Sandwich Time!Whoo!
JoyCheck & KeyCheck Widgets
For easy implementation of customizable joystick and keyboard controls.
http://www.create-games.com/download.asp?id=8364
|
Fifth Quadruped
Registered 07/05/2003
Points 5818
|
2nd November, 2008 at 15:56:03 -
If you want the spread values to be reversed, just do something like this:
-Spread value 0 in Value A ("Object")
-Set Value A ("Object") to NObjects ("Object") - Value A ("Object")
You subtract the value you get from spread value from the total number of objects, thereby reversing the values.
'Course, using this exactly will have your first object with the value 1, but if you want a 0 instead you can simply subtract 1 from the second equation. Or spread the value 1 in the first place.
Go Moon!
|
|
|