Lou Bagel's Recent Forum Activity

  • I still haven't figured out the answer to the two above questions but have another issue that thought may be related:

    My AJAX post request is successfully submitting data to the mySQL table (I can pull up the table and see the entry added) but the events for the On tag error are firing instead of the On tag completed.

    How does Construct determine whether the POST was successful?

    I thought it was just doing this when previewing but I exported and uploaded to same server (as the table) and still having the error events firing.

    Thought this could have to do something with the Data field I'm leaving empty...

    I am still searching the forums and tutorials for a solution but most examples aren't detailed enough or are old and don't have the DATA field.

  • Found a simple Regex example and modified, does this encompass everything I need:

    RegexReplace(Entry.Text, "\W", "g", "")

    I don't understand much Regex at all—most of the Regex examples/tutorials were over my head atm but— finally found a message board post that helped after sifting through a bunch I couldn't grasp.

  • I'm not familiar with Regex but I fear I may need to learn quickly for this. I was hoping I could accomplish this with replace(), another expression, or a feature of a text(input) box that disallows special characters.

    I know:

    replace(src, find, rep)

    Find all occurrences of find in src and replace them with rep.

    But can you have multiple options for find? With no success I tried:

    replace(Entry.Text, "/|?", "")

    replace(Entry.Text, "/"|"?", "")

    replace(Entry.Text, "/""?", "")

    replace(Entry.Text, "/"&"?", "")

    I know I could layer them:

    replace(replace(Entry.Text, "?", ""), "/", "")

    But that seems tedious if I need to do all special characters —> !@#$%^&*()_+-=[]{}|\;':",.<>/?

    Purpose is for passing text via AJAX to php file (to submit in mysql table). I remove special characters in the php script but want to avoid any errors in passing the values to the php script. I'm pretty sure that at least = ? & would disrupt the URL. I could research to narrow down eliminating only the ones that would disrupt but would rather be safe and eliminate them all ... as who really needs any of those special characters in their name.

  • I have a lot of instances of the same object in my current project. I assign an instance variable to the latest created - and a global variable to match the latest created object.

    When an instance of a particular object is created, I use an instance variable (called ActorID) that is set to the current "actor.count" as well as the global variable.

    Maybe something like this will help?

    Variables are awesome...

    ~Sol

    I agree. Variables are definitely the concrete solution if needing to track something and worry about picking which instance.

    For this issue it is a bullet basically, so set it and forget it. No tracking needed.

    I think I figured it out—this post was kind of a process of elimination line of thinking to rule out this as the problem.

    Thank you for the comment—I will probably end up using that idea in a future scenario.

  • What is the DATA field used for?

    It isn't clear to me after reading the Construct Manual on it and most examples I see are from old versions and don't have that field.

    Is it to move the "?category1=data1&category2=data2" from the URL field to the DATA field? If so, is there any advantage to doing so? Or simply for organization?

    Bonus question: After a AJAX post is a return text/value stored in AJAX.LastData? Such as: echo 'success'. Separate question and testing it out now but thought anyone answering the first might know...two birds/ajax with one stone/post.

    Thanks

  • This part I haven't changed:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That shouldn't happen. The spawned item would be the most recently picked. If the subsequent actions are at the same level or lower, it should work. You'd have to show a solid example for further help.

    That's what I thought as well. I have just changed the only other events that could be the cause and am going to retest. Problem was it was happening rarely so might take a while to see if it happens again.

    If it is still happening I might look at using the "on created" trigger.

  • korbaach yes, that sounds like the simple straightforward solution that I thought I must have been missing

    I'm not at home to try it out right now but I am pretty confident that is the best solution and won't cause any issues. Thanks!

    Side note: I'm surprised that googling "Construct 2 wallclocktime/wall clocktime" doesn't have any helpful top results such as the System Expression page. If you didn't note there that it was from the system expressions page I would not have found it. I find it very difficult to find the desired material whether it be from Scirras internal search or external/google search.

  • You could also maybe not *completely* pause the game... just set timescale to a very low amount (like 0.001 - or something) and have a wait time there to suit. It would be such slow motion it would appear paused, but not really be paused. Maybe?

    ~Sol

    This makes sense and will give it a try. Don't even have to do the math myself, just times it my timescale (wait 2 seconds: 2*timescale).

    Thank you

    I guess the only concern I can think of is I have my gameplay events disabled (all in a group that is deactivated while paused) and one of my timers does happen to hit in that microsecond. Seems low percentage but still possible. The event for the timer would be disabled. Is there a way to pause all timers? Or would you have pause each individual objects timer? A for loop for each active timer would be good if that's possible to do.

  • Have you use tag before ?

    I dont have C2 with me now...So maybe I kinda miss something but.

    Set a " tag" to pause

    then wait for a signal = the " tag"

    I'm familiar with wait for signal but I'm not sure what solution you are suggesting.

  • I suppose you can use wait for signal instead?

    I don't see how that would help as you would still have the same issues just in a different event.

  • Event Triggered

    -Spawn Bullet

    -Set Bullet direction

    Most of the time only the recently spawned bullet will be affected.

    But I have seen several times where all bullets on the screen change direction to move in the same direction as the new bullet.

    I don't have an isolated example but I don't believe I have any other events that affect bullet direction.

    Do I need to set this up differently?

    Thanks

Lou Bagel's avatar

Lou Bagel

Member since 7 Sep, 2015

Twitter
Lou Bagel has 3 followers

Connect with Lou Bagel

Trophy Case

  • 9-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies