Jimzip's Recent Forum Activity

  • So I tried the above solution, but I still get nothing in the array.

    There must be another problem, because the logic here seems fine. I just can't figure out what that problem is! Driving me crazy, I'm sure it's something simple.

    Here's the current way I'm doing it. Like you suggested, first I'm pushing the info into the array.

    Then I find it and change the text to the quest description (which should be at 0,1).

    But ... there's nothing in the array.

    Any ideas?? It's ridiculous. The global test variables I made get the data just fine. The array just doesn't want to play along though.

    The weird thing is, it registers *something*. The space is created, but I get the 3 commas ',,,' instead of the data.

    Jimzip

  • Thanks a heap for the explanation lennaert! I'll try this out.

    Jimzip

  • Hey all.

    I'm sure I'm not going about this the right way, and it's doing my head in,. Thus I'm turning to you, my clever fellow constructers!

    Here's the situation: I'm building a quest system for the game I'm working on. I'd like objects to hold the quest info in their instance variables. On pickup, I want to transfer that data into an array.

    Here's how the object part looks:

    Here's where things are going pear-shaped.

    No matter how I change the method, I can't get this info into the array. I can store it in other variables, but the array part is just not working. Any help? Here's the 'pulling' part:

    The disabled ones are other versions of the same thing I tried ... no dice.

    Finally, here's the loop which sets the text when the quest ui is open:

    It's mainly the middle part. If I could just get the info into the array I'd be good, but for some reason it's just not working. Hjalp?

    Ideally I'd like the array to store all the info in rows. Eg: X0=Quest Number, Y0=Quest Name, and then access that later. (Please don't point me to the manual btw, I've read it until my head hurts)! X)

    Thank you kindly.

    Jimzip

  • Oook ok I feel really stupid now. I didn't realise that objects in a family inherited unique versions of the family variables. That was what I failed to understand (even though you consistently tried to tell me)! Thanks for your patience! I am going to bed now... X)

    I must have read that paragraph in the manual 10 times, and somehow still didn't get it.

  • Ah! That's clever (the frames solution), I never would have thought of that. Thanks a bunch! I'll rejig things and let you know how it goes.

  • Hey Blackhornet. Yeah but that's the thing ... X) I can pick the collision object by UID fine, but it still doesn't work. I think I've been explaining this wrong, so let me use the magic of my super mad illustration skillz!

    Here's what I'm after, and what I currently have:

    [attachment=0:10lm8r2w][/attachment:10lm8r2w]

    Now this is the thing: Each object's 'Dialogue1, Dialogue2' etc contain different strings. (Otherwise this would be pointless X) . I named the variables the same in each object so that the function could access the picked object's Dialogue1 no matter if it were Object1, Object2 etc. That's the actual goal here.

    And the code:

    [attachment=1:10lm8r2w][/attachment:10lm8r2w]

    So as you can see, when I try to pick the object's variable 'Dialogue1' it complains that it's erroneous. I saw an 'out of scope' message at one point ... this means it's picking the object, but can't see that the object has variables, right?

    hehe yeah I know. But the aim of this is to get a variable from an object within a family without having to hardcode 'tell object1 to send it's variable to xxx'. The challenge is to pick Dialogue1 from no matter which object I collide with. Thanks though.

    If you've already understood and posted the answer, and I somehow just didn't get it, let me know. But I tried what you suggested and still nada. Thanks again! (And sorry for bringing you back here again!)

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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:

  • 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:

Jimzip's avatar

Jimzip

Early Adopter

Member since 15 Jun, 2014

None one is following Jimzip yet!

Connect with Jimzip

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies