HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Shoot System Help

04-30-2007, 12:30 AM#1
DanL.
I am working on a system for my upcoming secret 3rd person shooter.
Basically what im trying to accomplish in this system is when a unit uses the ability "Shoot" another unit(bullet placeholder) spawns at the point of the person using the ability then automaticlly moves towards the direction which the caster is facing.
Only stopping when it hits a unit or another object.
If the bullet comes in range of hitting another unit it explodes and deals (x) damage. If it hits a doodad it explodes but deals no damage.

Here is what I came up with in the triggers so far but im having trouble since im not a triggerer.
This trigger right here is only for testing but when the game is finished it will turn into a selection system where you can customize what you choose.
Trigger:
Spawn
Collapse Events
Player - Player 1 (Red) types a chat message containing -spawntest as An exact match
Conditions
Collapse Actions
Unit - Create 1 Movement Test for Player 1 (Red) at (Center of TestSelect <gen>) facing Default building facing degrees
Set TestSelection = (Last created unit)
Game - Display to (All players) the text: Test Enabled: Dont ...

Here is the motherboard of the trigger basically what I am trying to do is have the bullet keep going straight till it hits a target but I dont know the triggers so I put in a placeholder for reminder.
Trigger:
Shoot
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Shoot Test
Collapse Actions
Unit - Create 1 BulletTest for Neutral Passive at (Position of TestSelection) facing Default camera angle of attack degrees
Set BulletTest = (Last created unit)
Unit - Order BulletTest to Move To (Center of (Playable map area))

Here is the trigger for the target hitting. Right now I dont know how to do the when the unit comes in range since it wont let me use the bullet variable.
Trigger:
Hit Target
Events
Conditions
Collapse Actions
Unit - Explode BulletTest
Unit - Cause BulletTest to damage (Picked unit), dealing 300.00 damage of attack type Pierce and damage type Normal

Thank You in advance. -DanL.
04-30-2007, 12:55 AM#2
grim001
Here are the steps you need to follow to accomplish what you want to do:

1.) Learn to use JASS
2.) Use a physics engine to handle projectile movement and collision detection

Otherwise you're gonna be stuck with some pretty lame projectiles, unless you want to put a lot of effort into creating your own system for handling them. You could make a primitive one in GUI.

Basically I don't recommend doing this unless you are serious about learning a lot at the same time and changing your mentality of "I am not a triggerer"
04-30-2007, 01:34 AM#3
DanL.
Actually I have looked at JASS for quite some time but I hate it!
But yes I might have to make my own system for handling these little projectiles hopefully someone can point me in the right direction ^.^
04-30-2007, 01:49 AM#4
grim001
Well I'd suggest you start reading about vector math first

http://chortle.ccsu.edu/VectorLessons/vectorIndex.html