codah's Forum Posts

  • I'm a beginner also, but I had a similar need. I created an array containing all the names of my sounds (Text). Then I chose a random number as an index into the array, retrieved the sound name and played it by name. It worked for me.

    With iGamersBox answer, you can just use int(random(1, 7)). If you have many sounds, you can't have them all in a choose expression.

  • Yes you can create your own sprites with the free version. You can verify this very quickly by downloading and trying it. However the facilities are fairly basic (but still useful). I use Gimp for most tasks as it's free and powerful, and I've never gotten into Photoshop much.

  • Regarding your last statement, the Sprite: Compare frame condition is not sufficient?

    I'm confused why you're using a game creator but not creating games?

    When you say something is complex, that might well be true. Or, you might not be 'getting' a certain feature Construct 2, and you're maybe wanting to re-invent some wheels.

  • I think you need to show what you have tried that didn't work. Maybe just a screen grab of the event that does the saving/loading?

    See the attached capx for a simple example. Hope it helps.

    Edit->

    1. Enter a value

    2. Click Save

    3. Enter a different value or delete it

    4. Click Restart to load last saved value

    I just noticed your comment about functions. I also have used very simple 1 or 2-liner functions in the sample. I think you should definitely use them. They aren't hard. Maybe you can use my example as they are very basic. They also stop events running 'every tick'.

    I also included a "Log" function. If you want, delete the 2 "Call 'Log'" lines and also the Log function, to simplify the sample even more (but logging is essential for debugging IMO).

  • Just a final note.. The Construct editor puts an initial value of "" for Text instance variables, which is obviously misleading and should probably be removed.

  • Thanks for that. Yes definitely a Text instance variable, just double checked. I'll check your sample and post back if and when I work out what I've done wrong. BTW as a test I changed the evaluation to use <> instead of = and *all* instances were picked.

    Edit: Ok looking closer at your sample, I noticed that you don't have quotes around your text in the initial values. To me it was intuitive to use quotes as it's a string, but anyway! Thanks for helping me see this.

    Edit 2: And also I had a redundant 'pick by evaluate' condition instead of a simple Compare Instance Variable condition.

  • Something that I thought would be trivial has taken me some trouble to work out. I have a number of SpriteFont objects in a layout and I'm trying to set their text individually. I have a Text instance variable in my SpriteFont object called something like WhatTextIsThis and setting each instance to "score1", "score2" or similar. When I try and pick an instance by evaluating SpriteFont.WhatTextIsThis = "score1" (for example) I get no objects picked. I tried lots of things and finally decided to use a simple numbering scheme, which worked immediately. What would be the problem with using Text in this case? I double checked that I'm comparing the correct text. Thanks.

  • I'd like to implement a kind of animation style where movement is not so nice and smooth, so each 'step' or change of object position is in sync with a change of animation frame (think old school arcade games like Space Invaders ). I've done it simply with a 'move position, change frame, repeat' method but then I lose the nice features of the Bullet behaviour and I have to do everything myself like keeping track of movement, direction, etc. Maybe something with Custom Movement? Does anyone have such a technique? Thanks.

  • The link doesn't work for me.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Cheers. Thanks for taking the time.

  • Ok so the speed needs to be non-zero first

  • Hi all. I'm setting an object's angle-of-motion Bullet property to 90 and it's actually getting set to 0. Also if I set it to 270 it becomes -180.

    I am immediately logging the value as the very next action after setting it so nothing is possibly executing in between.

    What could be causing this? Thanks.

  • Alternatively pick an instance by evaluating if the apple's X position is 5 greater than the orange.

    System|Pick Apple by evaluating (Apple.X - Orange.X) = 5[/code:36sk8ks0]
    
    If you just want distance (to left or right) then use
    
    [code:36sk8ks0]System|Pick Apple by evaluating abs(Apple.X - Orange.X) <= 5[/code:36sk8ks0]
    
    And set your variable based on that.
    
    Then you could check [code:36sk8ks0]Apple.PickedCount[/code:36sk8ks0] and reset it if this = 0.
  • Good stuff. I was thinking I'd have to write some logging solution but now I'll definitely check this out. I'd never looked at the Browser plugin.

  • Oh yea. You would think that as I'd just done it 10 minutes ago, I'd remember... thanks. So many concepts completely different to regular development. Need a complete brain transplant I think.