• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Oblivion based ranged bolt spell

Status
Not open for further replies.

Jumbo

Hosted Project GR
Level 19
Joined
Jun 22, 2007
Messages
1,314
hey im trying to create a "oblivion based" bolt ability, and what its suppost to do is that the ability fires towards the target point and explode on point, but if there is a unit in the way it will explode on the unit. So far i have tried to make a dummy unit which when units come within 100 range of the dummy unit, it stops moving to the target, and explodes, but i couldnt rly get it to work.. Once again i need help :confused:
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
I do not recall spells exploding in TES oblivion where you wanted them to, instead they went in a straight line untill they hit something.

Well anyway, you simply have to create a unit collision detection system by using the unit enters X distance of unit event for efficency or a generic pick of all uints near by, which i do not recommend since it is too unefficent.

remember when using that event that there is no function to get the unit which distance was enterd of (the unit you gave for the event) and so you will eithor have to use a struct system or a chache system like handle vars which you attach the center unit to the trigger and so you can retrieve it appon a detected collision.

For movement you can eithor use the standard WC3 move which can bug, a trigger based movement system which is more precess intensive or a basic terane phisics enhanced movement system that is recomended for this kind of spell as to stop the bolt suddenly flying up or off cliffs and remaining beautifully the same ammount above the ground which TES oblivion did not have. If you have studied phisics and have decent know how of maths such height systems are easy since you can get the terane height and the projectile flying height and add them to get the total height which the bullet has to mantain or in the case of a hill / cliff explode at (if the total height is less than the terane height). It does get complex though when you are dealing with firing from a cliff or elevation since you have to include Z rotation of the projectile and losing/gaining height as it moves as to stop it being tedious and hard to aim and hit stuff.

For the Z rotation you can do the easier method of simply reducing or increasing the total height by a culculated ammount by compairing the height of the target location and the location of the caster which yeld the same results as a Z rotation but more efficently as you do not have to constatly preform advanced trigometrical culculations.
 
Status
Not open for further replies.
Top