tulamide's Forum Posts

  • I don't think this belongs to the help & support section. You are basically looking for a programmer to do the work for you <img src="smileys/smiley2.gif" border="0" align="middle" />

    Also, it doesn't make much sense to drop a line. There are so many different ways of implementing an inventory and noone knows to which project/style/art etc. it will be added.

    You probably won't get any in-depth solutions, but at least provide more informations, maybe someone will take the chance <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Wow, cool thing.

    A beginner's guide in this way will be very helpful. This must have been a complex work and I hope you get attention for it.

    <font size="1">(shouldn't 'Scirra construct' be written 'Scirra Construct'? <img src="smileys/smiley17.gif" border="0" align="middle" /> )</font>

  • It is one string, colored once.

    You could create several instances of a text object, one for every line of text and set the text and the color seperately. You could pick the right text line by using a pv set to the line number of that text line.

  • I'm not sure if it is a bug or a feature, but every function call gets its seperate parameter list, if you call it from within another function. You still need globals (or privates) but only as a buffer for every return value within another function, it really isn't confusing and you keep overview.

    Here is an example that might make it clearer than my words:

    http://www.mediafire.com/file/5q8zqatb3yo7abe/multiplefunctioncalls.cap

  • Sorry for the delay.

    does it also mean that i have no way of setting a fixed rate of pixel per second with that method? or do you have any idea of how that would work? <img src="smileys/smiley4.gif" border="0" align="middle"> It might be mixed up now. When using 1 * Timedelta, you have a fixed rate of 1 pixel per second. No matter the frame length or frame rate, overall you will have exactly that rate.

    The problem is the loop though. It will be run 1024 times per call, so if the framerate is high the resolution is much higher than with a low framerate.

    I have made a cap that uses a much more efficient way. Have a look at it and see if you can use it in some way:

    http://www.mediafire.com/?eq84dhm84w4sowv

  • i thought so too! but my reasoning was to have one check [outside the loop] which triggered the loop, and one INSIDE the loop to keep checking in every turn whilst the loop ran. otherwise it would assume it to be 0 from before the loop started.

    Ah, yes, that's right. It was just a confusing set of events, but it needs to check again, that's correct. Sorry about that.

    also, referring to time delta, so if time delta is the time [in ms] between each frame. if it ran at 60FPS would it be safe to say that TimeDelta = 1 second / FPS. or 1/60 second? so as long as it were 60fps it would be 0.016~s. ?? <img src="smileys/smiley17.gif" border="0" align="middle">

    No :)

    The framerate is just an average value. You might get 60 frames per second in the end, but there is no guarantee, that every tick lasts the same amount of time. It rather is something like

    f1: 15ms

    f2: 18ms

    f3: 13ms

    f4: 11ms

    f5: 16ms

    etc.

    i now uploaded the example.

    Time Delta Gravity

    Couldn't download it. (dropbox error 403)

  • :: G R A V I T Y ::

    -------------------------

    <font color=orange>+ System: global('collision') Equal to 0</font>

         -> System: Start loop "gravity" and run 1024 times

         + System: On loop "gravity"

         + System: Object.Bottom - Ground.Top Greater or equal 0

              -> System: Set global variable 'collision' to 1

         <font color=orange>+ System: global('collision') Equal to 0</font>

         + System: [negated] Object (Pick) and Ground (Pick) are overlapping

              -> Object: Set Y to Object.Y + (1 * TimeDelta)

    The second one is a redundant condition, you already compared 'collision'. In this scenario (without knowing the rest of your events) Object.Y will grow by 1 pixel per second (1 * TimeDelta) as long as 'collision' is 0.

    also, i'm not sure of what the exact value of timedelta is supposed to be, is each time delta something like 16.666~~~ milliseconds?

    There is no exact value. Timedelta is a value expressing the time passed since the last tick (may also call it frame) in milliseconds. This time varies depending on how many events needed to be executed in the last tick, how many other processes took time (e.g. some access to the graphic card by a browser), etc.

    So this value will be slightly different on each tick. But you can rely on the sum of TimeDelta. If your game runs with 60 fps, then adding TimeDelta 60 times will result to 1. And 1/TimeDelta will give you the actual framerate - but only valid for that time of moment.

  • I wouldn't do so. Construct's event system is very powerful. There are rare occasions where you need to use python or develop your own plug. But almost everything can be done just with events - really :)

    (And events will be executed a lot quicker than python scripts)

  • Here is an example to the explanations above:

    http://www.scirra.com/forum/topic45283_post283470.html#283470

  • This is a simple example for an audio player that plays a list of audio files and loops the list.

    http://www.mediafire.com/file/pv2ivm8sitcpris/playlist.rar

    EDIT: After decompressing place some .wav files into the folder named "audio". Then just run the application.

  • When using 'autoplay resource' you're using the sound part of XAudio2, not the music part. That has a few advantages. While playing music does not allow you to get informations about the music, you have control over sounds that are playing:

    Get length

    Get position

    Just test the second against the first. There is only one thing to keep in mind, and that is the frames at which the game runs. If it runs with 60 fps you won't be able to catch the exact end of the song. It is better to just test if the position is greater than a certain distance from the end.

    position >= length - 0.25 (or any other number that works with your framerate)

    To get the channel number of the sound you can use 'Get last channel autoplayed', but it would be much easier to load the resource to a specific channel. Then use 'Set reserved' to protect this channel.

    You can use an array for the file names of the wav files and a global variable that increases with every sound played and corresponds to the index of the next wav file name to load. But you would then need to load them from a folder, because if I remember right there's an issue that prevents using strings for the resources.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Edit: moved to C2 section by the way.If this is true then there's a bug with the forum software, because I still see it under "Help & Support using Construct Classic".

  • There's no switch statement in python

    <img src="smileys/smiley9.gif" border="0" align="middle" />

    and "Create" works with a the text name of the object.

    That's what I was looking for.

    from random import randint,random
    
    def edgeplacement(o,l):
       # get the name of the object
       objectName= o.__class__.__name__
    
       if randint(0,1) == 1:
          x = randint(0,1) * 640
          y = random() * 480
       else:
          x = random() * 640
          y = randint(0,1) * 480
       System.Create(objectName,l,x,y)
       getattr(SOL, objectName).angle = random()*360

    Clean and efficient as always! And again something new to learn. Accessing with __class__ is new as is 'getattr' to me. Thank you for sharing it <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Well, the text manipulator method of loading the text does not change anything to the original text file, except that it replaces the newline character with its own newline character. So I would say it depends on how exactly you read in and interpret the text from the editbox. Could you please show a demonstration cap or at least some code snippets?

    I guess you are using 'get token'?

  • This is an issue with the editbox.

    You can workaround it by using the text manipulator object.

    Example:

    + System: Start of layout
    -> TextManipulator: Read file AppPath & "test.txt" line by line
    
    + TextManipulator: On line read
    -> EditBox: Append text TextManipulator.GetReadLine & NewLine