jsutton's Recent Forum Activity

  • I'm at a loss on this one. For whatever reason this loop leaves 1 empty element.

    I can reverse/sort and just pop it manually. But, would like to understand what the heck I am doing wrong.

    (I also did this using loopindex and for each X, ... same results, it leaves 1 empty element.)

    Any clue?

  • Not sure the exact cause, but a couple suggestion.

    1. Check your collision polygons (sometimes they start with bizarre shapes).

    If that doesn't help

    2. Check your "condition" (on collision, is overlapping, etc.) you might need to add a distance if the collisions are not happening as you like (or use an offset, etc.)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Line of sight would allow your enemy ai to acquire it's target (your player). Pathfinding could be used to have ai move towards the player (which you could update occasionally to see if the player or any obstacles have moved). Then once the player and ai are within your specified fire distance have the ai shoot. You might look at the turret tutorial as well for the ai fire angles, spawning bullets, etc.

    It's all about what you want. If there are no obstacles, or if you just want it simple, you could move towards player x,y. There are about 50m combinations you could use for what you want to do, it's personal preference.

    In your case, I would pull up the "Ghost shooter tutorial" and save it as a new file. Then test different ideas using it as your base-code.

  • Let me withdraw the question for now. I need to make a capx with a couple examples and share it.

  • Yes sir, ty. That is the name of the project. But the file? I can't find it anywhere without closing and load from location on cpu.

    On C2 the file was shown at the top of the program.

    (I usually save by the day [fileday1,2 3, etc.] just to have a backup, and without closing and reloading one really has no clue what file they are working in on the browser...that I've been able to tell. Which the other day I worked in the wrong file for most of the day, it was great :(

  • I know this this dumb, I feel dumb for asking.

    But, on C3 in a browser, how do you tell what file you have open???

  • savvito123

    I'm using php (transfer) and phpmyadmin (database), not sure what you're using.

    Using binary, filechooser, drawingcanvas, and ajax.

    filechooser to get the image and set a sprite from FileChooser.FileURLAt(0) (resize, etc)

    created drawingcanvas(dc) at the sprite x,y , drawingcanvas.paste, save as png

    On dc save set ajax response binary, then ajax request DrawingCanvas.SavedImageURL

    Once the ajax runs, set a variable to BinaryData.GetBase64. This variable can be used to pass the image.

    10mb phone pictures = 50kb base64 text, not tiny but much, much smaller and without much loss of quality.

    Later, when you need the image just pull the base64 string from server (using php) and load it into a sprite with BinaryData.GetBase64&ajax.lastdata

    If you want to save an actual file somewhere on the server, I'm not sure how to pass that in php but found a link.

    construct.net/en/forum/construct-2/how-do-i-18/save-json-file-server-119259

    (I ran into issues with passing this variable to the server because I didn't realize, in C3 an ajax "post to url", the URL line of ajax is a GET and the Data line is POST [meaning you have to adjust the $_GET and $_POST of the php file accordingly. Sending 50kb as a GET will be rejected by most servers (error 414 exceeds url length limit), but POST is allowed.)

  • Finally wrapped my mind around this. It requires a GET/POST using the c3 ajax post as binary

    (The URL line being the get and qualifier - for the POST [which is the binary data])

    Your job is done Ashley! lol, and thank you for the education.

    Unfortunately, for saving to server with php it will not work without some heavy manipulation. Which is fine, the drawingcanvas save feature works very well as an image compressor and base64 string is easy for php to handle.

    Thanks again for the information.

    PS

    "The protocol blob or Object-URLs can only be generated by browser and these URL's can only be accessed / managed in the same instance / browser , which generated them.

    Therefore, it is clear that PHP does not have access to URL created.

    On the other hand, you can send the file created by the xkeshi/image-compressor library via ajax ( XMLHttpRequest )."

    So it is something that can be done.

  • Pull up the templates: top down shooter, line of sight, and pathfinding.

    Those 3 cover everything you're looking to do.

  • Have you considered the car behavior with waypoints? The driving template has details and there are several nice tutorials.

  • Not sure if this is a general or a how do I question, more of a best practices type of question.

    I have a chat bar that has a icon (sprite) of the person posting the message before the text.

    If one uses a function to space the chat:

    call function, create sprite x,y, create text x,y and then loop

    create sprite2 & text.height + a spacer (setting the spacing for new sprites and new texts)

    the new sprites are created at the original x,y (due to the function happening in one tick and no time for the new x,y or height settings to apply. A loopindex, etc will not work either...same issue as above.)

    My question is this, other than doing a function & local variable, thus calling function 2, 3, 4 etc. or by long coding the chat. Is there any other way to get the proper spacing of newly created items?

    (Hopefully this question isn't too confusing. I've asked this question before and never gotten a definitive answer.) Regards

  • 99% of my sprites are user generated. Ended up using the drawingcanvas, let the user manipulate the sprite before they save it to the server. (cut down a 9mb upload to about 43kb) still big but much better.

    Just a note for anyone finding that sometimes the base64 files work properly and sometimes they fail to load...

    URLEncode is a wonderful little tool.

jsutton's avatar

jsutton

Member since 31 Mar, 2015

Twitter
jsutton has 1 followers

Trophy Case

  • 9-Year Club
  • Forum Contributor Made 100 posts in the forums
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies