Jimzip's Forum Posts

  • Hey again, so I'm working with an object family now, and all these objects have their own instance variables containing their dialogue. ObjectA: Dialogue1, ObjectA: Dialogue 2, ObjectB: Dialogue1 etc. But I'm still having trouble trying to send these instance variables to my main function. I'm pretty sure it's just the syntax I'm using. I just can't figure it out.

    I would assume I do something like:

    Player On Collision with "Talkers" > Call Function "Pull Dialogue" (Talkers.UID)

    Function On "PullDialogue" > Set DialogueHolder to Function.Param(0).Dialogue1

    I thought this would find the current sprite by UID, and pass the instance variable 'Dialogue1' to the function - REGARDLESS of which object came into collision, it would find that object's 'Dialogue1' and pass it on ... but no matter what I try it says there's something wrong. Ideas?

  • Ah ok.

    Thanks!

  • Hi all. Is it possible to select a sprite's UID in an event without naming the object explicitly? For example, I want *any* sprite that walks into an area to send their instance variable to a function. At the moment, I have to pick the object explicitly via: System > pick nth instance > Object + UID. But I need to be able to say "no matter what the object, get instance variable Text1". Is there an option for this?

    Reason being, I'm building a test-dialogue system, giving each sprite their own dialogue, and having it sent to the dialogue modal when the dialogue function is triggered. While it works well for simply talking to one instance and hardcoding them to send their dialogue over, I could streamline it greatly by having all sprites dialogue named similarly "Text1, Text2 etc" and simply having the function call the current object's Text1 or Text2. I don't know if this is possible, but I've had a hell of a time trying to find out. X)

    I hope this makes sense. Help would be mucho grande.

    Regards,

    J

  • Thank you all! I got it, and ugh I feel so stupid ... I was looking for the pick condition in System and not on the object itself ... -.- always simpler than you think.

    Codah yep, hehe was the first thing I did when I started construct. Thanks though.

    For anyone else having problems with this, here's another thread with the problem & solution: . scirra.com/forum/passing-a-sprite-or-reference-to-to-a-function_t87399

    And here's a screenshot of how this function looks now:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks a heap for the quick answer nimos.

    Sorry to say I'm still a complete beginner though, and I'm a bit lost. I get the logic of what you're saying, but I'm not sure which command I use to pass those UID's on - could you give an example so I can see what the value should be?

    I just read the manual and about 5 forum topics but it's all a bit advanced and not quite the same issue. X) Sorry for the trouble, and thanks again.

  • Hey all. I've searched around but as yet haven't found anything to help, and I've been trying to get this for a few days now...

    Basically I want to spawn multiple instances of a crab, and have them all wander around independantly. I can (of course) get this for one crab, but if I try and spawn more, then they all behave as one. I'm sure it's a simple solution but it's driving me nuts. (Oh yeah and I'm new to Construct, could you tell? )

    Should I be picking them from the UIDs (I can't figure out how to do that either), or should I be structuring this all differently? Stuck, I am.

    Any help would be much appreciated!

    Here's a screenshot of the event sheet: