Von Perkele's Forum Posts

  • By the way, if you want an event to run if certain conditions are not met, what's the difference between using "PickedCount = 0" and using "Else" after the conditions? Don't they complete the same goal?

  • Dop, thanks for the reply!

    AllanR, thanks for reply! Yes I noticed that the problem probably was caused by the order the events run since the event worked when it was not connected to the "on start of layout condition".

    I'm thinking about using "pick by evaluate" instead of "compare two values" and running the event with "trigger once" instead of "on start of layout" condition, which seems to work fine this far.

  • Hello,

    I'm making a function to create objects called SPRITE in the start of the layout. The function is supposed to test if another SPRITE is too close to the supposed spawn point before creating another SPRITE in the spawn point.

    The function has Spawn.X and Spawn.Y parameters. These are changed by a loop that runs before the function and that part works fine.

    So this is how i'm trying to set up the spawning:

    Conditions:

    SPRITE.NUMBER = 0

    Action:

    Create SPRITE at Spawn.X, Spawn.Y

    (this is to spawn the first SPRITE and this part works correctly).

    Conditions:

    SPRITE.NUMBER > 0

    1. Pick all SPRITE

    2. Use system condition compare two values: Distance(0,SPRITE.Y,0, Spawn.Y) < desired minimal Y distance.

    3. Use system condition compare two values: Distance(SPRITE.X,0,Spawn.X,0) < desired minimal X distance.

    4. PickedCount = 0

    Action:

    Create SPRITE at Spawn.X, Spawn.Y

    Only the first SPRITE is created. When I toggle disabled the conditions the function works just fine. It's just that I can't seem the function to properly evaluate the spawn point distance to the previously created SPRITEs. I have also tried replacing the compare two values conditions with the pick by evaluate system condition with no luck.

    Thanks for help!

  • You do not have permission to view this post

  • Hey,

    I'm creating an event that generates clouds randomly to the background. I don't want too many clouds to overlap, however. I want to create events that destroy the cloud directly after it is created if it overlaps too many other clouds.

    I tried to do this by using an instance variable to measure how many other clouds a cloud is overlapping, for each loop, and PickedCount.

    Event: If object "Cloud" is overlapping "Cloud".

    Sub-event: For each "Cloud".

    Sub-sub-event: "Cloud" is overlapping "Cloud" => Action: Set instance variable "overlap count" Clouds.PickedCount.

    Sub-sub event: If instance variable "overlap count" > 4 => Action: destroy "Cloud".

    However, this doesn't seem to work. It seems like in this instance the program doesn't recognize when clouds are overlapping each other.

  • Anyone got any suggestions?

  • Hello.

    I was wondering if it's possible to create an effect that simulates sunrise in the following way.

    The layout has 3 layers. The layers are in the following order (first ones being placed further below in Z order).

    1. Sky.

    2. Ground.

    3. Skyline objects (items that may create a silhouette over the Sky layer and are also visible above the Ground layer).

    Now what I want is to create is a lighting effect that only affects Ground and Silhouette layers, not the Sky layer. Say I create a new 4th layer called "Effects" for this purpose and place it above all the previous layers. Is it possible to make it so this layer does not affect the Sky layer, even though the Sky layer is below the Effects layer in Z-order.

    Help much appreciated!

  • You do not have permission to view this post