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

[JASS] How do i make a Leakless CamLock?

Status
Not open for further replies.
Level 5
Joined
Nov 10, 2008
Messages
97
Hi! :razz:
How do i make a Leakless CamLock? Like in the diablo 3 mapp in Jass?
and this one is suposed to start after you picked your hero, like a hero select;
you press a hero, some info comes upp, and says "click again if you wan't to chose this hero" that stuff and after that,
well, the camlock trigger stuff thingy starts.

HOW.
DO.
I.
DO.
THIS?

oh... by the way i don't know jass. !!ATALL!! :confused::confused:
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
adnertsy said:
oh... by the way i don't know jass. !!ATALL!!

You just said that you don't know JASS at all. And yes, I've played War Chasers; the solution I posted above will solve your problem. The JASS native for it is:

JASS:
native SetCameraTargetController takes unit whichUnit, real xoffset, real yoffset, boolean inheritOrientation returns nothing

If you want to specify a specific player, then you need to use local code:

JASS:
if (GetLocalPlayer() == specificPlayer) then
    call SetCameraTargetController(...)
endif

Kind of like that.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
adnertsy said:
And how do i make so i can write the jass script?

Go edit, Convert to Custom Script.

adnertsy said:
ok.
but this map will conclude 4 players playing, and do i need some variables
setupp or a camera?

Dude, slow down. I have no idea what you're even saying. Take the extra second to formulate proper sentences, I don't want to have to decipher your concatenated nouns. "Dude 4 players playing do need variables setup camera".
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
adnertsy said:
1. do i need variables, like in triggers?

Well you don't need variables, you could just use this function after the player selects his/her hero.

adnertsy said:
2.i wan't the cam to be like the one in warchaser, but in jass.

Dude, it's just one line of code, and I've posted it in both GUI and JASS now.

adnertsy said:
3.do i need a camera?

Like one of those camera objects that you create (in the tool palette, where Regions and Doodads are)? No.

adnertsy said:
4.Where do i go edit?

adnertsy said:
i got the edit thing
 
Level 5
Joined
Nov 10, 2008
Messages
97
ooooooooookey....
but i checked warchaser and it's a lot more stuff,
and by the way: I DO GUI so...
well thanks anyway.

what about this code, i copied and pasted it but errors ocourred

JASS:
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope Camlock initializer InitTrig

globals
    //trigger CamLock
    integer INDEX = 0
    boolean array DEAD
    unit array HERO
    player array PLAYERS
    integer array IND
    //location LOC
endglobals

//private function Actions takes nothing returns nothing
//local integer index = 0
//local real x
//local real y
//local real z

//loop
    //exitwhen index == INDEX
    //set x = GetUnitX(HERO[index])
    //set y = GetUnitY(HERO[index])
    //call MoveLocation(LOC,x,y)

    //if GetLocalPlayer() == PLAYERS[index] then
        //if udg_Inventory_Player_Is_Viewing[index] == false then

            //if DEAD[index] == false then
            //set z = GetCameraField(CAMERA_FIELD_ZOFFSET)+300 - (256- GetLocationZ(LOC))-GetCameraTargetPositionZ()
            //call SetCameraField(CAMERA_FIELD_ZOFFSET,z,1.0)
            //call SetCameraPosition(x,y)
            //call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE,1850,0.1)
            //call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK,315,0.1)
            //call SetCameraField(CAMERA_FIELD_ROTATION,140,0.1)

            //endif
        //endif
    //endif
    //set index = index + 1
//endloop
//endfunction

private function InitTrig takes nothing returns nothing
    //set CamLock = CreateTrigger()
    //set LOC = Location(0,0)
    set DEAD[0] = false
    set DEAD[1] = false
    set DEAD[2] = false
    set DEAD[3] = false
    set DEAD[4] = false
    set DEAD[5] = false
//call TriggerRegisterTimerEvent(CamLock,0.2,true)
//call TriggerAddAction(CamLock, function Actions)
endfunction


endscope
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
adnertsy said:
but i checked warchaser and it's a lot more stuff,

Well then don't ask for help on the forums, just do what you think you should do. Why don't you actually try doing what I'm telling you to and then question me after, instead of just ignoring it because it's not the answer you think you want.
 
Status
Not open for further replies.
Top