randomly's Recent Forum Activity

  • R0J0hound

    Thanks for the answer.

    Actually, the launching position is higher than the ground.

    I tried applying your original formula to my project, exchanging the speed to the bullet's speed and changing all other stuff to my equivalent objects (which didn't work).

    If I now want to use the solved two equations for an elevated launch position, what shall I modify?

    And for the initial y and x velocity, should I just take the velocities from the debug mode (being x=400 and y=0 on launch)? Because the Bullets behaviour obviously doesn't allow me to set x and y velocity seperately..

    [EDIT]

    I figured I maybe have to set the initial y velocity to launching_speed*sin(launching_angle)

    and the initial x velocity to launching_speed*cos(launching_angle).

    Since my launcher's angle is somehow always set as 360-actual_angle, I also figured I'd change the launching_angle to abs(360-launching_angle). Using this, my current setup looks like this: i.imgur.com/TK4pTAQ.png

    It kinda works, but the accuracy is always ± ca. 100 pixel (horizontally) which is not exactly what I'd consider accurate...any idea what I did wrong? Is it the elevated launching position?

  • Wanted to download the Free Assets .zip file on the bottom of every scirra.com page.

    It says "13MB", it's actually around 34MB.

    Nothing important, but worth mentioning I guess.

  • So what you basically want to do, is to load up those values for the last used slot?

    At the end of a game (e.g. when the player closes the game) you want those values to be saved and loaded up when the game starts the next time, right?

    Sorry, I still need to grasp what your plan is here. ;)

    If that is your idea, then what you need to do is:

    • add the Local Storage object to your project
    • at the point where you want to save the values to the Local Storage, add an action for Local Storage, by the name of Set item.

    Now you can choose a key name and the value for that key.

    You could either just go with one key and format your three values as a simple string which you would have to parse on the start of the game. [This could look like this:

    Set item "slot1" to: "#1" & HasSaveData_Slot1 & "#2" & CurrentLives_Slot1 & "#3" & CurrentWorld_Slot1[/code:3a4suqmx]At the start of the next game, you would then get the item "slot1" and parse the string via some system expressions ("find", "mid",...)]
    
    [b]Or you could simply[/b] go with three [i]set item[/i] actions to save each variable as an individual key.
    This would look like this:
    [code:3a4suqmx]Set item "HasSaveData_Slot1" to: HasSaveData_Slot1
    Set item "CurrentLives_Slot1" to: CurrentLives_Slot1
    Set item "CurrentWorld_Slot1" to: CurrentWorld_Slot1[/code:3a4suqmx]
    
    [b]No matter which option you choose:[/b]
    At the start of the game, you would go with an action[code:3a4suqmx]Check item "itemname" exists[/code:3a4suqmx]
    (replace "itemname" with either "slot1" or "HasSaveData_Slot1", .... depending on which option you chose previously)
    Followed by an event [code:3a4suqmx]On item "itemname" exists[/code:3a4suqmx]containing the action [code:3a4suqmx]Get item "itemname"[/code:3a4suqmx]
    You would then follow this again by an event[code:3a4suqmx]On item "itemname" get[/code:3a4suqmx] containing actions which either
    a) parse the single key "slot1" to apply them to the variables in the project
    or
    b) apply each of the three keys "HasSaveData_Slot1",... to the corresponding variables.
    
    That would be it.
    This sounds more complicated than it is and I would really like to assist you with images, but I can't do this atm.
    Of course, these instructions only apply if I understood your explanations correctly.
    
    I hope, I didn't explain the whole process to you when you already knew it and were asking for sth. completely different.
    Let's just hope I could help you somehow. :)
  • blackhornet

    That's a nice implementation, well done. Way smoother than mine.

    mrinmoysd

    I guess you have enough examples to start off on your own now, huh? :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • blackhornet

    That link doesn't work for me..

    Though your page is quite interesting..

  • Hey man,

    where exactly do you want to save those flags to at the start of the game?

    To global or local variables?

    And how are those flags stored in general? Are they stored via the LocalStorage object? Or in a variable?

  • Hey R0J0hound,

    just discovered this thread when searching for an impact prediction for a bullet-behaviour-controlled object.

    I tried to apply your calculations to my project, but that didn't quite work out, since my setup is a bit different compared to yours.

    Can you help me with this? (Image of current setup further down)

    I have the following scenario:

    A projectile with the bullet behaviour gets shot from a specific angle (and a slightly elevated position) at a specific initial speed (400) and gets dragged down by the bullet's gravity (450).

    So the thing is, I don't set the initial horizontal and vertical speed with the mouse, but with the bullet's initial speed.

    I want to mark the impact point on the ground (at a specific y = 570) with a sprite.

    So I tried to set the sprite's position to posx,570, after repeating the loop 11 times.

    The sprite was somewhere near the impact point, but nowhere near the accuracy in your example.

    My question to you is now:

    To which number should I modify the loop count and do I even need a step value, since I don't need any trajectory displayed?

    Thanks for any answer, here is my current setup:

    http://i.imgur.com/Nrrat3j.png?1[/code:1rx64nho]("Launcher" is slightly elevated)
    (I don't expect you to deal with the mess of my capx)
    
    (Btw, I took a look at the bullet launch in the debug view and figured that on launch, the bullet's vx0 is the set Bullet.Speed and vy0 is always 0, maybe that's an issue here..)
  • newt Thanks, that works perfectly. I thought you meant some kind of behaviour expression.

    What does the "dt" do again? I understand what the "dt" expression does on its own, but what does it do in this expression?

    Does it ensure that the missile just turns when a frame is being rendered and not every tick?

  • I just found this thread: scirra.com/forum/viewtopic.php

    Wonder why I didn't find that through the search function...

    I'm sorry for repeating this question, I'll try your solution and try the solutions from the thread.

    [EDIT: I tried your solution @badmoodtyler, but it keeps turning in a counter-clockwise direction, so it always chooses the second option which actually can't be possible.. :( I'd love to send you a video but my internet won't allow it..]

  • newt

    Thanks for the reply!

    You probably meant "anglelerp(self.angle,angle(self.x,self.y,target.x,target.y),turningspeed*dt)" right?

    Do you take the turning speed from the turret behaviour?

    Like this? i.imgur.com/DLnW3TE.png

    The setting I have now results in some pretty heavy jittering of the bullet (I would upload a gif but I'm in a remote location atm and the internet is via satellite and thus, really slow).

  • You can go with the NW.js object, and add the "Run file" action.

    Though that would mean that you would have to:

    1) export the project as an NW.js application

    2) store the .pptx file on a temporary local location to be able to run it via the NW.js action

  • The first question would be how you are storing the username.

    Are you storing it as a global variable or as a dicitonary value or as an XML value?

    The way you would check whether the name already exists, varies depending on how you store the usernames for your chatroom.

randomly's avatar

randomly

Member since 26 Sep, 2016

Twitter
randomly has 1 followers

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies