blurymind's Recent Forum Activity

  • i couldnt find a single example of a dialogue system in scirra that is manageable. The complicated examples (dictionary,jason file,etc etc) are all in words and not one capx file to look at. The ones posted lead to dead links :(

    I just want to make an NPC that can be instanced and reused with different text.

  • Hi, is it possible to get the value of a variable whose name was acquired through an expression?

    ----

    So basically my npc text is split into 10 npc.row1 npc.row2 and so on text variables.

    I also have a curRow variable that gets +1 every time a button is clicked during npc conversation.

    As a result I have to make 10 sepparate curRow conditions -for each row variable to update the text in the textbox with it's value.

    Is there a better way to do this?

    Basically I want to add another variable called curText. And say

    npc.curText=npc.row2

    where the 2 at the end of curRow is the npc.curRow value. Is this possible to do in an expression?

  • TokenAt() is a good way to do that. Then C2 manual say:

    tokenat(src, index, separator)

    Return the Nth token from src, splitting the string by separator. For example, tokenat("apples|oranges|bananas", 1, "|") returns oranges.

    tokencount(src, separator)

    Count how many tokens occur in src using separator. For example, tokencount("apples|oranges|bananas", "|") returns 3.

    So, rather than "(av:james) Hi my name is james" you might just want to have "james|Hi my name is james"

    then tokenat("james|Hi my name is james",0,"|") will return the avatar, and tokenat("james|Hi my name is james",1,"|") will return the text for him to say.

    You can chain together strings, using different tokens if you want.

    "james|Hi my name is james#susan|Hello there!#ben|Good day, eh?"

    just be sure to use tokens that wont appear in your text, or if you are going to pass the strings to php (to save in a database) don't use a symbol that may cause trouble there (like "&")

    This is super awesome!! Much rep to you sir. :)

    What a great solution. And thank you for taking the time to explain how tokens work <img src="smileys/smiley12.gif" border="0" align="middle" />

  • Hi, can you elaborate a little bit more? I am still learning this

    :)

    I was thinking of using the find() expression but couldnt find any examples of that in action.

  • Hi, I am currently making an npc system and using string variables to input text.

    So what I need is to also use the same string variable to call an avatar image while the npc is speaking. The string variable may look like this:

    "(av:james) Hi my name is james"

    Basically I need to tell construct to not print out the part of the string variable that defines the avatar(av:james). And at the same time use (av:james) as a condition to display the avatar of the character james.

    Is it possible to make construct check a string variable for a keyword and if it's in the string variable, to remove it from the printed text.   <img src="smileys/smiley1.gif" border="0" align="middle" />

  • If a family has an instance variable each member of the family has the instance variable. you can adress the member directly, but you can also adress the family. so the variable can be different for each member of the family.

    I tried it on a simpler situation and it works as you said.

    But i am a bit confused about this set up still.

    To clarify:

    Calling an object through the family simply adds the "any" to the condition.

    So in your set up its saying

    If the picked object is overlapping with any object from that family with a value set to x, then do this to the picked object.

    In this case families are extremely useful and what you just showed me makes my life much easier in some of the other things I want to implement.

    How does this work on triggering a change in variable level?

    If I trigger a change of a variable on a family level - it changes it for all the children?

    <img src="smileys/smiley32.gif" border="0" align="middle" />

    Much rep to you sir for showing me this!!! Sorry it took me a while to figure out

  • I tried using the alertmode variable in the family enemies instead of in the enemy object. All the enemies froze to disabled.

    how does the alertmode variable of the enemy family relate to the alert mode variable of an individual instance of an object from the family? Dont I need to set up some sort of an extra event which will constantly feed one into the other somewhere along these lines?

    It seems to me that is a sort of an ugly solution to something as simple as comparing a variable between two instances of an object. <img src="smileys/smiley5.gif" border="0" align="middle" />

    I am not being lazy here. I simply have no idea how to make your solution work.

    <img src="smileys/smiley19.gif" border="0" align="middle" />

  • i didnt really replace it completely yet. Just created a test variable instead. To move the alretmode variable to the enemy family, i have to also change it everywhere in the code where its a condition and where it is set.

    Will do that if I am sure that it will do something. But im not sure how to do it because not sure how it does it.

  • dl.dropboxusercontent.com/u/114119373/a-STUFFF/problem.capx

    so basically the green columns are sight blockers. I have two enemies- both patrooling in 2 perimeters.

    To test it, let the first one see you and then walk to the right until you push it past the green column where the second enemy's parameter is. The second enemy must also become alert when seeing his alert comrade somehow.

    thanks in advance <img src="smileys/smiley17.gif" border="0" align="middle" />

  • is there an example capx file anywhere to see comparing instance variables in action?

  • damn, I cant get it to work that way either. :(

    Something must be wrong in the way I am going it

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • is there a way to keep the animation code separate from the behavior code?

    :)

    Should I move the alert mode variable to the family and remove it from the enemy object inside the family?

blurymind's avatar

blurymind

Member since 6 Dec, 2013

None one is following blurymind yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies