How do I event to trigger

0 favourites
  • 15 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • 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?

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

  • Can you provide a capx?

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

  • charcomp1 has a trailing space so the comparison fails

  • Youre a life saver, i literally spent an hour and half messing with that. I was about to rage quit and go to bed

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1 1/2 hours is nothing

  • BTW your main mistake was....

    not using the Browser object to print the values out.

  • WHat do you mean?

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

  • I guess I am not sure what you mean by print out. I use a browser to look at the values. Is there a better way to look at out outs?

  • I mean displaying values in the developer console that you get if you hit F12 from Chrome. Do you mean the debug panel? That definitely has its uses but also its limitations.

  • Hey coadh I have a question for you if you have time.

    I am using functions to call different "Are you sure menus"

    The problem I am running into is I can call a function to create the menu; but the function its self cant be used to determine what object is pushed in that menu. So if I have multiple or different values for the "no" button it will cycle through the code using each no until one causes it not to work. Is there a way I can I can make a specific portion work?

  • Hey you should tag people (also spell their alias right ) so they know they got a response

    I'm not entirely sure I know what you mean. So you have instance variable(s) on the button? If you could isolate the issue in a small capx it would be easier.

  • Haha, I didnt know I could tag you. I tried to message you but it wouldnt let me. I have class all day so I cant make a capx until later.

    But til then; I have a bunch of objects on the screen as weapons. When a player clicks a 1h weapon it calls one function, 2h a different one, and an off hand another function. I need this because they all will check for different array values if there is a weapon already or not etc. So a 2h cant be paired with a 1h. The problem I am getting is that inside the events of a called function I cant use

    "On tap gesture" it changes to "is touching" and that definitely doesnt work for what I need because the menu is destroyed and the code moves on.

    I didnt want to hard "Code" each individual menu exiting commands in their creation but it seems like Ill have to since I cant use the correct touching condition while in a function.

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