CloudDealer's Forum Posts

  • I still can't figure it out.

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

  • This also helps with a lot of questions I had in my head. I'll be using the dictionary for my inventory system!! :D <3

  • I used variable to reference all of these, but itemname and interactname are both strings. Sorry if that was confusing.

  • I'm a beginner to construct specifically, not game making. But, I can try to figure this problem out myself. The issue is that the dialogue doesn't replace the text with the proper variable.

    There's two trashcan, both in the same NPC/Dialogue family. They're referenced as an object called "openable". The programming itself works fine. The only issue is that the variable called "itemname" doesn't change based on the ID of the trashcan you're interacting with.

  • Nah that doesn't help I need to know where I'm looking in the game to test whatever the problem is. Better if you set up a room to test in that demonstrates the problem.

    Does a room like this work?

    (main_test_room4)

    Proj Link:

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

  • Most of the programming is in eGameRoom, eGlobal & eFunctions. Check eGlobalPlayerVariables if you need variables. The objects you interact with are labled as "openable" and "StaticNPCs", If you need anymore info, let me know.

  • Please remove that wind effect from the project and reshare or share a screenshot of the events used.

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

  • Cannot open the file as there is some kind of add on. My guess is the issue is picking, you need to pick the correct trashcan with conditions then the actions will choose that instance.

    Could you expand on this please? I'm relatively new to construct.

  • you could use the save and load features built into construct.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • simplified version: construct.net/en/forum/construct-3/how-do-i-8/change-stringvariable-per-169309

    They both show up in the dialogue as TEST2. Is there a way to fix this, and have each individual "openable" have their own item/variable?

    This is probably super simple, if there's a tutorial that could help, or if you can help yourself, please respond!

    PROJECT FILE:

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

  • From what I know, there's no built in system to find the original. If-- for whatever reason, you're working on that project now, and looking for the original, you're either going to have to guess, or look for it manually. If each one was configured with a different variable, I'd suggest looking for the one with the lowest of said variable.

  • Thank you so much!

  • > lennaert My question was how to find such instance in a large existing project, which may not have a dedicated layout for storing default instances. And even it does, not all objects may be there. And even if they are, the default instance may change suddenly if you change the order of layouts.

    > I was working on a big game last year and there was a very important sprite with lots of instance variables and behaviors, which was used on many layouts.

    > I intentionally put the first instance of it on a separate layout and filled in all the default properties. For example, I put these default values: variable isActivated=0, MoveTo Speed=500

    > That was working for a while but then broke. Some other instance of this sprite became the default one. So when this sprite was added in layout editor it was created with these values: variable isActivated=1, MoveTo Speed=200 I had to manually edit them and about a dozen other parameters, which was super annoying. And I couldn't find the instance which had become the default one..

    I don't know if this response helps-- But, if you'd like to use a default main character sprite/character sprite in general, make an Object Bank, and have specific "teleport points" to summon the sprite from the object bank. Therefore, there won't be multiple of the same sprite, and it will always be the default one.

    OH SOMEONE ALREADY SAID WHAT I SAID, SORRY- I DIDN'T READ EVERYTHING

  • lennaert My question was how to find such instance in a large existing project, which may not have a dedicated layout for storing default instances. And even it does, not all objects may be there. And even if they are, the default instance may change suddenly if you change the order of layouts.

    I was working on a big game last year and there was a very important sprite with lots of instance variables and behaviors, which was used on many layouts.

    I intentionally put the first instance of it on a separate layout and filled in all the default properties. For example, I put these default values: variable isActivated=0, MoveTo Speed=500

    That was working for a while but then broke. Some other instance of this sprite became the default one. So when this sprite was added in layout editor it was created with these values: variable isActivated=1, MoveTo Speed=200 I had to manually edit them and about a dozen other parameters, which was super annoying. And I couldn't find the instance which had become the default one..

    I don't know if this response helps-- But, if you'd like to use a default main character sprite/character sprite in general, make an Object Bank, and have specific "teleport points" to summon the sprite from the object bank. Therefore, there won't be multiple of the same sprite, and it will always be the default one.