signaljacker's Recent Forum Activity

  • Hey, I spend a lot of time lurking on these forums but I thought I'd post just to say thanks. You've been one of the most prolific and helpful posters on here and your replies to both myself and many others have really helped me wrap my head around construct. All the best with your health, hope you can get it back on track.

  • Hi, I'm interested in syncing up events with audio, but I can't seem to work out an effective way to do it.

    I've been trying to use XAudio2's "Get position" expression - setting that to a variable and then using that variable to manipulate events - but I've noticed that it ignores loops and the number grows for as long as the audio is playing, rather than reverting back to 0 when the audio loops.

    Basically, I just want to be able to check how far through a track has played and execute various actions depending on what part of the music is playing. Am I on the right track with the "Get position" expression or is there perhaps a more effective way to do this? The more accurate the better. Thanks for any help :)

  • I get a black screen with a blue square, a HUD and some music playing. I can control the blue square with the arrow keys but can't seem to do much else. Here is a screenshot of how it looks imgur.com/w214s

    I don't really know what the problem could be, but how are you loading your images in the game - are they embedded in the .exe or are you loading them from directories at runtime? If it's the latter maybe check your paths.

  • Thanks for your reply, I have all textures loading per layout which is why it was a bit baffling to find such a difference in vram consumption. I'm wondering if it has something to do with global objects - I noticed that I had accidentally marked some of my level pieces as global objects and in debug mode they were appearing on every layout in the same place, when running the program normally they were there as well, invisible but still solid - causing barriers.

  • Hi, I'm having a bit of an odd problem. I have a project with multiple layouts, but I've noticed that my second layout behaves differently depending on whether I test it using "run layout" or "run all". I've also noticed that the vram consumption is different depending on these settings - it uses approximately 10mb more vram when loaded with "run all" (layout 1 is run first but then a trigger in the level takes you to layout 2). I was under the impression that all textures were purged from the cache whenever a new layout was loaded - is this not the case?

    More important than the vram discrepancy however is the fact that layout 2 behaves differently if loaded from layout 1 and not from 'run layout' - it's as if there are some invisible barriers there which interfere with the player. Has anyone else had problems with residual objects being left over from previous layers? For the record I'm not using any transitions as I've read these can cause issues.

  • Oops, I didn't realize I was in the discussion forum - I meant for this to go in help - too many tabs open! :P Anyway, thanks - random(2) * -180 worked a treat. Much appreciated.

  • Hi, thanks for the reply :)

    If I set the rectangles angle to 180 + random(180) it still seems to pick any angles between those two values, whereas I just need it to be either -180 or 0 (ignoring all other angles), if you imagine the rectangles like skyscrapers, they all need to stand straight, but face either left or right, but at present with that code they randomize to all angles between those values. I'll see if I can track down and install an older version of cc and do up another example.

  • Hi, I'm trying to pick between two angles at random (-180 and 0), I don't wish to have any angles between these two just one or the other randomly picked. Could someone enlighten me on the correct syntax to achieve something like this?

    I've attached a link to a cap which demonstrates what I'm trying to achieve - when it's run it populates the ground area with a bunch of rectangles and randomizes their position and height, but they all face to a 0 degree angle and I would like to randomly alternate this between 0 and -180. Any help is much appreciated. Thanks!

    masspanicmusic.com/construct/randomangle.rar

  • I'm no expert, but this is how I would do it:

    masspanicmusic.com/construct/boxexplode.rar (CC r2 version)

    It was just made very quickly and roughly to demonstrate, if anyone else has a better method I would be interested as well.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, I would probably do it like this:

    Select your player character and look at its properties.

    Add a private variable called "score", by default it should be a number and 0.

    Add a text box on another layer, name it and set that layer so that it doesn't scroll. This will be what displays your score.

    In your event sheet add a new system condition for "Always (every tick)" and then an action: select the text box, then select "set text" - the set text screen will come up as "" don't type anything in there yet, instead double click your player object, then "get private variable" - it will input something like player.Value('Variable name') - replace the 'Variable Name' with what you named your private variable before eg 'score' - keep the quotations. So now, every tick it will set the text box to whatever value the private variable 'score' is.

    So all you have to do now is add an action to whatever happens when you hit a coin - so on collision with player and coin add 1 to private variable 'score'

  • Yeah, I'm not sure why but it's a bit disorganized - I had to dig through the forum to find the latest version - anyway there's a link here sourceforge.net/projects/construct/files/construct/Classic/ConstructClassic_r2.exe/download

  • Hi, I'm not an expert by any means, so if anyone has a better way feel free to jump in. I thought your code looked a bit overcomplicated so I remade this the way I would do it (which probably isn't the best way either, but I find it easier to understand).

    One thing I noticed is that you had a lot of sub events, these behave differently to normal events (see construct wiki sourceforge.net/apps/mediawiki/construct/index.php I didn't think they were always necessary where you had used them and seemed to complicate things.

    Also, I noticed that some of your animations were set to loop (ie attack animation) when you would probably only really want it to play once.

    I've remade your .cap but left a few things out - like the hitbox as I wasn't sure how you wanted to implement it. I don't know if it fixes your problem, because it's structured differently and you may have structured it your way for a reason, but look at it as an alternative way to do things - and the animation for attack is now working.

    dl.dropbox.com/u/70305965/attack.zip - updated .cap - note your version of construct is older than mine, so you may need to dl a newer version to look at this.

signaljacker's avatar

signaljacker

Online Now

Member since 10 Aug, 2011
Last online 18 Jan, 2025

None one is following signaljacker yet!

Trophy Case

  • 13-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

17/44
How to earn trophies