tulamide's Recent Forum Activity

  • Functions

    When I add a function parameter then use that parameter for an event, it doesn't register.

    Something like:

    Button Clicked -> Add Paramter 2 (an integer)

    if Function.Param(1) == 2 -> do something

    it doesn't do something..

    However, if I do this:

    Button Clicked -> Add Paramter "something" (a string)

    if Function.Param(1) == "something" -> do something

    it works!

    So is this a bug or am i doing something wrong

    You shouldn't rely on a function parameter being accessible through events. You don't know how they are stored internally, converted, etc. Those parameters are always accessible within a function and you can rely on that. But for a structure like the one of your example you have global and private variables.

  • There's more than saving vram. Graphic cards support textures only up to a specific size. Modern cards may support 8192x8192, older may only support 512x512 or even only 256x256.

    So, when you have a huge image, let's say 8192x4096, you should cut it into smaller pieces, if you want to support players with older gfx cards.

    Also, when using pixel shaders in your game, you could get in trouble, too. Only ps3 (and up) is guaranteed to work on 4k textures. (This could be misleading, let me say it this way: If a card supports ps3, it also has to support 4k textures)

    But you could also still save some vram. Let's take the example 800x800. It's just a matter of how you split the image. See the graphic below:

  • How do non-solid offscreen objects affect performance?

    I might have a Jillion of them :s

    Do you mean invisible objects? Or transparent objects? Or really objects without the solid attribute?

    Invisible objects don't affect the graphic performance, but might affect the processor load (e.g when using PVs from them).

    Transparent and objects without the solid attribute that are offscreen don't affect the graphic card's performance, but they do add to the main processor load. There is no magic that decides when an object has to be drawn, animated, rotated, etc, because it's onscreen. Instead of magic there's simple calculation. Unless Construct will have some mapping that puts the objects in groups of importance (in relation to their distance from the current screen), this means calculating all objects' distances from the current screen.

  • Need some debug help

    http://www.box.net/shared/6ac37tfmk9

    The initial 1 min and 3 minute timer works

    But I can not change my mind and select a different time once one started. Also after hitting stop I can not restart

    Any thoughts?

    Don't mix the code and the behaviour of the xaudio2 object here

    The basic code is correct. It changes 'TimerCheck' to the correct values. The problem is the way you use xa2. You order it to autoplay, that means it will use the next free channel to play whatever it needs to play, until the end of the soundfile is reached. This is not sufficient for your needs I think.

    Instead, use xa2's 'Load file' to bind the soundfile to a specific channel, and use xa2's 'Play' to play the sound. When hitting the stop button you should then also stop the sound.

    To reset the sound, just set the channel's position to zero.

    You don't want to repeat an action every x milliseconds, you rather want to loop a timespan for a specific amount of time (until you hit stop) beginning with a button being pressed. I would recommend to use Timer and a global 'TimeStamp" for this task. With modulo you will get a loop over the allowed timespan. There's just one thing to pass attention to: Timer is an exact value, whereas your events are executed within a tick that may last for several milliseconds. That's why you can't directly compare to zero but a range. For most event sheets, one TimeDelta-range should be enough. TimeDelta is a fraction of a second, so multiply it by 1000 to get a milliseconds value to compare with. If your project grows and you happen to not hear the sound playing, just raise that value in TimeDelta steps (so the next range to compare with would be TimeDelta * 2000)

    btw, you shouldn't raise the volume to 25db, or you will risk the ears of your users. For very quiet sounds setting the master volume to 6 or at maximum 12 db may be ok. On the other hand, there's always the limiter, if you didn't touch it, it will at least prevent distortion. Also, there is no way to restore to 0db right now.

    Yeah, sounds more complicated than it is, really. Have a look at your reworked cap:

    rwTimer.cap

  • Just make sure a condition is met and run the "every..." event as a sub-event.

    + On left clicked on Sprite

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

    + Is global variable 'warning' equal to 1

    ++ Every x milliseconds

    -->do whatever is needed after the button was clicked

  • [quote:1ie4m1jp]you might be able to save sometime by using a dictionary

    That's probably a good idea. Could this be used to substitute for an array? I wouldn't be using it to save the game, but it would store values with 3 keys (ex. (x,y,z) or (1,2,1)).

    I'm not exactly sure how you want to create, change and use the values.

    A dictionary stores key/value pairs, much like Construct's HashTable. The closest substitute for an array would be a list. If the values you are using are set once and never change, then you could use tuples. Last but not least you can always create your own data structure using "class"

    # creating a tuple
    position_t = (1, 2, 1)
        # alternative way
        # positon_t = 1, 2, 1
    
    # creating a list
    position_l = [1, 2, 1]
    
    # creating a dict
    position_d = {'x': 1, 'y': 2, 'z': 1}
    
    # creating your own data structure
    class position:
        def __init__(self, x=1, y=2, z=1):
            self.x = x
            self.y = y
            self.z = z
    
    # creating an instance with default values 1, 2, 1
    p1 = position()
    
    # creating an instance with values 4, 3, 7
    p2 = position(4, 3, 7)[/code:1ie4m1jp]
    You may also mix those sequence types/classes to get the structure you need.
    
    [code:1ie4m1jp]# two fixed coords build the positions dict
    headquarter = (1, 2, 1)
    goldmine = (3, 7, 2)
    positions_d = {'head': headquarter, 'gold': goldmine}
    
    # the same with a list
    positions_l = [headquarter, goldmine][/code:1ie4m1jp]
    
    It all depends on what exactly you are trying to do with your values.
  • No, I didn't.

    And with the list of open bugs being so long, I just hoped this one would get more attention if posted here

  • Welcome back!

  • I've made a post about the possible problem with or:

    http://www.scirra.com/forum/viewtopic.php?f=3&t=7428

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, I stumbled upon this problem: http://www.scirra.com/forum/viewtopic.php?f=3&t=7422

    I made some tests and finally think I found the symptom. Maybe it helps the developers fixing it. It seems that an event with OR'ed conditions needs several (at least two) time units. I'm avoiding the word tick, because it doesn't need to be consecutive. The evaluation is only done correctly on the second time unit earliest. I think that's why you get the impression of OR working with a kind of randomness. Because, if you use it as a sub-event for example, it will most likely be tested only once and therefore give no correct result. But as soon as it has enough time units, it works correctly.

    I've made a little cap to demonstrate it. All it does is generating a random number per click and testing if this number is in a certain range (for testing purposes in an elaborate way). The trick is, that there are three event groups called method 1 to 3, and you can switch through them. You will see, that method 1 works as expectable, method 2 does not work at all, and method 3 is "half-working". The last method is the reason for me to not talk about consecutive ticks. In this group the OR'ed event is a sub-event of a "every 3000 ms" event. If you look closely, you will see that the evaluation is incorrect the first time it is called, but correct on the second call, 3000 ms later.

    or_issue.cap

  • I also had issues with OR. For ex.

    If x greater or equal 1

    or

    if x lower or equal -1

    It could work or not, it's really unstable. And when you have too much OR in one event. Later I've decided to change it on structure:

    if xxx - then do xxx

    else if xxy - do xxy

    else if xyx - do xyx

    else if...

    and so on.

    I see, thank you. So it seems that OR'ed comparisons with numbers are working unreliable? I will test it. Would be very frustrating to debug if it happens to a progressed project. Thanks for the example!

  • 2 ways:

    1) System expression "sqrt"

    sqrt(a^2 + b^2)

    2) System expression "distance" (which is using that theorem)

    distance(x1, y1, x2, y2)

tulamide's avatar

tulamide

Member since 11 Sep, 2009

Twitter
tulamide has 3 followers

Trophy Case

  • 15-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

17/44
How to earn trophies