How do I event to trigger

Get help using Construct 2

Post » Mon Dec 08, 2014 2:22 am

I am not sure what I am doing wrong here; I am trying to get an event to trigger when an object is pressed but only if these 2 variables with strings match.

Touch => on tap [object]
System => CharComp1 = VarChar => Sat array value




In the debug the variables are showing the same strings; I dont what would be causing it to not trigger. Is there a different way to format this? Do I need quotes?
B
5
Posts: 18
Reputation: 261

Post » Mon Dec 08, 2014 2:54 am

If I change the system to manually trigger it by picking the character I know it will be; I can only get it to trigger if I set VarChar to my character.

EX:

VarChar = "Rogue"
Works but
CharComp1 = "Rogue"
Does not.

Debug shows CharComp1 to have "Rogue" for its value but it doesnt condition.
B
5
Posts: 18
Reputation: 261

Post » Mon Dec 08, 2014 3:17 am

Can you provide a capx?
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Dec 08, 2014 3:36 am

I know it is is a mess; but my events on are on page 3. The situation I am worried with is at the bottom and has to do with the OYes. When that is pushed I need to make comparisons to know what player number is being saved. I have many different variables for it; but my comparisons arent working. I cant get anything to compare with CharComp1 period; but if I hardcode VarChar= "rogue" it works. But I really need


VarChar = CharComp1

This would tell me the character being used for selection is the first player so I can supply the selected items in the right array values.
You do not have the required permissions to view the files attached to this post.
B
5
Posts: 18
Reputation: 261

Post » Mon Dec 08, 2014 3:50 am

charcomp1 has a trailing space so the comparison fails
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Dec 08, 2014 3:55 am

Youre a life saver, i literally spent an hour and half messing with that. I was about to rage quit and go to bed
B
5
Posts: 18
Reputation: 261

Post » Mon Dec 08, 2014 4:10 am

1 1/2 hours is nothing :) Get used to it :D
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Dec 08, 2014 4:11 am

BTW your main mistake was....


not using the Browser object to print the values out. :)
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Dec 08, 2014 4:24 am

WHat do you mean?
B
5
Posts: 18
Reputation: 261

Post » Mon Dec 08, 2014 4:33 am

I find it an absolute must to print out debug information to the Chrome console. Unless you have some other way of doing it, I didn't look too closely.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Next

Return to How do I....?

Who is online

Users browsing this forum: Bootfit, brunopalermo, tarek2 and 7 guests