The Daily Click ::. Forums ::. Klik Coding Help ::. help with ids..
 

Post Reply  Post Oekaki 
 

Posted By Message

Zode



Registered
  13/04/2009
Points
  239

PS3 Owner
29th April, 2010 at 15:13:29 -

so i have 2 teams (ai team1 base and ai team2 base, theyre actives)
and each team player has 2 sensors (team1-/team2 sensor left/right)
on start of frame i spread value 1 on team1-/team2 base/sensor
then i wrote:
ID("team1-/team2 sensor left/right") = ID("Ai team1-/team 2 base)
> set position of team1-/team2 sensor left/right to Ai team1-/team 2 base on 0,0 (hotspot)
and it wont work!!! >:C
i mean the problem is:
only sensors on team 1 / team 2 with id 1 go to base(s) with id 1
and the sensors with id 2 or 3 wont go to base(s) with id 2 or 3! I EVEN made a counter wich shows the sensors/bases id when u roll ur mouse over it and the ids worked perfectly but WHY dosnt those STUPID sensors GO to THAT damn base
siighh.. ivebeen frustated by this problem on 2 days.. >:I and i rly want to finish this random ai-engine

 
n/a

aphant



Registered
  18/05/2008
Points
  1242
29th April, 2010 at 15:20:54 -

It sounds like you're doing everything right, except for iterating over all of the actives. Try this:

Start of Frame (or whenever you want to start the positioning loop)
> Start loop "iterate"

On loop "iterate"
ID("team1-/team2 sensor left/right") = ID("Ai team1-/team 2 base)
> set position of team1-/team2 sensor left/right to Ai team1-/team 2 base on 0,0 (hotspot)

That should go through and put every active where it belongs.

 

Zode



Registered
  13/04/2009
Points
  239

PS3 Owner
29th April, 2010 at 15:30:15 -


Originally Posted by aphant
It sounds like you're doing everything right, except for iterating over all of the actives. Try this:

Start of Frame (or whenever you want to start the positioning loop)
> Start loop "iterate"

On loop "iterate"
ID("team1-/team2 sensor left/right") = ID("Ai team1-/team 2 base)
> set position of team1-/team2 sensor left/right to Ai team1-/team 2 base on 0,0 (hotspot)

That should go through and put every active where it belongs.


I tried that, i quess im doing something wrong since first time it attached sensor id 3 to ai base id 1 and still haves same problem
and second time it attached sensor id 1 to base id 1 and still haves same problem (dosent attach other ones)
am i still making something wrong?
start of frame -> spread value 1 on id
start of frame -> start loop team1sensors count("team1bases") times
on loop "team1sensors"
sensor id = base id
> set position to base 0,0 hotspot


:/

EDIT: I think im gonna loose my mind here D:

Edited by Zode

 
n/a

Don Luciano

Heavy combat pancake

Registered
  25/10/2006
Points
  380

VIP Member
29th April, 2010 at 18:30:40 -

I use a lot of loops, the problem u are having is with how mmf2 selects objects to do action with, if you are using actions for both objects, its always needed to select both of them not just one as u prolly did.

Sensor id = base id - this will only select sensor id object but not base etc...

You must on loop condition do this:

on loop
sensor id = "fast loop index" - this will select sensor id object based on loop index
base id = sensor id - this selects base id object based on id of already selected sensor id

hope that helps



 
Code me a sausage!

Zode



Registered
  13/04/2009
Points
  239

PS3 Owner
29th April, 2010 at 18:50:06 -


Originally Posted by Don Luciano
I use a lot of loops, the problem u are having is with how mmf2 selects objects to do action with, if you are using actions for both objects, its always needed to select both of them not just one as u prolly did.

Sensor id = base id - this will only select sensor id object but not base etc...

You must on loop condition do this:

on loop
sensor id = "fast loop index" - this will select sensor id object based on loop index
base id = sensor id - this selects base id object based on id of already selected sensor id

hope that helps



oh hey IT WORKS! thank you! !

edit: i fiqured out how to control em, tought im all lost now how to recive value but im gonna go read some MORE articles about fastloops n spreading values

Edited by Zode

 
n/a

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
30th April, 2010 at 01:16:25 -

note - Fast Loops use a 0 index so if you are spreading the value 1 through your objects you will need to reference the Loop Index+1

eg.

Sensor id = LoopIndex("LoopName")+1

this forces it up one value. if you don't want to have to add one to the loop index simply spread the value 0 through the objects instead.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click