The Daily Click ::. Forums ::. Klik Coding Help ::. 2 Objects working as 1
 

Post Reply  Post Oekaki 
 

Posted By Message

Callebo

Possibly Insane

Registered
  10/08/2008
Points
  3988

VIP MemberPS3 OwnerGOTM AUGUST - 2009 - 3RD PLACE!GOTM OCTOBER- 2009 - 2ND PLACE
2nd September, 2009 at 23:19:14 -

Hey, quick question
I have set an active object (soldier) value A to spread value 0, then set another active object (rifle) value A to soldiers value A if they are overlapping and the timer is less than 1 second.
Here comes the part thats bugging me: If value A (rifle) = value A (soldier) then set rifles position to soldier. So, if the rifle has the same value as the soldier, the rifle should follow him. BUT, it doesn't.
I've tested the rifles and soldiers value, and they are the same so I have no idea why it's not working...
Help would be appreciated!

 
...Atleast thats what Batman told me!

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
3rd September, 2009 at 02:33:00 -

Try this,

-Alterable Value A of Solder is = to Alterable Value A of Gun
AND Alterable Value A of Gun is = to Alterable Value A of Solder
-Set Gun Position to Solder.


Didn't test it but it's worth a shot, eh

 
n/a

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!
3rd September, 2009 at 13:20:25 -

No, you don't need to do that, and you probably don't need all the stuff about them overlapping or the time being <1 second.
It's almost certainly just a problem with the order of conditions, or parts of a condition.

Firstly, are you sure you need them to be separate objects - it will make things more difficult (as you're finding out). Could you just have several animations instead?

Secondly, are you sure you even need to use spread values at all?
If you just say:
* Always
-> Rifle: set position at 0,0 from Soldier

...it will automatically match a rifle to each soldier (by ranking them according to the order in which they were created).

Finally, if you must use spread values, pay very close attention to the order of *everything*.
I can't be bothered to explain it all again, so I suggest you read this: http://www.create-games.com/article.asp?id=1975



 
n/a

Callebo

Possibly Insane

Registered
  10/08/2008
Points
  3988

VIP MemberPS3 OwnerGOTM AUGUST - 2009 - 3RD PLACE!GOTM OCTOBER- 2009 - 2ND PLACE
3rd September, 2009 at 15:31:30 -

Yes, they need to be seperate objects since the rifle uses a 360 degree shooting. Also the "* Always -> Rifle: set position at 0,0 from Soldier" won't work since I need more than one rifle/soldier. Forgot to mention that.
Yeah, they will follow the soldiers, but not work togheter with them. If a soldier dies, I want his rifle to be destroyed, if he sees the target I want his rifle to fire and so on. Forgot to mention that
I guess I don't need to use spread values, but it seems to be the safe way. I tried giving the soldiers a random(9999) value aswell, and once again the rifles got the same value but nothing worked as it should.


 
...Atleast thats what Batman told me!

Don Luciano

Heavy combat pancake

Registered
  25/10/2006
Points
  380

VIP Member
3rd September, 2009 at 16:21:55 -

Good way to do this without loops is to use sticky object. And to give every rifleman a fixed value of his rifle in one of his alt values so you know which rifle to destroy when he dies.

Edited by Don Luciano

 
Code me a sausage!

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!
3rd September, 2009 at 16:27:10 -

Like I said, it's most likely just some conditions in the wrong order.
Post *exactly* what your events are, and *exactly* what you want to happen, and then I can try and give a more exact answer



 
n/a
   

Post Reply



 



Advertisement

Worth A Click