vee41's Forum Posts

  • Here, even made example for your viewing pleasure :)

    Tree example

  • That doesn't work for the same reason that my original couple of simple ideas didn't work: there might be 30 trees on the map, but there is really only 1 "tree." You have to use the UIDs to distinguish between different instances of trees in order to individualize each tree, or else the opacity will be set to 75% for each consecutive tree you walk into without it reverting to 100% until you aren't touching ANY trees.

    You just end up with half of the trees being transparent that way. :)

    Actually it should work, as each tick it sets every trees opacity to 100. After that it checks if player is overlapping any trees, and lowers their opacity. Don't see why it would not work :)

  • Well you can't do all properties, but you can still select an object with a named variable.

    Object Compare Value

    or

    Compare Two Values( <object.property> = <value> )

    That will select the object.

    Compare two values does not do any picking, says so in the tooltip even :)

    And to original poster: Like said before, you can do that by comparing a single property. If you have variable name, doing 'Object compare instance variable name = Bob' would pick all objects that are named Bob.

  • I believe this would work as well:

    Every tick: Set tree opacity to 100

    Player is overlapping a tree: Set opacity to 25

    No need to hassle with uids or loops :-)

  • I'm picking this thread to show my support.

  • Deltatime is a constant... just reference it in your event by using Background.x=Background.x+6*dt (experiment here...)

    Actually delta-time is not constant, it is time that has been elapsed since last tick occurred. That can vary. :)

    When using delta-time, you really can't say 'move 6 pixels forward every tick' as you are just going against the whole principle of the thing. Instead, you can say that 'move 6 pixels in time frame of one second'.

    DT creates framerate independence. Regardless of what FPS player has, the object will move those 6 pixels in time frame of one second if you are using dt. If you are not using it, player with lower FPS would move LESS than player with higher FPS, as he will have less ticks in a second.

  • Add 'for each family1' after the 'is visible' condition. Right now they are both selected, but only first one of the picked objects is referred.

  • Make a function as a constructor replacement, and this is where it gets confusing to me:

    <img src="http://cannedessence.com/construct2screens/constructor2.png" border="0" />

    Why does this work? Notice the second action in the Create_Ball function. Shouldn't this pick all instances of Ball, since the event doesn't pick any instances of Ball? Somehow it picks the most recently created Ball, which works here. However, it doesn't seem right, so I don't want to rely on it.

    I can't put an On Created trigger inside the function definition because they are both triggers.

    Is there something I'm missing about this?

    Thanks!

    The create action picks the created instance, so you are only referring to that instance. So you could get rid both the function and on created, then do this:

    create ball

    set ball scale to 2

    It would work just as well :) But yea, it's not really ideal to my workflow at some times either.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • One alternative would be to make your own waypoint system. Here is an quick example:

    Waypoint example

    The general idea is that each WP is linked to next WP's UID (can be done in the editor), then the navigators just follow path formed by those WP's.

  • I'd do it with a container. Just don't create (in editor or in game) any sensor instances, as they will be created automagically.

    Just pin the sensors to a car at 'on created' event and you should be good to go.

  • Something like

    When all zombies are dead

    .. Spawn a new wave of zombies that is 1 bigger than last one

    It would translate to C2 events like this:

    global variable : Zombies = 10

    zombie.count = 0

    trigger once while true

    .. Add 1 to zombies

    .. repeat Zombies times

    ... create zombie at random(x),random(y)

  • Hey Sqiddster,

    I'd love to make the change, but I'm not using any physics in my game. If you notice in the .capx, it's all Solid and Platformer behavior.

    Is there any other solution besides using Physics?

    Josh

    Collision polygon sqiddster refers to doesn't really have anything to do with physics behavior. What he means is, going to iamge editor for each object, and checking that their collision polygon (the icon at the bottom of toolbar) is what you want it to be. Your 'movingTileUpDown' has some funky going on with it's polygon.

  • Here is an old demonstration where you can see the exact mechanic:

    Evil sprites

  • Set randomNumber to floor(random(charArray.width)). And do make sure your arrays size is not smaller than what you need.

  • I usually do it like this:

    Pick all

    Pick objects you want

    If I need some values from the original instance, I usually save them into local variable or use a function.