tulamide's Forum Posts

  • FormatDecimal, as ROJO showed in his example and can be seen in the wizard, outputs a string, not a number. There's no need to convert a number using FormatDecimal into a string and then keep on calculating with it. Just calculate with the number itself, not its human readable text form.

    btw, it isn't that hard to read. 2.68e-002 just means: shift the number 2.68 two decimal places to the right (2.68->0.268->0.0268)

    It's the same with everything else. 2.68e-003 = shift 3 decimal places to the right = 0.00268, etc.

    There's also the other way round. 1.5e+003 would mean, shift the number three decimal places to the left = 1500

  • Any FL Studio users among us? I had a look at it, but don't like it much (reminds me too much on the old tracker era). Anyway, one thing that is really interesting is one special plugin. It is FL Synthmaker, a slightly stripped down FL Studio version of Synthmaker.

    I must say, I instantly fell in love with it. The way, how the flow and the math is represented makes it so easy to understand and work out really complex things.

    It is also a good tool for learning purposes. Just a very simple example, a self-made clamp module:

    <img src="http://dl.dropbox.com/u/11182740/construct/clamp01.png" border="0">

    All inputs are on the left, all outputs on the right, that's consistent throughout SM. This example is equivalent to

    Clamped Value = clamp(Value, min, max)

    Now let's look inside the module:

    <img src="http://dl.dropbox.com/u/11182740/construct/clamp02.png" border="0">

    The first primitive (the one with the little m) is the min-primitive. It takes two inputs and sends the smallest of them both to the output. The inputs are connected with "Value" and "max". The output is connected with the max-primitive (the one with the capitalized M), that compares two inputs and sends the greater of them both to the output. The second input is connected to "min", and the output gets sent to the module output "Clamped Value".

    In this example, the flow is as follows: The first primitive compares 1 and 8 (value and max) and sends 1 (the smaller one) to the output. The second primitive now compares 1 and 2 (output and min) and sends 2 (the greater one) to the output. It's that easy, programming visualized in very intuitive way.

    Well, sorry for the lesson, I wanted to post something else. I worked a while with SM and created something that I think is quite useful. My ambient noise generator works with a ultra low frequency oscillator fed by brown noise, then sent through a series of effects, with all components modulated and fine-tuned to give the best possible results. Even the GUI is hand crafted, built with primitives to have it all vector based.

    <img src="http://dl.dropbox.com/u/11182740/construct/ANG.png" border="0">

    ANG is straight forward, you don't even need to play a note. Add it to your FL plugin/generator folder (not VST!), then insert it in the pattern editor. Open it and switch it on, select the ambiences or change the gain. You will see that it is realtime generated, no repetitions or loops. You can literally listen hours to it, feels very natural.

    There are a few issues, but I didn't want to wait any longer. Be careful when switching it on for the first time, as it may produce a click sound close to 0 dB. Loudspeaker or headphones should be turned down to a reasonable volume. Also, the ambiences are at different signal strengths, don't gain too much when you intend to still switch a lot between them. And finally, there is an error that shows a filled rectangle on the area (instead of lighting just the buttons) of the ambience buttons, when you click them.

    Here you are: ambient noise generator

  • Is there a way to compare private variables of different objects?There are several ways of doing this. Without knowing the purpose it is hard to tell which one is the preferable.

    (objA and objB being two different sprites with a pv named "someVar" each)

    1) You can use the "compare"-conditon of the system object:

    + System: objA ('someVar') Equal to objB ('someVar')

    This will result to true or false but will not pick anything.

    2) You may also use the "evaluate"-condition of the system object:

    + System: objA ('someVar') = objB ('someVar')

    An evaluation is a calculation that results to either true or false (e.g. objA('someVar') + 12 > objB('someVar') * 2). This will also pick nothing.

    3) Another way is using the sprite's "pick by comparison"-condition:

    + objA: Pick by 'someVar' Equal to objB ('someVar')

    This will pick all instances of objA that match the pv of the first instance of objB

    4) Also, there's a "pick by evaluation"-condition:

    + objA: Pick by 'someVar' = objB ('someVar')

    Again, this picks all instances of objA that match the pv of the first instance of objB

    Use the evaluation conditions whenever the comparison is more complex than a simple compare.

    Have a look at the wiki, it is full of descriptions, tricks, and other useful stuff :)

  • Just a remainder, the competition ends on June 30, but to participate you have to register your game for the competition until May 15, which is only one month left.

    This should be an ideal proof of the capabilities of C2, and I've already seen a few games that compete in graphics and physics. No social/multiplayer games in the making?

  • I talked about the issue with the or-condition before. Although I agree that it is most of the time preferable to avoid it, you can still use it if you know of the issue that is causing those problems, and avoid it.

    My skills in C++ are too low to find and correct the code, but this is what happens:

    Why using or seems to fail often

    In short, it can output wrong results and it needs a couple of ticks to evaluate. Both combined can lead to other issues which may finally crash the app.

  • The reason for this is that any sound file is only attached to a channel as long as it is playing.

    Instead of loading the sound at start of layout just load it at mouseclick. Sound files are cached, so you will not have delays on subsequent loads. If you are afraid of a delayed play when it is loaded the first time, you can additionally cache the file manually.

    + Start of layout

    -> Cache file (or cache directory, if you want to cache more than one file)

    + On mouse click

    -> XAudio: Load file "AppPath" & "pistolfire.ogg" to Channel 2 (No Loop)

    -> XAudio: Play Channel 2

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Tulamide, it didn't work. But thanks anyway! I'll try again later =).If it doesn't work, then you've done something wrong. For me it works like a charme, as you can see here:

    <img src="http://dl.dropbox.com/u/11182740/pictures/latitude.png" border="0">

    I will share the cap with you, but you should try to find your mistake, in order to learn. And maybe try something else for a start, to get used to CC?

    LatitudeConversion.cap

  • When converting a string to a number, the string must begin with the number. It stops as soon as there is anything else. For example int("2g34") will return 2, float("3.2H45") will return 3.2, and float("S3.34022") will return 0, as it starts with a letter.

    But there is an easier way to achieve the results. As I understand, latitudes may be written as with "N" and "S" or "+" and "-" in the beginning. If so, then just use replace()

    + Button: On Button clicked

    -> System: Set global variable 'latitude' to replace(Uppercase(EditBox.Text), "N", "+")

    -> System: Set global variable 'latitude' to replace(global('latitude'), "S", "-")

    -> Text: Set text to global('latitude')

    latitude is a text variable

    This event will first convert the text of the editbox to uppercase, then replace all "N" in that text with "+" and all "S" with "-". This way, the user can enter the latitude in any way, e.g. "+3.34", "N3.34", "n3.34"

    However, you still have to make sure the latitude is not entered incorrectly.

  • Fellow developers,

    here is a big chance to get your game funded. And I'm not talking about peanuts, I'm talking about the big money. Up to 1 million euro (1.3 mio $)!

    Just enter the competition with your browser/social game. Here is the english version: http://www.makethegame.de/en/

    Have a look at "How it works" and also check for "Reborn Horizon", last year's winner. It shows what quality they might expect.

  • Good luck, you both. And after having watched the video, I have to say, you really need to get some sleep, lucid. Fulltime doesn't necessarily mean 24 hours a day <img src="smileys/smiley4.gif" border="0" align="middle" />

  • If you have an extra event sheet for all your audio events, you can specify where these events are valid by adding the system expression "get layout name" or "get layout number". You best use it in a compare event, like so:

    + System: LayoutName Equal to "options"

    -> add all events as subevents here, that belong to the layout "options"

  • On collision triggers one time only, not as long as the objects overlap. Change your code to

    + blue1: blue1 overlaps blue2

    -> Sprite: Make Invisible

    -> Sprite2: Make Visible

    + System: Else

    -> Sprite: Make Visible

    -> Sprite2: Make Invisible

    "is overlapping another object" results to true as long as they overlap.

  • yea it is! :) ty but how i create from 180 alone digit 8 or 1 or 0? is this possible?Of course, it is :)

    Convert the number to a string, then loop through the length of the string and extract one letter each time.

    number to string conversion: string = str(number)

    getting the length of a string: length = len(string)

    get a substring at any position: substring = mid(string, start, length)

    looping: For (name, start, end), use 1 for start and len(string) for end

    within the loop use mid(string, loopindex, 1) to get one letter at that position

    To convert a string to a number, use int(string) again.

    Here is a very simple cap: numbertodigits.cap

    Have a look at the Construct wiki, explaining all of the expressions: System expressions

  • It is a restriction by either the engine itself (box2D) or the implementation. From the Construct wiki:

    "Note: There is a maximum limitation of 20,000 x 20,000 on layout size with the physics behavior. If you go past this point with your object then physic behavior no longer works. "

    I assume it is a precision issue. Maybe box2D uses 32-bit data types, but whatever size one chooses for the data - there will be a limit. Because it is not the real world, but just a simulation... <img src="smileys/smiley1.gif" border="0" align="middle">

  • If you need the remainder of a division, then it is modulo. The sign used for modulo division is %

    180 % 100 = 80

    179 % 10 = 9

    But you seem to simply need the integer division, which rounds down to the next integer. That's int(somecalculation) or floor(somecalculation)

    int(180/100) = 1

    int(179/10) = 17