Guizmus's Recent Forum Activity

  • Hi,

    Not being an expert on audio decoding, I will start by saying that you need a timestamp for every sentence in the audio track, like the "markers" you have for now.

    I couldn't look at the capx as you didn't link it (it's a link to the running app you used).

    Now, let's say you have an array with every item being the timestamp of the corresponding sentence in the song. (first item is for the first sentence, ...). I then see your project like this :

    • start of layout/song : set a variable "song_position" to 0
    • every tick, add dt to song_position (so you keep a record of where you are in the song), then search in the array the index of the last timestamp that is inferior to song_position : this is the current sentence. Use this index to position your blue marker over this sentence in your layout.
    • onclick on a sentence, look in the array for the timestamp of the corresponding index (use a variable on each sentence on screen to know what sentence it is/where it is in the array), and use it in the "seekTo" function from the Audio object to play at the right time. Update "song_position" to the timestamp you've got.

    Hope this helps !

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • assal0le, you should read the manual first, really.

    Again, this is true :/

    This manual entry explains it, and a lot more.

  • RamPackWobble I looked at it. One of your function was correct I think, the one with a loop, but you didn't start at 0 degrees, because loopindex starts at 1. Shouldn't change much though. And ok for using random, but random(360) ? ^^ lots of bullets :p

    Also, thanks for the point on 0 speed bullets resetting their angle, I didn't know this !

  • Hey!

    Next teaching then :)

    • use

      username to push a notification to someone, like the notification you've got from Tarkion

    don't share a .caproj, it won't work on its own. You need to save your project in .capx instead to share it easily.

  • Colludium OrangeFlash81 the reason it doesn't work in the first post is because every item spawned is added to the current object selection. So every "Set bullet angle" is applied to all the bullets in the current selection, and this is why the same angle is on every bullet at the end.

    LittleStain had it right, it should work this way, even if it's not that beautiful. MadFactory solution is nicer and will also work (as the new bullet is created inside the loop, thus not added to the current object selection on next loop index).

  • Hello.

    You should always provide a .capx that shows your problem, because what you are describing should work, so you are doing something wrong somewhere and we can't know what.

    Here is a sample capx to show you how it works. I hope it helps.

  • You need priorities and control tick.

    First of all, put a timer on your enemy. This will be the control timer. Every time it runs out, the enemy should decide what to do : run from the player or escape corner. Then you call the corresponding function and start a new timer to choose a new action, but not right now.

    What it would do in game :

    T=0s : enemy choose to run from player, start new timer (2 seconds ?)

    T=2s : enemy is not far from the corner, and the player is close too. The enemy chose to run from the corner, and starts a new timer. He will the run from the corner for at least the timer's duration, meaning it won't do back and forth every millisecond.

    When you make AI decisions for anything, having a control timer is usefull to prevent micro-orders. I ran into the same problem with a "pet" simulation, where the pet would eat for less than a second, then start running, then eat again because its priorities were almost the same at that time, and each order changed the current priority in less than a second. If no order can be issued more than once in a while, this problem goes away. It makes the ennemy less reactive to the player's actions though.

    Another solution is to have a control timer quite short (1 second ?) but in your decision function (the function that decides what the enemy should do), take into account what the enemy is currently doing. If he is running from the corner right now, maybe the proximity of the player doesn't have the same weight in the decision... It's all try and balance then.

  • Hey,

    Your problem is quite clear here : the link between an object and its map representation isn't defined. To put it more clearly, how would the map update an enemy position if each enemy_icon isn't "connected" to an enemy ? I don't see, as a computer, how I would do it as your system is right now.

    So the solution now.

    1/ you need a map initialization. In the initialization, you'll spawn an enemy icon for each enemy on the game. Same goes for energy, so I'll just explain for the enemy for now. Every icon needs a variable, "targetUID" for example. This variable is set during the initialization to the enemy.UID. The positioning is then done exactly like you did for the player icon.

    2/ you need a map icon adding system, to spawn a new icon on the map every time a enemy is spawn.

    3/ during the map actualization, position the player icon like you did, then do a forEach on all the enemies, select the corresponding enemy_icon on the map (using the variable we added in 1/), and then position the icon on the map.

    I see you have a licence for C2, so I'd suggest you use families for "mappables" objects (i.e. the objects of the game that have a map icon) and a family of "map_icons", as all those icons have exactly the same way of initializing/updating/destroying.

    I hope this explanation is enough, I'll put some code in if you need though. Don't hesitate to ask if anything isn't clear.

  • Roccinio It wasn't a useful here. It is automatically done on item initialization.

    It is to be used when there are changes in the obstacles present on the map. If you spawn a tree and don't do it afterwards, it will let the path go through the new tree. It won't see that a wall has been destroyed either if you don't force a regeneration of the map obstacles.

  • Hey there !

    1) Steam licences travels with your steam ID. so don't bother, as long as you can log in with steam. Even if you had bought it here, you could have moved it from a computer to another if needed.

    2) Python isn't usable here, and it's javascript not java ^^ But you'll see rapidly, C2's events are lovely to use and play with, giving lots of possibilities and being not that hard to learn in the end.

  • What does the map looks like today ?

  • You can do ifs, elses, ... and whatever you could do in JS in logic. Example with some comments

    If you're having trouble about picking, it's not exactly the same. By default (when no condition is applied), every object in the layout is picked. After each condition, you select a little more elements, removing from the selected list elements that don't meet the conditions. That means that adding a condition "Ennemy.HP > 0" won't pick ennemy with HP>0 but will remove every ennemy with HP <= 0 from the selected list. This is why there are conditions like "pick all", to add items to the selected list.

    Certain conditions, like "compare 2 values" in the System object, are boolean conditions, and won't be considered as affecting an object type. They will just block an event from triggering if they are false.

    The best way to really understand all the possibilities of this system is to create a sample capx, and try with lots of debug, see what triggers in what cases, find out what the "wait" action can do to the function parameters, discover that removing every object from the selected list will prevent the event from triggering, thus will trigger the else event, ...

    Experimentation is a nice friend here, but there are also lots of things in tutorials ;)

Guizmus's avatar

Guizmus

Member since 26 Mar, 2013

None one is following Guizmus yet!

Trophy Case

  • 11-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies