1. #1

    How do you go about making in-game bullets?

    Hi. I'm trying to make turrets that will shoot at the player in my third person game. I know how to get the aiming wright, but I have no idea on how to make actual bullets that do damage when they hit the player. Any suggestions?
    Share this post

  2. #2

    Re: How do you go about making bullets?

    http://www.ehow.com/how_2212846_make-ammunition.html

    sorry, couldn't help myself. I don't have a clue but someone will know
    Share this post

  3. #3

    Re: How do you go about making bullets?

    Originally Posted by Ragmen86
    http://www.ehow.com/how_2212846_make-ammunition.html

    sorry, couldn't help myself. I don't have a clue but someone will know
    Changed the title. -____-
    Share this post

  4. #4

    Re: How do you go about making in-game bullets?

    Two ways- monitoring applied force or hitpoints, or making custom health with set value event, and hit trigger.

    I am currently in the process of making a third person shooter too. Be warned it takes forever.

    If nobody has helped you by the time I wake up then I'll explain it to ya then, right now my head hurts from building various different custom in-game enemies and am tired.
    And im not talking about copy n paste barrels.
    Share this post

  5. #5

    Re: How do you go about making in-game bullets?

    Originally Posted by apdenton1
    Two ways- monitoring applied force or hitpoints, or making custom health with set value event and var data source.

    I am currently in the process of making a third person shooter too. Be warned it takes forever.

    If nobody has helped you by the time I wake up then I'll explain it to ya then, right now my head hurts from building various different custom in-game enemies and am tired.
    And im not talking about copy n paste barrels.
    No worries. I'm still in the middle of getting the damn camera controls working correctly. Almost done now, then it's onto the movement, then I can finally start building the frikin' level.
    Share this post

  6. #6

    Re: How do you go about making in-game bullets?

    Originally Posted by James24993
    Hi. I'm trying to make turrets that will shoot at the player in my third person game. I know how to get the aiming wright, but I have no idea on how to make actual bullets that do damage when they hit the player. Any suggestions?
    you can take the suspension RR in the car section (they look pretty close to bullets) then use ope and hook it up to an interval trigger then hook for example the x coordinate up to a linear data source then set it to looping so the bullet will keep moving foward and then come back and start again youll have to play around with the speeds of the bullet though.
    Share this post

  7. #7

    Re: How do you go about making in-game bullets?

    Okay still not slept yet so ill get this over with quick.

    1. Place Hit trigger down

    2. Set hitting objects 1 as bullet, hitting object 2 as custom game character. Uncheck the disable after hit box.

    3. The same hit trigger select on hit and connect it to a set value event.

    4. Set value event properties- increase, value (insert the amount of damage you want them to do, we say 20 for now)

    5. place a variable data source and a generic filter down, then go into properties of set value event and select the var data source as the event target and the generic filter as the impulse target.

    6. generic filter properties: set slider to greater, operand 1 press Y and target the variable data source. operand 2 set to the max health you want your player to have (say 100 for now, so 5 shots and you die)

    7. The generic filter again: on true select an end game event.

    This is the most basic form of a health system and on request I'll explain the rest.....tommorow.

    Or maybe Dasraiser should take the credit .
    Share this post

  8. #8

    Re: How do you go about making in-game bullets?

    I have no idea, I've been working on it for so long. I've taken everybody's advice from the multiple threads I've made and I've still got nothing. For about 2 months I've been trying to get it to work. I can do just about anything else on this game except this. How is this possible? I played one turret game in which someone got it to work properly. I wish I knew their secret.

    Anyway, I hope you do achieve where I failed.

    EDIT: I might just move on from the level editor of this game and just make my games in javascript. I strangely have a much easier time there. It just takes longer.

    However, I still feel the need to just make bullets work.
    Share this post

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

    Re: How do you go about making in-game bullets?

    if you got the turret aiming ok, try

    THIS IS A PHYSICS BASED BULLET not OPE

    you can use object info sources to get the XYZ and Angels(XYZ) of your turret (or a dummy object glued to the exit point of the barrel, probably best) , put this info into an OPE pointing to your bullet, with local turned off on all and set rotation checked.
    (edit: AngelX goes to Yaw, AngelY goes to Pitch and AngelZ goes to Bank)

    when you want to fire, send one impulse to the OPE and pass from the OPE the impulse event/filter to an impulse delay of 1tick and pass this to a physics event that turns physics on your bullet.

    your bullet will be some object with a directional force that is glued to it and set to target it.

    now when it fires, if it goes of in the wrong direction , dont panic just rotate the directional force and bullet object to compensate, this is because the pivot of glue is at a different local coordinate system to that of the turret/dummy object, alternatively you could rotate the dummy object to match that of the bullet, that is if you used one.

    for hit point system use what apdenton1 suggested.

    hope this helps, or points you to a solution.
    Share this post

  10. #10

    Re: How do you go about making in-game bullets?

    Originally Posted by apdenton1
    Okay still not slept yet so ill get this over with quick.

    1. Place Hit trigger down

    2. Set hitting objects 1 as bullet, hitting object 2 as custom game character. Uncheck the disable after hit box.

    3. The same hit trigger select on hit and connect it to a set value event.

    4. Set value event properties- increase, value (insert the amount of damage you want them to do, we say 20 for now)

    5. place a variable data source and a generic filter down, then go into properties of set value event and select the var data source as the event target and the generic filter as the impulse target.

    6. generic filter properties: set slider to greater, operand 1 press Y and target the variable data source. operand 2 set to the max health you want your player to have (say 100 for now, so 5 shots and you die)

    7. The generic filter again: on true select an end game event.

    This is the most basic form of a health system and on request I'll explain the rest.....tommorow.

    Or maybe Dasraiser should take the credit .
    this is missing 2 important notes , bullets need to have physics enabled and the hit trigger will only work inside the physics bubble

    it depends on how you want the dammage system to work

    simplest way is just move the bullet with ope and when the bullet arrives (with a hit trigger or with some generic filters that check if the bullet hes reached his destination or when the distance between them is 0(this depends on how your moving the bullet))let a impulse be send to the dammage system(like the one descibed below or some other system of your choise)

    you need to know what you want it to do
    Share this post