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

Swimming and Diving system

Status
Not open for further replies.
Level 11
Joined
Nov 15, 2007
Messages
781
Something involving two sets of terrain and fade filters. The map is probably protected, dunno. I'm sure someone could help you with a system like that, but something so big should probably go in requests.
 
Level 4
Joined
Aug 3, 2008
Messages
80
Something involving two sets of terrain and fade filters. The map is probably protected, dunno. I'm sure someone could help you with a system like that, but something so big should probably go in requests.

ok thank you for helping +rep ;)
 
Level 22
Joined
Dec 31, 2006
Messages
2,216
The "system" used in that map is actually made in GUI. And it was made by using a very big map with two playable areas (one for surface and one for underwater). Whenever the submerge spell was used the unit got moved to the other part of the map and the surface map got hidden.
Here's the submerge trigger (Originally made in GUI):

JASS:
function Trig_Submerge_Actions takes nothing returns nothing
 set bj_forLoopAIndex = 1
 set bj_forLoopAIndexEnd = 5
 loop
 exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
 call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))]), GetRandomReal(-100.00, 100.00), GetRandomReal(-100.00, 100.00)), "Objects\\Spawnmodels\\Other\\IllidanFootprint\\IllidanWaterSpawnFootPrint.mdl" )
 set bj_forLoopAIndex = bj_forLoopAIndex + 1
 endloop
 if ( Trig_Submerge_Func002C() ) then
 call DisplayCineFilterBJ( true )
 call StopSoundBJ( gg_snd_AboveWater1, true )
 call StopSoundBJ( gg_snd_AboveWater2, true )
 call StopSoundBJ( gg_snd_Wind, true )
 call StopSoundBJ( gg_snd_War3XMainScreen, true )
 call PlaySoundBJ( gg_snd_UnderWater1 )
 call PlaySoundBJ( gg_snd_UnderWater2 )
 call PlaySoundBJ( gg_snd_DullEcho )
 else
 endif
 call SetCameraBoundsToRectForPlayerBJ( GetOwningPlayer(GetEnteringUnit()), gg_rct_Under_Water )
 call SetUnitPositionLoc( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))], PolarProjectionBJ(GetUnitLoc(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))]), 15800.00, 270.50) )
 call SetUnitTimeScalePercent( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))], 50.00 )
 set udg_Submerged[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = true
 call ForGroupBJ( GetUnitsOfPlayerAndTypeId(GetOwningPlayer(GetEnteringUnit()), 'h00D'), function Trig_Submerge_Func009002 )
 call SetPlayerAbilityAvailableBJ( false, 'A019', GetOwningPlayer(GetEnteringUnit()) )
 call SetPlayerAbilityAvailableBJ( true, 'A017', GetOwningPlayer(GetEnteringUnit()) )
 call RemoveUnit( GetEnteringUnit() )
 
 if ( Trig_Submerge_Func014001() ) then
 call SetUnitPositionLoc( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))], OffsetLocation(GetUnitLoc(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))]), 0, 400.00) )
 else
 call DoNothing( )
 endif
 if ( Trig_Submerge_Func015001() ) then
 call SetUnitPositionLoc( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))], OffsetLocation(GetUnitLoc(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))]), 0, -800.00) )
 else
 call DoNothing( )
 endif
 if ( Trig_Submerge_Func016001() ) then
 call SetUnitPositionLoc( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))], OffsetLocation(GetUnitLoc(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))]), 400.00, 400.00) )
 else
 call DoNothing( )
 endif
 if ( Trig_Submerge_Func017001() ) then
 call SetUnitPositionLoc( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))], OffsetLocation(GetUnitLoc(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))]), -800.00, 0.00) )
 else
 call DoNothing( )
 endif
 call PanCameraToTimedLocForPlayer( GetOwningPlayer(GetEnteringUnit()), GetUnitLoc(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))]), 0 )
 call TriggerSleepAction( 0.01 )
 set bj_forLoopAIndex = 1
 set bj_forLoopAIndexEnd = 5
 loop
 exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
 call AddSpecialEffectLocBJ( OffsetLocation(GetUnitLoc(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))]), GetRandomReal(-100.00, 100.00), GetRandomReal(-100.00, 100.00)), "Objects\\Spawnmodels\\Other\\IllidanFootprint\\IllidanWaterSpawnFootPrint.mdl" )
 set bj_forLoopAIndex = bj_forLoopAIndex + 1
 endloop
endfunction
You probably wonder how I know this and how I got that function. The answer is pretty simple, I just used WinMPQ to extract the .j file inside and opened it in Notepad.
PS: You shouldn't use that function because it will not work for your map, but it shouldn't be hard to make another one. That one was made in GUI.
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
I can try to make that in GUI,, (Sorta convert ot GUI)
Give me some minutes
If you want to, but as Reborn said, it requires 2 regions, and probably quite some other things,, like variables and so on that you dont have or dont need, also, are you willing to make this now region only for the diving?
 
Level 20
Joined
Oct 21, 2006
Messages
3,231
You are trying to make this into your Arathi Basin map, so units could swim and dive like in WoW? If yes, then dont do it. Its not a worth of that, as it would screw up the whole map and disable a lot of thing, because of bugs etc. :/
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Unless being inside water is the point of your map (like that map linked above, which I must say was very awesome at the time it was published), don't use this, as it will take half of your terrain.

You could do the same thing with smaller regions, though (two same sized regions for each part, this way if you have, say, a little lake, it wouldn't take too much space from your terrain).
 
Status
Not open for further replies.
Top