• 🏆 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!

making a model swim

Status
Not open for further replies.
Level 2
Joined
Aug 7, 2009
Messages
13
since this is my first thread I don't know if I'm in the right place but here it goes.
I'm using GUI to change a model of Evil Arthas to sink in deep water and still move. like the horse is swimming. I've tried using the hydra model to do this and I also tried a custom model of EA that changed the movement to amphibious but nothing is working.
I was also going to change the height by changing the movement to flying and then adjust the height by having him enter a region but I I don't know how to do it.
At the moment I'm trying to learn JASS but it is slow going.
can someone nudge me in the right direction.
thanks:emote_smile:
 
Level 4
Joined
Jul 24, 2009
Messages
1,842
LOL! You cannot change a model in World Editor. No way. Making it amphibious? LAME. Models aren't changed in World Editor. Neither JASS has nothing to do with this. You need to:
1. Post this in request forums
...or
2. Download War3 Model Maker tool and learn modelling. With it you can make unit animations. Hard job though.
 
Level 19
Joined
Jul 19, 2006
Messages
2,307
You mean drowning?

You are of no help whatsoever to anyone.

@prophetboy: What you are asking is whether or not you may add swimming animations to models via the World Editor? Well, the answer is no, unfortunately. You need to use exterior model editing programs, but you may add special effects to a unit and change their movement type to amphibious if that's all you're looking for.

EDIT: Sinking probably just depends on the height of the water, or on the model itself.

thanks
I guess your birthday was 10 years too early.

Huh?
 
Level 2
Joined
Aug 7, 2009
Messages
13
thanks Scyth-master

that's what I'm trying to do. when I chage a flying height of a unit to zero or below when it enters a region it wont drop below ground level. the dragonhawk rider will kind of do what i'm talking about when used so I changed the art-model for this unit to the evil arthas art-model. it still only walks on the water.
 
Level 2
Joined
Aug 7, 2009
Messages
13
if I manually adjust the height in a custom unit it has the desired effect. but when I do this:

function Trig_swimming1_Actions takes nothing returns nothing
call SetUnitFlyHeightBJ( GetTriggerUnit(), -80.00, 0.00 )
endfunction

//===========================================================================
function InitTrig_swimming1 takes nothing returns nothing
set gg_trg_swimming1 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_swimming1, gg_rct_Rect_002 )
call TriggerAddAction( gg_trg_swimming1, function Trig_swimming1_Actions )
endfunction

nothing happens
 
Last edited:
Level 10
Joined
Sep 21, 2007
Messages
517
its possible, just detect the cliff levels and from there on determine if he can swim or not, depends on the cliff level in your map though.
--------------------------------------- EDIT
I just did a trigger enabling a unit to "swim" in water, if u want it, i can post.
 
Last edited:
if I manually adjust the height in a custom unit it has the desired effect. but when I do this:

function Trig_swimming1_Actions takes nothing returns nothing
call SetUnitFlyHeightBJ( GetTriggerUnit(), -80.00, 0.00 )
endfunction

//===========================================================================
function InitTrig_swimming1 takes nothing returns nothing
set gg_trg_swimming1 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_swimming1, gg_rct_Rect_002 )
call TriggerAddAction( gg_trg_swimming1, function Trig_swimming1_Actions )
endfunction

nothing happens

The unit's movement type must be either hover or fly.
 
Level 10
Joined
Sep 21, 2007
Messages
517
o there u are, lols ure but its only for one unit now, just showing you how i organized it bro ^^ btw you can change the time increment to 0.5 or even a bit more to reduce actions since its not needed to work that much and turn it off or on whenever you can. Here it is: (IT GOT EDITED SO UNITS CAN LOOK BETTER WHILE SWIMMING IN DEEP WATER AND FIXED BUGS)
  • Untitled Trigger 001
    • Events
      • Time - Every 0.40 seconds of game time
    • Conditions
    • Actions
      • Set SwimIntCheck = 0
      • Set swimUnit = Footman 0000 <gen>
      • Set TempPoint[0] = (Position of swimUnit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain cliff level at TempPoint[0]) Less than 2
        • Then - Actions
          • Unit - Turn collision for swimUnit Off
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain cliff level at TempPoint[0]) Less than 1
            • Then - Actions
              • Unit - Add Crow Form to swimUnit
              • Unit - Remove Crow Form from swimUnit
              • Animation - Change swimUnit flying height to 100.00 at 0.00
            • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint[0])
          • Skip remaining actions
        • Else - Actions
      • For each (Integer SwimInt) from 1 to 11, do (Actions)
        • Loop - Actions
          • Set TempPoint[SwimInt] = (TempPoint[0] offset by ((Real(SwimInt)) x 15.00) towards (Facing of swimUnit) degrees)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain cliff level at TempPoint[SwimInt]) Less than 2
            • Then - Actions
              • Set SwimIntCheck = (SwimIntCheck + 3)
            • Else - Actions
              • Set SwimIntCheck = (SwimIntCheck - 1)
          • Custom script: call RemoveLocation(udg_TempPoint[udg_SwimInt])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SwimIntCheck Greater than 0
        • Then - Actions
          • Unit - Turn collision for swimUnit Off
          • -------- making it look good when swimming in deep water --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain cliff level at TempPoint[0]) Less than 1
            • Then - Actions
              • Unit - Add Crow Form to swimUnit
              • Unit - Remove Crow Form from swimUnit
              • Animation - Change swimUnit flying height to 100.00 at 0.00
            • Else - Actions
        • Else - Actions
          • Unit - Turn collision for swimUnit On
          • Animation - Change swimUnit flying height to 0.00 at 0.00
      • Custom script: call RemoveLocation(udg_TempPoint[0])

please note that i can make this mui and stuff by making it in a group but this is just to show how, happy mapping!
---------------------------------------
Edit:
If you have only one region where there is water and its something really rare to be swimming in water, just put a region, if unit enters region turn collision off, if unit leaves region, turn collision on. This trigger is for identifiying where the unit is every w/e seconds and seeing if it should have its collision turned off or on which is best on a map which contains alot of rivers that need alot of regions to be stored.... phew, yet again, happy mapping!
----------------------
o and for making the unit fly that will make unit go over buildings in such, while this trigger wont let it.
 

Attachments

  • testswimming.w3x
    17.2 KB · Views: 72
Last edited:
Level 2
Joined
Aug 7, 2009
Messages
13
@ diehard
thanks I will try this but I think my WE is not updated is there one newer than 1.21b? and if so where can I find it. I'm also more than a little new with using strings and how they function so this might take me a couple minutes LOL.
thanks again
 
Level 2
Joined
Aug 7, 2009
Messages
13
@diehard
thanks for the trigger. this is very close to what I was looking for in a trigger and I'd like to say thanks again.
since I'm very new to the WE GUI and especially Jass (vJass) I will have to take a close look at this code.
I did have a variation for a spell in which the ground rumbles like an earthquake and the ground turns to mud and the unit effected stick and are slowed. would I have to check each unit in a ground for the effected area?

thanks again :)
 
Last edited:
Level 10
Joined
Sep 21, 2007
Messages
517
didnt understand what you mean, espcailyl turning the ground into mud! lol you mean you want to check if the unit is in ground or water? I can do that but you would need really basic usage of Hashtables to be able to identify if the unit is in water or not. BTW +rep ME MAN!!!!!!!!! ;) i worked hard on dis shit :p
 
Level 2
Joined
Aug 7, 2009
Messages
13
I would love to rep if you can explain how it is done. I'm really new to all of this.
sorry about the trouble :(

as for the mud... it would be for ground units only. just like casting an earthquake but the ground would shake and they would sink half way in the "mud"
I know nothing about hashtables but I willing to learn everything with someone who is patient with me. I really love this game though I'm not very good and I want to learn.

thanks

ps- just added REP for you
 
Last edited:
Status
Not open for further replies.
Top