• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[HINDYhat System Help]SetProjectileTarget

Status
Not open for further replies.
Level 2
Joined
Nov 7, 2007
Messages
8
Ok In the Particle system by HINDYhat and I want to use the following method "method SetProjectileTarget takes unit target, real speed, boolean staticHeight returns nothing" and make a spell like:
For example: A unit shots a ball that seeks the targeted unit (hyding or adding the Aloc ability to the caster) and when the ball encounters the targeted unit the caster will move instantly to this one (unhyding or removing the Aloc from the caster). The target should be only an ally/friend and the ball have to use the aforementioned funtion for moving of course

JASS:
function Trig_How_To_Use_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000' // Checking if the casted ability is "Shoot"
endfunction
function Therequestedfunction takes nothing returns nothing
    call function
endfunction
function Trig_How_To_Use_Actions takes nothing returns nothing
    local unit caster=GetTriggerUnit() // Getting the caster for further reference.
    local unit target=GetSpellTargetUnit()    local particle ball=particle.CreateProjectile(GetOwningPlayer(caster),"Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl",GetUnitX(caster),GetUnitY(caster),0.,GetUnitFacing(caster))
    // Above^^: Will create a projectile (particle) at the position of the casting unit with a rock as the model
    // First things first, we will add the gravity and collision parameters to the projectile:
    call ball.AddGravity() // Whenever we call a function that uses a particle, we use "call varname.functionName()"
    call ball.SetCollisions( 128.0 , 64.0 , 0.7 , 0.7 ) // The particle will have a height of 128, radius of 64, and friction/bounciness both set to 0.7
    call ball.SetCollisionFunc("Therequestedfunction")
    call ball.SetProjectileTarget(target, 500 , true)
    //method SetProjectileTarget takes unit target, real speed, boolean staticHeight re//This wturns nothing
    // Removing memory leaks.
    set caster=null
    set target=null
endfunction
//===========================================================================
function InitTrig_How_To_Use takes nothing returns nothing
    set gg_trg_How_To_Use = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_How_To_Use, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_How_To_Use, Condition( function Trig_How_To_Use_Conditions ) )
    call TriggerAddAction( gg_trg_How_To_Use, function Trig_How_To_Use_Actions )
endfunction

Heres the example, plz help with this
Thx in advance
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
I highly suggest you not use my system for what you are trying to do. There are projectile systems (I hope) that can do exactly what you are looking for.

And it seems that you are using an out-dated version of my system. Please take a look at Simple Entity Engine. Also, look at a couple of Jass tutorials, because your syntax is very wrong (call function??!).
 
Level 2
Joined
Nov 7, 2007
Messages
8
this part "call function" is only a reference like in the custom script gui example: call my_function(udg_myvar), and about your Simple Entity Engine what method can i use to make an exactly seek ball movement?
 
Level 2
Joined
Nov 7, 2007
Messages
8
ok guys this call "function" is anything that i decided to put, i know that this argument is incorrect, but now i need help with the spell that I mentioned above
 
Status
Not open for further replies.
Top