How do I change a variable per copy?

2 favourites
From the Asset Store
Per Pixel Destruction like in "Worms" (perfect performance, no third party plugins)
  • I am going to go on limb here and try to help.

    It's a little bit hard to follow what is going on, but I think what is happening is that the function NPCInteraction2 is not doing what you expect.

    Inside of it you are checking for an NPCID property of the NPCINTERACT family but the check is not against the instance of the family that was picked when the function was called. I will check with Ashley why is that, I have a feeling that is the expected behaviour, but I will ask him to be sure.

    So what ends up happening is that all that state for showing a dialogue is being set on the wrong instance.

    To get around that, I passed the UID of the picked instance in the call to NPCInteraction2 and inside of it I added an extra condition to Pick by comparison in addition to the NPCID condition. That way you can be sure that state is set in the correct instance.

    Something similar then happens in the call to FormatDialogue, so to get around that I added a few arguments.

    In the calls to DialogueLine, FormatDialogue and PickAnswer I pass in an additional argument with the IID of NPCINTERACT family. I did that so that I would be able to use that value in FormatDialogue to use the expressions NPCINTERACT(IID).itemname and NPCINTERACT(IID).interactname and ensure the function is using the correct instance values every time.

    NOTE that UID and IID are different things.

    All of this is quite hard to explain, but I think I covered everything.

    Could you send me screenshots? It's hard to understand what's going on through text.

    Cheers!

  • I still can't figure it out.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Did you make those functions?

  • Did you make those functions?

    The functions that are within the project? Those were copied from a tutorial. I read the tutorial, understood what was going on at a pretty good level, and copied.

    Otherwise, no I have not been able to make any new functions/parameters, since I can't seem to understand exactly what I'm supposed to do based on DiegoM's response.

    I was asking for screenshots so I could get a 'clearer' idea of what was going on. I've tried my own few methods based on what I could understand out of the message, watched a few tutorials, and I can't seem to get it to work myself. I'd need Diego to send some screenshots as examples.

  • I am going to go on limb here and try to help.

    It's a little bit hard to follow what is going on, but I think what is happening is that the function NPCInteraction2 is not doing what you expect.

    Inside of it you are checking for an NPCID property of the NPCINTERACT family but the check is not against the instance of the family that was picked when the function was called. I will check with Ashley why is that, I have a feeling that is the expected behaviour, but I will ask him to be sure.

    So what ends up happening is that all that state for showing a dialogue is being set on the wrong instance.

    To get around that, I passed the UID of the picked instance in the call to NPCInteraction2 and inside of it I added an extra condition to Pick by comparison in addition to the NPCID condition. That way you can be sure that state is set in the correct instance.

    Something similar then happens in the call to FormatDialogue, so to get around that I added a few arguments.

    In the calls to DialogueLine, FormatDialogue and PickAnswer I pass in an additional argument with the IID of NPCINTERACT family. I did that so that I would be able to use that value in FormatDialogue to use the expressions NPCINTERACT(IID).itemname and NPCINTERACT(IID).interactname and ensure the function is using the correct instance values every time.

    NOTE that UID and IID are different things.

    All of this is quite hard to explain, but I think I covered everything.

    For the UID part, is this what you're asking me to do? I'll try and read some beginner documentation specifically on UIDs, but I don't really get what you mean--

  • Correction, I think I've figured it out! I'll keep you updated.

  • Correction, I think I've figured it out! I'll keep you updated.

    The call already seems to include the NPCUID.. Would it be okay to add another call that calls the specific picked UID?

  • I've messed around, and this seems to work so far.

  • I can't figure this out past this part. I need help, if someone could tell me what to do next, that mean everything.

  • Like I said in my original response the picked instances get lost between functions. There's no point adding the condition to a function that already has it, the problem is with the functions that don't have it like the format dialogue function.

  • Like I said in my original response the picked instances get lost between functions. There's no point adding the condition to a function that already has it, the problem is with the functions that don't have it like the format dialogue function.

    Like this?

  • Like I said in my original response the picked instances get lost between functions. There's no point adding the condition to a function that already has it, the problem is with the functions that don't have it like the format dialogue function.

    I've added the condition as a sub-event to each function. What should I do next? It doesn't seem to be working. :p

  • Here, I'll share the project so you can look through it. I've only edited eFunctions & eGameRoom

    The room with the trashcans is testroom4

    drive.google.com/file/d/1sKAPxkhu0CFTRCH5zrkLjsvVAOb-KjI_/view

  • I can't really help any more on this because you added in a really convoluted set of events from a tutorial and I'm not going to spend time to try to understand them. In general though the problem is as I mentioned the picking of instances inside functions. If I was to make a dialogue system it would be just a few events not hundreds like this tutorial.

  • I was following a tutorial by Laura. If there's a simpler way to do this with dialogue, I'm all for it. I'd just like to have this done as soon as possible. I'm sorry if I've made it too hard for you to understand.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)