get a variable name with an expression

Get help using Construct 2

Post » Sun Jan 19, 2014 7:56 pm

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?

blurymind2014-01-19 19:56:48
B
38
S
14
G
4
Posts: 426
Reputation: 5,686

Post » Sun Jan 19, 2014 9:44 pm

If your goal is to make a system of storing and managing dialogue you might want to check these threads out:

http://www.scirra.com/forum/dialogue-best-practices-and-where-to-store-text_topic65280.html

http://www.scirra.com/forum/npc-dialog_topic48355_post303797.html

Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,187

Post » Sun Jan 19, 2014 10:08 pm

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.
B
38
S
14
G
4
Posts: 426
Reputation: 5,686

Post » Sun Jan 19, 2014 10:14 pm

I would choose the option of giving the npc an array in a container, that way you can set it to different text for each instance.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jan 19, 2014 10:26 pm

is there no way to just use a bunch of text variables (rows) then?
I want something that will later be super easy to change on each instance.
This whole array business sounds like hardcoding dialogue inside the event sheet rather than on the instances.

My goal is to keep all the dialogue text outside of the event sheet blurymind2014-01-19 22:27:22
B
38
S
14
G
4
Posts: 426
Reputation: 5,686

Post » Mon Jan 20, 2014 11:03 am

Is it possible to have the dialogue text of npcs in a spreadsheet (csv) and to just load it in NPC instances with a variable.
There was something mentioned about it at this forum, but no example files anywhere.
It's really really hard to do the simplest npc dialogue box. This same thing is extremely easy to do in rpg maker engines for example.
It's an often requested feature and rarely have i seen it implemented well with construct.
Wouldnt it be great if someone wrote a behavior for construct that mimics the way NPC dialogue is handled in rpg maker?
B
38
S
14
G
4
Posts: 426
Reputation: 5,686


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, DuqueKarl, Vinterstille and 2 guests