spawn actor with unique numbers?

se7rn@mese7rn@me London / Cape Town Member Posts: 11

Hi All,

Newbie here.

I'm struggling with the following:
I spawn 5 actors but want each of the 5 actors to have a unique reference point (Number). This should be displayed on screen too.

I've created a self attribute INDEX and tried changing the attribute to +1 for some reason its only displaying the default INDEX value of 0.

The change attribute was put before spawn..

Not really sure how to achieve this if it's even possible. Would any of you kind people out there point me in the right direction.

Would be much appreciated.

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Hi there,

    If you want each actor to contain that unique number, the actor has to grab and place that number somewhere. That is why you create a self integer attribute ( called NewValue in this example ) to hold that value.

    So, when your actor logic, drag a change attribute to the top of the logic stack outside of any rules. Change self.NewValue to game.INDEX. This will grab the INDEX value and place it inside the self attribute.

    Make sense?

    If not, I can create a demo for you.

  • se7rn@mese7rn@me London / Cape Town Member Posts: 11

    Hi Brandon,
    Thanks for the prompt reply. It kinda make sense. If its not to much effort i would be grateful if you can create a demo for me.

    I'll try what you suggested anyway.. Thank you very much.

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    @se7rn@me - Sure, let me whip that up really quick. Back in a moment.

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    @se7rn@me - Here you go.

  • se7rn@mese7rn@me London / Cape Town Member Posts: 11

    wow amazing. Thank you very much. Exactly what I wanted.
    I'll check my existing code and see where i have gone wrong.
    Again thank you very very much.

Sign In or Register to comment.