InDWrekt's Recent Forum Activity

  • Your sounds aren't playing because your sound names include the .webm extension. When you use the play by name method, don't include the .webm in the name of the sound. For the game as it is, you don't need to remove all the .webm extensions from the list of sounds. You can just do this:

    -> Audio: Play replace(DataN5.At(5,index), ".webm", "") not looping from Sounds at 0 dB (tag "")

    The replace statement will strip the extension off for you.

  • This is all that's needed to do what you are asking.

    If you are causing the game to crash, you are most likely creating an infinite loop. You need to make sure your loop exit condition can be reached. I prefer for loops. They are much harder to create an infinite loop in.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have run into multiple really big bugs that all seem to point back to the enabling and disabling of code blocks.

    1 - I saw the Demon stop working after the air attack. I was unable to really debug why because of the other following errors that made it so getting to this point was inconsistent.

    2 - I have had the knight lose the ability to attack or turn around when walking into the boss room. This was fixed by disabling the action that disabled the Knight Controls group. When you run the cut scene of the knight walking into the door, the Knight Controls get disabled and sometimes don't get reenabled.

    3 - When fighting the boss, quite often, the entire game would freeze. I haven't been able to figure out why.

    In the image below, I have marked events that deactivate code groups but don't have a corresponding activate event.

    Also, I noticed you have 2 copies of the Boss Events. Both are nearly identical. Duplicating code is always a bad idea. If you need to make changes in 1, you then have to remember to change the second as well. Also, you can have a hard time knowing which event sheet is causing the problem. If you need to use the same events on multiple event sheets, you should put all the shared events in their own event sheet and include it in the others.

    I suggest you redo the event system removing ALL the disable actions and instead use state to define which block of code to use.

  • I save it on my google drive using Constructs cloud save option. I then go to my google drive and get/post the link to it. You can also upload it to a dropbox, github or other online hosting account and share the link from there.

  • All you need to do is set the selected item to the last id.

    -> List: Select item List.ItemCount - 1

  • Ok. Sorry I missed that.

    That being said, your code images don't really appear to be making use of the state machine. I may be misunderstanding your code but it looks like you are relying on disabling and enabling code groups instead of changing states. This is extremely difficult to debug because there isn't an easy way to check if code blocks are enabled or not.

    Did you take a look at the example I built? I think you may find the answers you need there.

    To be honest, without access to your project, we are just guessing about what is happening. Can you post your project? You'll probably get better results if you do.

  • You should be using a State Machine to control your enemy states.

    A State Machine is a common programming tool that defines states something can be in. Each state needs an entrance and exit condition. All the code the enemy uses will be defined by the state it is in. Take a look at this example I through together from your question.

    drive.google.com/file/d/1t3nFqiq7syZXKRWGSOE-VrwVknfgDbeV/view

    My enemy will wander randomly until the player gets within 200 pixels. It will then charge the player and return to where it started the charge. It will be unable to charge until after a cooldown. If the player climbs the stairs so they are higher than the enemy, it will enter a flying state. I didn't add the code for attacking in the air but the state is there. After the player returns to the ground, the enemy will return to the ground and start wandering again.

  • You need to add the audio plugin. After you add it, there is an action "Play (By Name)." Pass the array value into this event.

  • As I understand it, the ToLocaleString shows the time in the most common format for the location you are in. If you want to keep using that method, you will have to split the result up and modify the value yourself. You can use the ToLocaleDateString to get the date and join it to the ToLocaleTimeString. You would check if the time is followed by a pm and if it is, add 12 to the hours.

    -> Set text to Date.ToLocaleDateString(Date.Now) & " " & left(int(left (Date.ToLocaleTimeString(Date.Now), 2)) < 12 & right(Date.ToLocaleTimeString(Date.Now), 2) = "PM" ? int(left (Date.ToLocaleTimeString(Date.Now), 2)) + 12 & right(Date.ToLocaleTimeString(Date.Now), 9) : Date.ToLocaleTimeString(Date.Now), 8)

    Another option is just to build the time yourself using the getHours, getMinutes, getSeconds methods.

  • What method are you using to get the time? If you are using the Date plugin, the time is already stored in 24 hour mode and most of the time methods display it that way.

    Date.toString(timestamp) returns the date info followed by HH:MM:SS in 24 hr then time zone

    Date.toTimeString(timestamp) returns HH:MM:SS in 24 hr followed by time zone information

    Date.getHours(timestamp) returns a value between 0 and 23

    If you need to get the timestamp, use Date.get(Y,M,D,h,m,s,milli)

    Read through the documentation to see more uses:

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

    If you aren't using the date object, we would need to know how you are getting the date and time to be able to help you/

  • I'm not sure really what you are trying to do but maybe this will help.

    First, given the image, your events aren't going to choose a specific text object. You are using the system compare 2 variables event. This will trigger if it finds a value that matches but no object is selected so you don't know which object the system will choose. Most likely it will be all text objects.

    Instead, you should use a text event and compare it's variable. This is what your events would change to:

    Also, you can cut down your events simply by using the instance variable as the array index.

  • drive.google.com/file/d/1njkOW5E93Z6dAKfrj2u2FB2pDBqoCkmo/view

    Take a look at this example I built for another date question.

InDWrekt's avatar

InDWrekt

Member since 19 Sep, 2011

Twitter
InDWrekt has 7 followers

Trophy Case

  • 14-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 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