Nifl's Forum Posts

  • If you want a value that goes from 0.3, to and including 0.6, I recomend this expression instead:

    0.3 + floor(random(31))/100.

    The "Floor" expression rounds of the number downwards;

    30,999->30.

    0,7345->0.

    25,456->25.

    The /100 converts the number into the appropriate potence. (30/100=0.3)

  • From the manual:

    "random(a, b)

    Generate a random float between a and b, including a but not including b."

    This means that:

    Random(0.3 , 0.6) can be 0.3 or more than 0.3.

    but it can't be 0.6. It can at most be 0.59999999 (or something like that, I don't know how precisely random operates.)

  • This was also an answer to what I just wondered... 4 years later. Searching is nice.

  • try this bro

    its a bit outdated but should work.

  • Its the Tenth event. It continuously sets the position and angle to the tank, as long as the Tankturet is on top of the object. I guess it tecnically should wotk to do that- But youll only need to set the pin once, for example at the start of the layout.

    That is: If you change the tenth condition to "At the start of layout" (from system conditions) it will work

  • Yes. Ill try it. Brb

  • I made a fantastically beautiful tank with this behavior. Maybe you can spot some difference between this and your code. I'm sorry I don't know how to help you when I can't seem to get the link working.

    https://drive.google.com/open?id=0B3l68 ... HJLSF9rbm8

  • I can't seam to figure out how to get your link to work. Two basic questions instead:

    Did you set the imagepoint 0 properly for each of the objects? (the Hotspot)

    Did you set the gun/turrets position to the position on top of the tank that you want it to be pinned to before you did the "Pin to object" action?

    Edit: If you didn't do either of those things, it will be wonky ;]

  • Thank you all for the responses you submitted, and for the time it took you.

    It would seam that I was unclear as to the nature of my problem so as to be misunderstood.

    What I needed was a way to pick the object just created in the same tick, and use its variables, image-points etc. in order to calculate where "connector"s

    (objects that blur the borders between "part"s making

    n "part"s appear as one ship, effectively hiding the borders between the "part"s)

    and "gun"s should be positioned, and also create "connector"s and "gun"s in the same tick.

    If I wait 1 tick to create "connector"s, and then wait 1 more tick to create "gun"s, and after that wait another 1 tick to determine some of the values of the "host" object, the game will have gone forward 3 ticks from the initial creation of the "Host" and "part"s.

    This can result in the player first seeing the "part"s of the ship, looking like a collection of objects.

    Then seeing those objects blend together (because "connector"s are created 1 tick after)

    Then seeing "gun"s appear out of nowhere on top of the (now connected) "part"s.

    Then seeing other aspects of the ship change (for each "gun" object, the ship will have less of other variables, for example, it will have less shields, and worse movement)

    So that's really the problem. I can work around this, but it takes much more events (Make things invisible, make invisible objects not register collisions, etc.), so the best thing would be to be able to create things, pick them, look at their values, create more things, etc, all in the same tick.

    Anyway, I think I'll work around it soon, and make the creation of all the different objects forming a ship take place over multiple ticks. I'll wait a few days though I think, so I can see if there is any solution anyone has.

    By the way

    To winkr7 and 99Instances2Go.

    The container approach is nice and often is the best way to do this. It doesn't work for me though, as my project have a different number of "part"s for each "host" object. (there are different ships that are built out of different amount of parts that are spawned.)

    To TELLES0808.

    Your tutorial is for the beta version of construct 2 (r240). So before it becomes stable, people will need to have the Beta release of construct to be able to open it.

    Your idea of saving the "host".UID as an instance variable of "part"s is the one I'm using currently and the best one I think. Pretty much for the reasons you gave; (being able to pick any "part" of any "host" that I want. (I'm also numbering the different "part"s of each "host" object, so I can pick specific "part"s of specific "host"s by picking "part"s with "part".hostUID = n

    1

    and "part".partID = n

    2

    .)("hostUID" and "partID" are instance variables of the "part" object.)

    Lastly

    Thanks again all for the responses.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • My solution is a bit complicated. Its basically adjusting after the fact by remembering what direction the kicked object came from by remembering the moving angle in a variable, and then nudging the object in the right direction. Its pixel perfect though. and the cap should explain it.

    https://drive.google.com/open?id=0B3l68 ... zFMbF9pSDQ

  • Hello all!

    I'm building a "spawner engine" for creating enemies in my space shooter game where enemies consist of several sprites named "Part" each with their own variables pinned to another sprite object named "host", with other variables.

    I need to pick the "part"s after I just created them. It seams, however that they can't be picked. I don't understand that, since I can pick another sprite also just created. The reason I have a hard time working around this is because my spawning system consists of multiple functions that are called in succession and something like a hundred or so variables for everything.

    (Individual part size, how connectors are spawned and positioned, animations, and angle for them, several armor, shield and health values, total enemies spawned, and in what formation, their angle and movements, variables to determines behavior for those, weapon position, sizes, numbers, angles, cool-downs, etc. And other stupidly complicated shit for someone like me.)

    If I wait 1 tick, for every time this problem occurs, and create a system which goes around this by waiting 1 tick, and then picking these object from some variable I set in order to remember them, the game might be delayed several ticks in total due to this problem occurring multiple times.

    I cut down my project extensively to only a few events, in order so illustrate my problem. I would greatly appreciate any feedback any of you <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> / <img src="{SMILIES_PATH}/icon_e_ugeek.gif" alt=":ugeek:" title="Uber Geek"> / <img src="{SMILIES_PATH}/icon_twisted.gif" alt=":twisted:" title="Twisted Evil"> might have.

    https://drive.google.com/open?id=0B3l68 ... HRxM2MxWUk

  • I don't think rotating a 9-path is possible. The capx I made simulates this though. So maybe that will solve your problem. Otherways. there is a plugin called "Canvas". I have never used it. but I think it can be used for this as well. Although I think that is very computer intensive, as it would require a copy-paste type of simulation every tick. Anyways. Take your time. <3

  • I'm not sure I understand, are you trying to make something like this?

    https://drive.google.com/open?id=0B3l68 ... 19ldk5rYkk

  • Debug-mode always lags for me. Does it lag without debug-mode for you?

  • The effect "Color" applied to an object over the colored one does this.

    Example: https://drive.google.com/open?id=0B3l68 ... zU4NWdjbk0

    Have a good day.