Hello everyone! I've been looking around at the traceline tutorials and forums posts on insight on how I could make my Top view shooter.
Most of these tutorials took in consideration the height and a lot of other variables that I don't believe I would need for a top view shooter. I've been trying to work with something of my own using bits and pieces of tutorials here and there. Its not pretty. I could really use some help.
Here is my code and the map used for testing this.
PointClickedEventsUI-PlayerAnyPlayerclicksLeftmousebuttonDown.LocalVariablesDistance=0.0<Real>TargetUnit=NoUnit<Unit>Player=(Triggeringplayer)<Integer>ConditionsActionsGeneral-Repeat(Actions)2timesActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfPlayer==1ThenVariable-SetDistance=(Distancebetween(PositionofTargetUnit)and(PositionofPlayerUnit[0]))
Variable - Set Target Unit = (Random Living unit from (Units in P1 Click Point having alliance Enemy with player 1 matching Excluded: Missile, Dead, Hidden, with at most Any Amount))
Variable - Set Traceline.targetpoint[0] = (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world)))
Region - Move P1 Click Point to Traceline.targetpoint[0]
Variable - Set Traceline.playerpoint[0] = (Position of Player Unit[0])
Unit - Make Player Unit[0] face (Center of P1 Click Point) over 0.0 seconds
General - If (Conditions) then do (Actions) else do (Actions)
If
1 <= Distance <= 20
(Target Unit is in P1 Click Point) == true
Then
Animation - Play Attack animation for (Actor for Player Unit[0]) as Default, using No Options options and Default Time blend time
Environment - Deal damage using Marine - Guass Rifle (Damage) on Target Unit from Player Unit[0] with 0.0 extra damage
Else
Else
Also, I was wondering if it was at all possible to set up say the marine model to act like a tank. To have bellow the hips moving with the wasd and over the hips move with the cursor position?
Well I don't have time to look too much into it, but it seems you set the Distance before you set the Target Unit, and the Target Unit is used to get the Distance. That means that you are finding the distance to null, which could be your problem. I haven't looked at the rest of the code to see if it would work or not.
You can't. The immortal is actually 2 separate models. So if you have 3ds max, you could chop your marine into 2 models O.o
For "tracelines". Why not just create a missile ability (with no target) and fire it at the target point? I've made many a TDS and never had to use any triggers for shooting (other than ammo and issuing the ability order).
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
I'm right there with you. I use this tutorial to make projectiles. It's very well explained and easy to follow. Once you make the first one, you can easily duplicate it and make new weapons.
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
Well. I was able to re-create a simple gun firing ability. The only down side is that the ability itself makes it that you HAVE to face the direction you are shooting at. My way at least you can face w/e direction you will still fire. Only down side? if you are moving away from your target, your unit will shoot away from the target while still hitting it. Recording with fraps to give a demonstration of what i've got down.
While I find someone to work on the marine model that needs to be cut in half. I figured I'd work a little more on the concept of this map. I figured. Players are going to need a little bit of re-enforcement. So i created a nice little trigger that creates Marines and Medics every 15 second of real time.
The marines attack the enemy base no problem. But only 1 side of medics was following to attempt to heal. I found that kinda odd. So I figured. Meh lets just remove the original order to heal as soon as they spawn and make it more like a real medic AI would be. In was medics stand back before they rush into battle to heal. I figured I'd make a trigger looking like this to achieve these results.
Hello everyone! I've been looking around at the traceline tutorials and forums posts on insight on how I could make my Top view shooter.
Most of these tutorials took in consideration the height and a lot of other variables that I don't believe I would need for a top view shooter. I've been trying to work with something of my own using bits and pieces of tutorials here and there. Its not pretty. I could really use some help.
Here is my code and the map used for testing this.
Also, I was wondering if it was at all possible to set up say the marine model to act like a tank. To have bellow the hips moving with the wasd and over the hips move with the cursor position?
Hmm I have an idea I'll try it and get back to you. I think I may have found a simpler way to do this that eliminates a whole mess of coding.
@DarlD: Go
Well I don't have time to look too much into it, but it seems you set the Distance before you set the Target Unit, and the Target Unit is used to get the Distance. That means that you are finding the distance to null, which could be your problem. I haven't looked at the rest of the code to see if it would work or not.
Great to be back and part of the community again!
@TacoManStan: Go
Yes I just saw that. I'll move it up and update.
Alright Now its working but How do I make my unit constantly face the position of my unit while he keeps running in the other direction?
@DarlD: Go
You can't. The immortal is actually 2 separate models. So if you have 3ds max, you could chop your marine into 2 models O.o
For "tracelines". Why not just create a missile ability (with no target) and fire it at the target point? I've made many a TDS and never had to use any triggers for shooting (other than ammo and issuing the ability order).
@zeldarules28: Go
Tbh the data editor scares me and when I try to create something it usually doesn't work. Perhaps someone could point me in the right direction?
@DarlD: Go
I'm right there with you. I use this tutorial to make projectiles. It's very well explained and easy to follow. Once you make the first one, you can easily duplicate it and make new weapons.
@zeldarules28: Go
Well. I was able to re-create a simple gun firing ability. The only down side is that the ability itself makes it that you HAVE to face the direction you are shooting at. My way at least you can face w/e direction you will still fire. Only down side? if you are moving away from your target, your unit will shoot away from the target while still hitting it. Recording with fraps to give a demonstration of what i've got down.
While I find someone to work on the marine model that needs to be cut in half. I figured I'd work a little more on the concept of this map. I figured. Players are going to need a little bit of re-enforcement. So i created a nice little trigger that creates Marines and Medics every 15 second of real time.
The marines attack the enemy base no problem. But only 1 side of medics was following to attempt to heal. I found that kinda odd. So I figured. Meh lets just remove the original order to heal as soon as they spawn and make it more like a real medic AI would be. In was medics stand back before they rush into battle to heal. I figured I'd make a trigger looking like this to achieve these results.
Thoughts?