R0J0hound's Forum Posts

  • It's not too hard. The idea is you can request the header instead of the file and get the file size with that. It uses the "head" http request, which isn't implimented in the Ajax plugin (only "get" and post are implimented).

    Whatever works though.

  • BereLaDD33

    First set gravity to zero. Then you can google two formulas.

    The first is "universal gravitation". It's a formula for calculating the force between two objects. Basically every tick you'd apply the force calculated by that equation toward another object.

    The "G" value you'd tweak to be more of the scale that fits onscreen. You may also tweak the object masses.

    The second formula is "orbit velocity". Basically take the angle from the moon to the earth, add or subtract 90, and set the velocity of the moon in that direction with the result of the formula.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What the ajax plugin can do is all listed. You could google how it would be done via JavaScript. "Ajax file size" yielded an answer in the first three results. Next you could see if that can be duplicated with what the plugin provides or use the browser object to run that js directly. Since it's an asycronous thing you could make a C2 function be the callback when it finishes.

  • While the Ajax plugin doesn't provide the size it does give the progress of the download in percent. Shouldn't that be enough feedback for the user? You could figure out the rate of the progress and give the user an eta as well.

  • There may be a way to do it with regex.

    Another way would be to use the find() expression to find the first occurrence. Then use the mid() expression to get the text after that occurrence. Next use find() on that again to get the location of the second. Then you could rebuild the text around it.

    Basically this. It's untested so there may be a few off by one issues.

    Var text="Hi, Bill. My name is Bill."

    Var temp=""

    Var index=0

    Index=find(text, "Bill")

    Temp=mid(text, index+len("Bill"), len(text)-index-len("Bill"))

    Index=find(temp, "Bill")+index+len("Bill")

    Text= left(text, index) & "bob" & mid(text, index+len("Bill"), len(text)-index-len("Bill"))

  • The only solution I can think of would be to not use pin and implement something like pin with just events. But that can be tricky as well.

  • Pin locks the position, so you'll probably need to unpin it first, then re-pin after repositioning.

  • I'm probably just explaining it poorly. Here's an example of it if it helps.

    https://dl.dropboxusercontent.com/u/542 ... ottom.capx

  • A full rotation is 360 so you could just add 360 to degreesToMove multiple times.

  • The actions are a set position and set size action using the equations I linked to. I'll have to defer to someone else for further discussion or perhaps alternate solutions.

  • "within 60 of 30" would mean 330 to 90, or 60 degrees in each direction from 30. So it probably is easier for you to just use the "is between angles" condition instead.

    I don't understand your last question. The equation is:

    speed = sqrt(2*deceleration*degreesToMove)

    It calculates the speed needed so when using a certain deceleration it will stop after rotating degreesToMove degrees. The speed will be higher for higher values of deceleration and degreesToMove.

  • Only "scale" is used in the set height expression. It's actually the same as if you squished the height with it scaled around the origin. The only thing that changes when you scale from a different point is the object needs to be moved.

  • Off the top my head there is the audio analyzer example bundled with C2. It works with sounds you play from your game. To use it with you mic add the userMedia object to access it, and it then is tied in with the audio plugin. line out/line in aren't accessible as far as I know.

  • adcornaglia

    That bit is already implemented in C2.

  • A global variable would be the easiest. You can get the name from the player with a Textbox object, and then set the global from that. So say you call the global variable "hero", you can then build the text the npc says with an expression like:

    "hey " & hero & " how are you?"

    hero & " , can you get me this stuff?"

    The key thing is "&", which combines values together as text.