just when i thought i was on to something....

the story of our lives lol. so i accomplished my rule. of when my actor reaches its destination. stop it from being controlled.

but... its stopping off of the duplicate actors of it that is spawning. so anyone have any ideas? i want to be able to control the next actor that comes down. thanks....



the rules

Comments

  • ericzingelerericzingeler Member Posts: 334
    A great way to independently control spawned actors is to give them a unique identity.

    The easiest way to do this is like so:

    Game attributes:

    actorIndex (index type attribute)
    activeActor (index type attribute)

    Actor attribute:

    myID (index)

    beavers inside actor (at top, outside of rules):

    change game.actorIndex to: game.actorIndex + 1
    change myID to: game.actorIndex

    Ok, now your spawned actors are unique. At this point, just set game.activeActor the ID number of the actor you want to control, then inside the actor do this:

    if myID = game.activeActor

    [control behaviors here]




  • VolontaArtsVolontaArts Member Posts: 510
    thanks a bunch @ericzingeler ...will try it tomorrow as soon as i get home...but right now my brain is fried and cant even picture what you explained lol. but sounds good. thanks again
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    @ericzingeler are beavers part of the nightly builds? Those damn misbehaving beavers - ahahhaha @-)
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    I just added this to my printed out GS code hint library - hope you guys get a giggle out of it :)

    image
  • VolontaArtsVolontaArts Member Posts: 510
    edited August 2013
    A great way to independently control spawned actors is to give them a unique identity.
    The easiest way to do this is like so:
    Game attributes:
    actorIndex (index type attribute)
    activeActor (index type attribute)
    Actor attribute:
    myID (index)
    beavers inside actor (at top, outside of rules):
    change game.actorIndex to: game.actorIndex + 1
    change myID to: game.actorIndex
    Ok, now your spawned actors are unique. At this point, just set game.activeActor the ID number of the actor you want to control, then inside the actor do this:
    if [/Bold]myID = game.activeActor[/Bold]
    [control behaviors here]


    hey thanks a bunch...it worked...but i didnt use the game.activeActor attribute. at the end where you said to put inside the actor "myiD = game.activeActor" i put myiD = game.actorIndex....the other way didnt work. but thank you it definitely solved my problem

    @ericzingeler
    am i going to run into a problem?


Sign In or Register to comment.