tulamide's Forum Posts

  • 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

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

  • ELSE condition looks that it does not work properly with sub-events inside.

    ELSE had issues until 0.99.91

    Since then it works, at least for me.

    Using OR will eventually cause problems that make your game crash. It is considered unstable and should be avoided imo. I only use OR very rarely and only in simple events without branching. And even then only for quickly testing stuff.

    Is this so? I couldn't read about it. Do you have a link or more info about what exactly is a problem with using OR? I for one do use it more and more, and had no issues so far. But I admit, I don't use it in overcomplicated structures. But I use it with branching also, and couldn't report any problems so far.

  • If by chance you're working with photoshop, you could also use Render->Lightning Effects with a simple radiator (hope it's the right translation). You could also automate the process with the photoshop actions.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That's a common logical error that occurs because Construct works a little different from our human thinking. Have a look at the flowchart in this thread: http://www.scirra.com/forum/viewtopic.php?f=8&t=6880

    What happens is that if you press the right arrow key, the events do recognize it and change the global to 1, but the event loop hasn't ended yet, so the changes are not reflected. Instead, the next event tells Construct to only change the global (who's current value is 1) to 1, if the left arrow is pressed. But it isn't, you are still in the tick where the right arrow key is down, that's why the global is changed back to 0 and now the the event loop has ended and the changes are reflected.

    The solution is the followig:

  • Toggling is done with events through branching.

    Please have a look at this thread: http://www.scirra.com/forum/viewtopic.php?f=8&t=6880

  • Interesting plugin. But, I'm having some issues as well. I'm noticing that when a sound plays, it freezes the entire application. Also running Windows 7 64bit.

    This is normal behaviour as the system beep is a synchronous call.

  • From my point of view however it's a weird behavior.

    It's not so weird if you think of the problem like a computer does. When you deactivate that condition, you're basically saying: "Well, I don't care if the move-up-button is down or not. As long as move-right, jump, and move-left are not down, switch to animation 'idle'."

    Let's say you press 'move up'. Now what happens is, that according to the events, the animation is constantly switched between 'Idle' and 'Climbing', because

    1)

      'Player 1 "Move Up" is down'

    => is True

    2)

      'Player 1 "Move Right" is not down' 'Player 1 "Jump" is not down' 'Player 1 "Move Left" is not down'

    => is also True

  • ...

    it seems the event interpretation is much faster

    ...

    The test isn't quite fair. I'm absolutely sure, that a for loop would be faster in Construct than in Python, but don't forget that range() is a function. You would need to setup a function in the event system, too.

  • I forgot to mention an important thing:

    [] <-creates a one-dimensional list, not an array

    So, to get a list working as an array you would need to do this:

    actor = [] 
    actor.append("Dewey")
    actor.append(1)
    # etc for all values
    
    actors = []
    actors.append(actor)[/code:27nea85c]
    
    A clear multi-dimensional array would be done with:
    [code:27nea85c]actor = [[] for i in range(6)][/code:27nea85c]
    This will create a list "actor" with 6 entries indexed from 0 to 5, and every entry is a list with no entries so far.
    [code:27nea85c]actor[0].append("Dewey")
    If actor[0][0] == "Dewey":
        # let Malcolm know about it [/code:27nea85c]
    
    But there's also a module esp for arrays, I didn't work with it yet: [url]http://docs.python.org/release/2.6.6/library/array.html[/url]
  • Anyway, was I right in executing an array variable? I'm really just trying to learn switch over to python.

    You could also create your own class.

    class Actor:
        """Definition of the player characters"""
        
        def __init__(self):
            self.name = ""
            self.level = 0
            self.hp = 0
            self.hpmax = 0
            self.sp = 0
            self.spmax = 0
            self.strength = 0
            self.power = 0
            self.defence = 0
            self.speed = 0
            self.xp = 0
            self.slot = 0
    
    [/code:28afbaku]
    You create an instance of the class by referencing it:
    [code:28afbaku]my_actor = Actor()[/code:28afbaku]
    
    If all player characters start with a certain value, you would of course replace the appropiate values. Also, __init__ is not really a constructor, but works nearly the same way, because this method is automatically called as soon as the class is created. If you'd want to create a new instance of the class with certain values, you'd do this:
    [code:28afbaku]class Actor:
        """Definition of the player characters"""
        
        def __init__(self, name="", level=0):
            self.name = name
            self.level = level[/code:28afbaku]
    Now you could create an instance either way:
    [code:28afbaku]my_actor = Actor()
    dewey = Actor("Dewey", 2)[/code:28afbaku]
    You can still use a list to manage them:
    [code:28afbaku]actors = []
    actors.append(Actor("Dewey", 2))
    actors.append(Actor())
    actors[1].name = "Wanda"[/code:28afbaku]
    And the levelup code could be realized as a method of the Actor class:
    [code:28afbaku]class Actor:
        """Definition of the player characters"""
        
        def __init__(self, name="", level=0):
            self.name = name
            self.level = level
            self.xp = 0
            
        def try_lvlup(self, exp):
            if self.xp >= exp:
                self.level += 1
    [/code:28afbaku]
    Again, referenced and stored in a list, you'd call:
    [code:28afbaku]actors[1].try_lvlup(mrcool_exp)[/code:28afbaku]
    
    But I guess it's just a matter of taste. I prefer the class-way for easier code maintaining (adressing actor[0].strength is more readable than actor[0, 5])