brent_hamel's Recent Forum Activity

  • Awesome :) I'm so glad it helped!

  • If all of your in-game text are sprites, ie the text for Mystery 1 is a sprite with text in its image, etc. Then you would store them the same way I mentioned storing the item image reference in the array. So either store the frame of animation the mystery sprite needs to display in the array ( Mystery 1 = animation Frame 0, so "0" would be the value stored ) or save the object's instance UID ( sprite_Mystery.iid ) into the array ( though you'll still need to make sure to set the right frame of animation, assuming all Mysteries are saved as seperate frames within a single object ).

    Then as I mentioned before, everything you need for a given Mystery is saved in a given Y position in the array, where each X is storing all the individual parts of the Mysteries.

    So for example:

    MysteryDataArray

    X0, Y0 = "0" ( sprite_Mystery.animationFrame )

    X1, Y0 = "0" ( sprite_Hint.animationFrame )

    X2, Y0 = "0" ( sprite_SolutionItem.animationFrame )

    X3, Y0 = "5" ( sprite_incorrectItem.count )

    So what this does, is it stores the animation frame for Mystery1's mystery text object in the first X position, then it stores the animation frame for Mystery1's hint text object in the second X position, then the frame for the solution item that you need the player to click, and finally the number of "wrong" items that will appear in the scene along with the solution.

    Then when you make your scene. You'd create an instance of your mystery text sprite, and "Set animation frame = MysteryDataArray.At( 0, CurrentMystery )" ( CurrentMystery could be a global variable, or an instance variable for a separate object that keeps track of what mystery the player is on ), then repeat for the Hint and SolutionItem sprites, finally do a "Repeat X Times" loop to create and randomize the frame for the incorrectItem sprites, where X = MysteryDataArray.At( 3, CurrentMystery )

    As a side note, I'm not sure if this is helping, or just confusing you... I'm stupid busy for the next couple weeks, but after that I can look at making you an example.c3p if that would help. I'm sorry I just can't afford the time at the moment :S

  • You could use 8 Direction Movement to have your AI Units move around if you want something straight out of the box. Or you could use the "Move At Angle" action and do you're own movement system, though keep in mind that this won't recognize solid objects as barriers, so you'd have to do your own collision checks. I'm not sure what skill level you're at, but there are lots of different options here :)

  • Yup, you're right, it was simple lol ugh... Thanks!!

  • Arrays in C3 can only hold values, not objects. So to try to store sprites in an array is impossible...

    If I were going to try and put together a scene with key items placed randomly, that the player needs to spot and then click on, I would probably try this approach first:

    - have a single sprite for all the items in your game ( depending on how many there are, this may be inefficient ), then load the items for a given scene into an animation in that sprite, that way, for a single scene, you're simply creating instances of that sprite, and setting the frame of that scene's animation to match the item you want to display.

    - create those sprite instances with randomized placement ( you can randomize along a tile grid size of your choosing, all the way down to individual decimals between pixels, it depends on what you like the look of )

    - fill the array with the frame numbers (or InstanceID's) of the items you want the play to find

    - when the player clicks on an item, loop through the array to see if any of the stored values match the item clicked. If there's a match, remove the item from the scene ( I like to make things invisible rather than destroy them ) and update the player's progress ( score, items remaining, etc ), and if there's not a match, simply do nothing, or maybe penalize the player somehow ( set a timer so they can't click again until the timer is up to prevent spam clicking, or maybe have strikes where if you have a wrong click, it counts as a strike, 3 strikes and the player it out kinda thing )

    That's where I'd start. I'd only use the array to hold the values to check against when the player clicks an item. Everything else is all is stuff that can be done pretty simply at the start of a scene. Hope this helps :)

    EDIT: I just re-read the initial post and think I may have misunderstood slightly, I'll leave the original reply in case its still applicable

    If you want the array to store the mystery and hint, then I'm assuming you're simply storing text?

    eg:

    mystery = "I sit with my hands on my face"

    hint = "I'll always have time for you"

    answer = image of a clock ( this can be the animation from or InstanceID I was referring to above

    So I'd set this up so that each of these values would have its own Y coord in the array, so Y0 is all of the mysteries, Y1 is all the hints, Y2 is all the InstanceIDs of the item image you want to display.

    Then each X of the array is a different mystery. That way when a new scene starts, you can use smart random ( so it won't pick a number that's already been chosen) to select an X coord in the array, then you just look at each Y value for the different parts of the mystery itself.

    Does that help?

  • I personally like to use the idea of states. The idea being that a unit ( in this case your enemy ) is always in a state of existence. Possible states could be:

    - "Idle" ( sitting there doing nothing )

    - "Patrolling" ( maybe going back and forth between 2 points on the map )

    - "AwareOfPlayer" ( possibly looking at the player/paying attention to what the player is doing )

    - "AttackPlayer" ( actively trying to damage the player )

    - "ReactToDamage" ( reacting to taking damage from the player )

    - etc, etc

    Then its just a matter of putting together whatever conditions you want to have met, to trigger a new state. Like getting hit by a player bullet would trigger "ReactToDamage" for example. The player being too far away from an enemy might mean the enemy defaults to "Idle" or "Patrolling". Perhaps an enemy that is "Patrolling" will stop sometimes and be "Idle" for a few seconds and then go back to "Patrolling" again. The possibilities are pretty much limitless :)

  • So, total noob question here... I need to be able to load a new image for my Tilemap object on the fly.

    My current approach ( which is not working is ):

    - Request URL

    - tag "loadNewTileset"

    - url "myNewTileset.png" ( which is already in my project under "Files" )

    - On "loadNewTileset" completed ( this never happens )

    - Tilemap - load image from "AJAX.lastData"

    I need the file as a URL because that seems to be the only way the Tilemap can load a new image... So unless I'm missing something, I'm totally stumped... the On Completed trigger never fires... This is intended to be an offline desktop/console game, so the game will never connect to an external server of any kind, meaning that no project files will ever be stored anywhere but on the user's device locally. Thoughts?

  • Apologies if this is posted in the wrong place... I'm just wondering if anyone else is experiencing extreme browser lag when using Construct3, but only when the editor popup window is open? So like, creating instance variables, or adding any events that have input fields... To be fair I tend to be a multi-tab browser user, and I often have youtube stuff playing in the background while I work. Doesn't seem to matter how many tabs I close, when the popup is open, there's a significant delay in typed letters appearing in the input field, or it forces youtube videos into pausing and trying to load... or even starts creating hiccups in mp3s playing through winamp... I've only JUST started experiencing this, but I can run full bore Photoshop, Adobe Premiere, Blender, etc often multiple running at once, with no issue... so I just thought I'd check to see if anyone else is getting this or if its just me.

    EDIT: this may or may not be related, but I also cannot save in any way except for "download a copy" this was never previously an issue, but has been happening for about a week now (the browser lag has been about a week as well) its a local file I use, but must download new copies and replace the local file every time I save... slightly frustrating, again, might be my machine, may not, I'm not sure

  • Another option that just occurred to me MIGHT be to switch the character from Platform to Physics (have them both on the character and just toggle a boolean which switches between them) but you'll need to get the physics settings right, which will take experimenting.

    I have no idea if this would work or if it does, if it would be in the way you want, but it MAY be an option.

  • The way I like to handle slopes using the tilemap, is to detect the specific tileID that my character is standing on. I check directly using XY coords converted to TileXY coords. Once you know the tile the character is standing on, you can program specific things to happen.

    If using the Platform Behaviour, you could then change values like:

    - acceleration/deceleration based on the playerDirection VS slopeDirection and slopeAngle

    - this can simulate fast decent downhill or slow climb uphill, kind of similar to ice physics

    - you can have different settings for if the player is trying to stand still VS trying to move

    - adding/subtracting with vectorXY (to "push" the player downhill)

    - the player may be trying to run uphill, but adding vectorValues will push them downhill at an amount related to the player's input

    - change GravityAngle

    - this can be tricky, as you've got to have collision boxes set up so they don't "catch" on each other

    - however if set up properly, this can reduce the need to fuss with vectorXY or accel/decel

    - or it could be as simple as you program a specific forcedControl when the player holds DOWN and the character is standing on the slope, like how the slide in Mega Man 3 works. It literally pushes you left or right, and stops when the slideTimer runs out AND Mega Man isn't in a single tile high passage, otherwise it keeps the slide going until he can stand up again.

    Not sure if any of this makes sense of not, if not then I can try to be more specific. Or if this brings up more questions, please feel free to ask.

  • Is your slope collision being done with a sprite object or the tilemap?

    If it's a sprite, is the collision poly sloped so that the sprite sits at angle 0? Or is it a box collision poly and you're rotating the sprite itself?

    Depending on how you're doing your slope, it will affect how to go about programming it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This looks awesome! I can't wait to try it out, thanks so much for the input!

    I think in terms of efficiency it might be a plan to do sprite pooling... so create however many sprites you need/system can handle ( do some testing for lower end systems ) at runtime, and then use your idea of a cone of visibility ( also known as the camera's frustum ) and then when a sprite is out of view, move it to the furthest new point in the frustum that needs a sprite

    That way you've always got the same number of sprites operating at once and thus are able to plan for cpu usage in other areas :) either way I'm stoked to try this out!!

brent_hamel's avatar

brent_hamel

Member since 31 Dec, 2009

None one is following brent_hamel yet!

Trophy Case

  • 15-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

19/44
How to earn trophies