Spawn Reference

FreshlyMintedFreshlyMinted Member Posts: 14
edited November -1 in Working with GS (Mac)
Is there any way to reference a newly spawned actor like
change attribute : mostrecentlyspawned.size or something of that nature? Or do I have to pre-create them off screen and move them into position

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi Freshlyminted; as far as I'm aware, there's no way of referencing a spawned actor by an actor already on screen. All Rules for interaction, etc., have to be put in the Prototype actor before it's spawned.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • FreshlyMintedFreshlyMinted Member Posts: 14
    Thanks for your help, I really appreciate it although I wish the answer were different. Do you know of a typical workaround for this?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    I'm guessing that you'll want to change the spawned actor's size to different sizes at different times (otherwise you'd just spawn it at the size you want, of course).

    So maybe try a game attribute called SpawnNewSize. that way you can get other actors already on your screen to change SpawnNewSize to, let's say, 1, 2 or 3.

    then in the actor's rules that spawns, in one, change attribute SpawnNewSize to 1, in another change to 2, and yet another to 3, these changes in spawnNewSize made with a timer or triggered by collision, or another attribute being true...(difficult to say, not knowing anything about the gameplay).

    Already in your Prototype actor's Rules, the one to be spawned, add the Rules
    When SpawnNewsize is 1
    change attribute self.Size.width to....(whatever you want)
    change attribute self.Size.Height to...

    When SpawnNewSize is 2
    change attribute self.Size.width to....
    change attribute self.Size.Height to...
    (different height and width from the previous)

    Then for when SpawnNewSize is 3

    So you can automatically change it's size to be different whenever you want via another actor by changing SpawnNewSize.

    Another idea is, instead of changing the height and width in one go, you could replace the Change attributes with Interpolate, changing the size over a few seconds perhaps.

    Hope that helps and I haven't confused you with an unclear explanation.

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • FreshlyMintedFreshlyMinted Member Posts: 14
    Haha... eh.. Actually I meant spawning an actor with a size different from the default size of that actor. That's what I don't know how to do.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    OK, just have one change for SpawnNewSize. Have the one actor already on screen that presumably spawns it, in its Rules, just before the Spawn Behavior, Change Attribute SpawnNewSize to 1.

    In your Prototype actor to be spawned, put in the Rules

    When SpawnNewSize is 1
    then change width and height with change attributes. There you go.

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • FreshlyMintedFreshlyMinted Member Posts: 14
    Thanks, you've been very helpful for this problem and almost certainly future issues. Much appreciated
Sign In or Register to comment.