Ocsid's Forum Posts

  • > Problem: I wish to store the images in a prepared sprite like - "Load from URI(Sprite.CurrentImageAsURI)"

    Why'd you like to store it in a prepared sprite? Is there a reason you cannot use an ajax request to load the image? If you only want to load the image once, you can store it inside a binary data object and load it from there.

    And for changing a variable to change the theme, that's also possible with this approach. You can request a URL with ajax rather than a file, that you can point to the local resources by string and just add the global variable in the name. So you'd request "stringsub("./tiledfile{0}.png", globalVar)

    This would request e.g. tiledfile1.png or tiledfile2.png or tiledfileVolcanotheme.png, etc.

    I wouldn't attempt approach 2.

    This is great!

    Nice touch with the new stringsub.

    Thanx for the help!

  • Hi all, time again for me to ask for the "impossible".

    I use Sprite Animations as "Theme" for my game.. it's simple to have a global variable and easily change the whole UI by setting all sprite animations to the corresponding theme.

    However, one of the UI objects needs to be tiled.

    Approach 1:

    Use a TiledBackground and "Load image from URI"

    Problem: I wish to store the images in a prepared sprite like - "Load from URI(Sprite.CurrentImageAsURI)"

    Approach 2:

    Use a Sprite and trick it to tile the image instead of stretching it.

    Problem: Option does not seem to exist.

    There are probably other nice ways to change theme functionality, by using families or arrays, but I really like the stucture with animations.

    Thanks for your time.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi.

    No, layers should not be the cause for low performance.

    Check out the performance tips in the manual:

    construct.net/en/make-games/manuals/construct-3/tips-and-guides/performance-tips

    If you could share the project I could take a look at it to see if I can find any of the usual suspects. (If i get the time)

    Hope the manual will solve some of it for you.

    Cheers!

  • A couple of months ago I submitted a suggestion of an improvement to Construct 3.

    construct23.ideas.aha.io/ideas/C23-I-290

    I'm writing here now to see if there is any "regular user" interest in the idea, since not that many common users browse through the suggestions.

    It's about the fixed initial size of 250x250 when creating animations, and how it could be improved to match the project preset.

    Please check the link and let me know what you think.

  • I have a bunch of sprites called MoveMapper, they are all children in a chain.

    Something like this: P->C->C->C->C->C

    I start at P, run some code, and if a boolean is true I select the child and call the same function with the UID of the picked child.

    Not working:

    However, MoveMapper trying to pick children of MoveMapper-type does not work.

    I have found the work-around using families, and it works. But I'm not fond of that solution, perhaps someone here have a nice alternative where faimilies are not used?

    Working work-around.

  • This is really complicated stuff if you are a beginner.

    "the server" - if it's yours...

    - does yoour router have port forwarding?

    - is your ip staatic?

    - what os is your server running?

    - php or asp?

    - is the server settings using the correct MIME types?

    - is it set up to accept "POST" from foreign IP's? (make sure to have security to match the settings)

    When that is done you will have to write the code that handles the recieved data as binary and store it in correct format.

    Perhaps it would be better to look for alternatives?

    If you still wish to proceed, google is your friend.

    try:

    - "how to set up php server"

    - "php save POST to png image".

    Please note that nothing of the above is directly related to construct so you will have to get the help from "personal server" forums.

    When all that is done, (could take a couple of weeks if you read thoroughly), have a look at the AJAX documentation here:

    construct.net/en/make-games/manuals/construct-3/plugin-reference/ajax

  • You can do the other way around

    Of course! Now I feel silly. LOL

    I've been using hierarchies for some predefined setups but wanted to experiment with dynamic setups that can be built upon and expanded, templates would work nicely towards that but apparently I decided to wander into a dark alley instead. :-D

    Thanx!

  • Assuming you have the scroll to, focusing on the player, check the imagepoint or hotspot position in the animation editor for every frame in the animation causing the shake.

    Also take a look at the collision box, perhaps its uneven, or smaller in one of the frames.

  • Thanx for advice.

    I could make a dictionary or an array, or just a comment on what part should go where.

    But I really hoped there was a way to extract the name from a given image point.

    The plan was:

    Sprite Player with imagepoints for:

    ArmL1, ArmL2, BodyU, BodyD etc.

    Sprite Parts with animations named:

    ArmL1, ArmL2, BodyU, BodyD etc.

    Have Player Spawn Parts and set the animation name to match every image point name.

    Perhaps I'm overcomplicating things...

  • Perhaps play around a bit with system.timescale.

    You could also exclude the aim from slowdown by setting object timescale back to 1.

    It could be easier to manipulate the reticle if it was a sprite, and mouse pointer just hidden.

    Thinking something like:

    Local variable AssistX = 0

    reticle overlapping badguy | AssistX = (reticleX - Mouse.X) / 3

    reticle.X = mouse.x + AssistX

    (same goes for Y)

    I'm not sure at all about the math, but it should be easy to trial and error, the division is thrown in to make the aim just "nugde" in the right direction.

    The hitbox of the reticle would also play a part in how much the aim would be affected.

  • You can use the AJAX object in construct to SEND/POST data.

    After that its up to the recieveing end to handle that information.

    You could set up a server and create a page to recieve the data from your program and store it as you desire, but that is not covered in construct.

    Most services available would block the POST data from your program since it would be a security issue to open up the service to accept data from anywhere.

  • I'm trying to loop through a sprites image-points,create objects and set:

    SpawnedPart.AnimationName = Sprite.ImagePointName(loopindex("Parts"))

    This is meant to be executed between plenty of objects so I thougt this would be a failsafe way to approach it to avoid ImagePoints being in wrong order, rather than making references to numbers which could be more vulnurable to human error.

  • If the image name is the same it will not load.

    add a suffix to the end of the name.

    example

    yoururl.com/image.png?1

    yoururl.com/image.png?2

    yoururl.com/image.png?3

    Such a simple solution, I've been struggling for quite a while now.

    Thank you my friend!

    Added a global variable called suffix that increases with every load.

    I take it the cache problem goes away with every restart and there will be no problem reusing suffix between runs. (?)

  • I have a sprite.

    I load image from url, "1.png".

    ...Some time passes... (and the image on the server has been replaced by another.)

    Same event runs again, load from url, "1.png".

    But the sprites image does not update. (restart of layout does not solve, but stop/start new preview does.)

    I have tried to destroy all sprites,wait a few ticks, and unload all images from memory.

    The sprite however is a template from a (unloaded)repository layout.

    The .htaccess on the server providing the png has no cache settings.

    any ideas?

  • Any ideas on how to fix or work around?

    ([outline=#eeeeee] Mitt meddelande är ganska långt [/outline])