• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Unit standing on Animal

Status
Not open for further replies.
Level 5
Joined
Dec 3, 2010
Messages
119
I wanna make a unit standing on an animal. The unit should for example be normal sized and stand on a 4 or 6 scaled wolf. I tried it already but the unit doesn't stand on the right spot and the unit is as big as the animal. I made a picture in photoshop how it sould look like. Any idea how i can make this?

mountnu.jpg
 
Level 16
Joined
May 1, 2008
Messages
1,605
Well you mean now how to do this in the editor with triggers? =O

In this case can to something like:

-Every 0.03 seconds.
JASS:
local real f = GetUnitFacing(Wolf) - 180.
local real x = GetUnitX(Wolf) ± 0. * Cos(f * bj_DEGTORAD)
local real y = GetUnitY(Wolf) ± 0. * Sin(f * bj_DEGTORAD)
local real h = GetUnitFlyHeight(Wolf) + 200.

call SetUnitX(Dude,x)
call SetUnitY(Dude,y)
call SetUnitFacing(Dude,GetUnitFacing(Wolf))
call SetUnitFlyHeight(Dude,h,GetUnitFlyHeight(Dude)

Hint:
The ± 0 is the distance from the center of the wolf. Possible you have to change this value into - xx or + xx to get the current point.
The + 200. is the height, how high the dude should be over the wolf

Hope this help :p

Greetings and Peace
Dr. Boom
 
Level 16
Joined
May 1, 2008
Messages
1,605
I have no idea how i use jass. Is there a way to make this work with the normnal triggers?

No! No shit GUI from me!

1) Create a new trigger and name it how you want (with no spaces)

2) When you copy the following trigger and past it into your created trigger:
JASS:
function TNActions takes nothing returns nothing
    local unit dude = gg_unit_hpea_0001
    local unit wolf = gg_unit_Hpal_0000
    local real f = GetUnitFacing(wolf) - 180.
    local real x = GetUnitX(wolf) + 0. * Cos(f * bj_DEGTORAD)
    local real y = GetUnitY(wolf) + 0. * Sin(f * bj_DEGTORAD)
    local real h = GetUnitFlyHeight(wolf) + 200.

    call SetUnitX(dude,x)
    call SetUnitY(dude,y)
    call SetUnitFacing(dude,GetUnitFacing(wolf))
    call SetUnitFlyHeight(dude,h,GetUnitFlyHeight(dude))

    set wolf = null
    set dude = null
endfunction

function InitTrig_TriggerName takes nothing returns nothing
    local trigger t = CreateTrigger()
    
    call TriggerRegisterTimerEvent(t,0.04,true)
    call TriggerAddAction(t,function TNActions)
    
    set t = null
endfunction

3) Now you you replace the TriggerName (in the InitTrig function) with the name you chose for the trigger.

4) Also you have to replace "gg_unit_hpea_0001" with the code of the dude and "gg_unit_Hpal_0000" with the code of the wolf.

5) now test it and you got a nice jass code.

Edit: You can just copy the whole code and use jass instead of copy each line into GUi custom script -_-

Greetings and Peace
Dr. Boom
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,468
This:

JASS:
function InitTrig_TriggerName takes nothing returns nothing
    local trigger t = CreateTrigger()
    
    call TriggerRegisterTimerEvent(t,0.04,true)
    call TriggerAddAction(t,function TNActions)
    
    set t = null
endfunction

Should definitely be this:

JASS:
function InitTrig_TriggerName takes nothing returns nothing
    call TimerStart(CreateTimer(), 0.03125, true, function TNActions)
endfunction
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin -_-;

Well I don't understand how you can ruin the whole thing, because you want use a GUI trigger ... bad stuff, but lets see if this work:

  • Test
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Set Dude = No unit
      • Set Wolf = No unit
      • Set Height = ((Current flying height of Wolf) + 200.00)
      • Set Loc1 = (Position of Wolf)
      • Set Loc2 = (Loc1 offset by 0.00 towards ((Facing of Wolf) - 180.00) degrees)
      • Unit - Move Dude instantly to Loc2, facing (Facing of Wolf) degrees
      • Animation - Change Dude flying height to Height at (Current flying height of Dude)
      • Custom script: call RemoveLocation(udg_Loc1)
      • Custom script: call RemoveLocation(udg_Loc2)
Note:
height: is for the position over the wolf
loc2: change "0.00" is the position if the dude over the wolf isn't correct.
dude: you have to store the unit over the wolf in it
wolf: stores the wolf

Greetings and Peace
Dr. Boom
 
Level 7
Joined
May 18, 2010
Messages
264
I can't get it to work. Please make a test map.

He would have to make unit and set all ofsets to the wolf ... u should cofig it to youre self LOL dude =.=
he gave u all u need... going eat in min

if i get time il get u video how to do it

Edit: may i recomend adding a special effect owerhead using the ilidian(deamonhunter) (edit2)( special effect do resize with unit )FAIL
 
Last edited:
Well you mean now how to do this in the editor with triggers? =O

In this case can to something like:

-Every 0.03 seconds.
Jass:
local real f = GetUnitFacing(Wolf) - 180.
local real x = GetUnitX(Wolf) ± 0. * Cos(f * bj_DEGTORAD)
local real y = GetUnitY(Wolf) ± 0. * Sin(f * bj_DEGTORAD)
local real h = GetUnitFlyHeight(Wolf) + 200.

call SetUnitX(Dude,x)
call SetUnitY(Dude,y)
call SetUnitFacing(Dude,GetUnitFacing(Wolf))
call SetUnitFlyHeight(Dude,h,GetUnitFlyHeight(Dude)

Hint:
The ± 0 is the distance from the center of the wolf. Possible you have to change this value into - xx or + xx to get the current point.
The + 200. is the height, how high the dude should be over the wolf

Hope this help :p

Greetings and Peace
Dr. Boom

You forgot to say "moin moin" :ogre_hurrhurr:
 
Status
Not open for further replies.
Top