1. #1

    Could someone maybe give me a step-by-step guide on how to..

    make bullets function correctly? I have a turret and I want it to shoot bullets. I've used the object position event (local) to move it forward. The object position event has a linear value attached to it, and I've made it so after about 100 milliseconds it'll turn off and reset it, supposedly making the bullet go back to where it was. It doesn't work though when I actually turn the bullet. It'll teleport somewhere different. I get that it's on local and everything, but wouldn't it still come back to that exact location?

    I've also tried using a global object position event to help me. I made it so that instead of the linear value I have set up to the object position event resetting, the global object position event will just put it back in its original position before it got fired. That didn't work though, maybe I did something wrong, but all I remember is something weird happening...Can't quite remember.

    If you don't understand what I'm saying, then that's fine. I've gotten some help on this subject on this forum, but I'm in need of a full explanation. I have a turret set up, I just need to know how to get the bullets to work. I already have it so that the bullet can turn, and that it can shoot, it's just that it doesn't come back to its original position.

    I can pretty much do anything else in this game, but when it comes to making bullets I'm stumped.
    Share this post

  2. #2

    Re: Could someone maybe give me a step-by-step guide on how

    Set the OPE so that your bullet moves from point A to point B. Set your data sources to looping. Thats it. Bet you're kicking yourself how simple it is! lol Hope that works for you.
    Share this post

  3. #3

    Re: Could someone maybe give me a step-by-step guide on how

    Originally Posted by Barrybarfly
    Set the OPE so that your bullet moves from point A to point B. Set your data sources to looping. Thats it. Bet you're kicking yourself how simple it is! lol Hope that works for you.
    That doesn't work, I can easily move the bullet, it's just that I want it so that I can turn the bullet in-game anywhere, shoot it, and make it come right back. The two things I tried SHOULD of worked, but they didn't. I am trying to think of how the bullet could just teleport somewhere besides where it originally was if it's on local and is being reset. I can't come to any conclusion on that.

    I thought making a bullet would be easy, but it's really, really, really hard.
    Share this post

  4. #4

    Re: Could someone maybe give me a step-by-step guide on how

    I thought you just wanted the turret to fire bullets on a set trajectory. Hopefully someone else can help, I'm not sure I really understand what you're after or that I'll be able to haelp!
    Share this post

  5. #5
    dasraizer's Avatar Senior Member
    Join Date
    Apr 2014
    Location
    UK, Isle of Wight
    Posts
    1,195

    Re: Could someone maybe give me a step-by-step guide on how

    if you are using local coordinates, you will have to add to its position: original location subtract current location using object info spies to get it back to its origin, the problem with local coordinates, i believe, is they use the objects rotational axis (red=X, Green=Y and blue=Z, see dummy object, its a great visual aid) so when switching to global your object will take a different flight path with some arbitrator rotation set.

    its just occurred to me that you can always grab the bullets start coordinates and then when you need to reset it, switch with some user variable the Local settings under the OPE to unchecked (0) to make it a simple global reset before it fires again.


    hope this points you to a solution.
    Share this post

  6. #6

    Re: Could someone maybe give me a step-by-step guide on how

    Originally Posted by dasraiser
    if you are using local coordinates, you will have to add to its position: original location subtract current location using object info spies to get it back to its origin, the problem with local coordinates, i believe, is they use the objects rotational axis (red=X, Green=Y and blue=Z, see dummy object, its a great visual aid) so when switching to global your object will take a different flight path with some arbitrator rotation set.

    its just occurred to me that you can always grab the bullets start coordinates and then when you need to reset it, switch with some user variable the Local settings under the OPE to unchecked (0) to make it a simple global reset before it fires again.


    hope this points you to a solution.
    I've tried the bolded mentioned it in the topic) and strangely it didn't work. It SEEMS like it would work, but it doesn't. I'll try it again. I mean it's ALWAYS supposed to go to that spot, right?
    Share this post

  7. #7
    dasraizer's Avatar Senior Member
    Join Date
    Apr 2014
    Location
    UK, Isle of Wight
    Posts
    1,195

    Re: Could someone maybe give me a step-by-step guide on how

    i agree, if local is set to a user variable that's holding zero as its value, i would assume its set on global.

    i would check your impulse chain and make sure everything fires in the right order.

    most levels i create/play with use one interval trigger for the main chain of functions, so things like spying on an object 1st before moving it; if for instance i need its last location for an effects function, will occur in the chain before i move the object. if i need any more interval impulses, they would be mainly for colour cycling or a watchdog for an event to happen.

    if all else fails as Barrybarfly sort of said, place a dummy on the end of the barrel and use that as the starting point, use one for the end point glued to the 1st, using 3 linear numbers (XYZ),so making the X axis set the Start to dummy1X and End to dummy2X, do this for Y and Z, as long as all the run times for the linear numbers match will produce a simple interpolation between the start dummy and end one, then hook all 3 to your OPE world coordinates.
    Share this post