Whats is wrong?

Necrolytie

Member
Code:
//TESH.scrollpos=15
//TESH.alwaysfold=0
function Trig_Multiplayer_Camera_Actions takes nothing returns nothing
 
    local boolean b                    //The pathing boolean
    local integer i = 1                //The player index counter
    local location l = Location(0,0)    //A point used to detect height
    local real v                        //The distance of the camera
    local real x                        //Coordinates x,y,z of two points
    local real y
    local real z
    local real x1
    local real y1
    local real z1
 
    loop
        if udg_camera_target_unit[i] != null and (GetWidgetLife(udg_camera_target_unit[i]) > 0.405) then
            set v = 25 //We set the minimum distance to 25
            set x = GetUnitX(udg_camera_target_unit[i]) //Get the x coordinate of the unit wich has the camera on it
            set y = GetUnitY(udg_camera_target_unit[i]) //Get the y coordinate of the unit wich has the camera on it
            call MoveLocation(l,x,y) //We move the l point to the units coordinates
            set z = GetLocationZ(l) // store the heignt as z
            set x1 = x + 64 * Cos((GetUnitFacing(udg_camera_target_unit[i]) + udg_camera_turn_degree[i]) * bj_DEGTORAD)
            set y1 = y + 64 * Sin((GetUnitFacing(udg_camera_target_unit[i]) + udg_camera_turn_degree[i]) * bj_DEGTORAD)
            call MoveLocation(l,x1,y1)
            set z1 = GetLocationZ(l)
            loop //Here begins the main loop for all players
                set x1 = x - v * Cos((GetUnitFacing(udg_camera_target_unit[i]) + udg_camera_turn_degree[i]) * bj_DEGTORAD)
                set y1 = y - v * Sin((GetUnitFacing(udg_camera_target_unit[i]) + udg_camera_turn_degree[i]) * bj_DEGTORAD)
                set b = IsTerrainWalkable(x1,y1)
                if (b == false) then
                    set b = IsTerrainDeepWater(x1,y1)
                endif
                if (GetUnitFlyHeight(udg_camera_target_unit[i]) > 0) then
                    set b = true
                endif // This is just to avoid distance changes if the unit is in the air
                if ((b == true) and (v < 450)) then
                    set v = v + 25
                    elseif ((b == false) or (v == 450)) then
                    exitwhen true // This increases the camera distance until the system detects a non-pathable point.
                                  // Max distance can be changed, its the 450 integer
                endif
            endloop
            if GetLocalPlayer() == Player(i - 1) then //Make the system do the folowing stuff only for one player at the time
            call SetCameraField(CAMERA_FIELD_ROTATION, GetUnitFacing(udg_camera_target_unit[i]) + udg_camera_turn_degree[i], 0.5) //Set the rotation of the cam to the units+our rotation wish
            call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, v, 0.2) //Set the distance to v
            call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK, 335 + ((z1 - z) * 0.5), 0.32) //This is meant for the player to be able to see the "top of the mountain"
            call SetCameraField(CAMERA_FIELD_FIELD_OF_VIEW, 120, 0)
            call SetCameraField(CAMERA_FIELD_FARZ, 5000, 5) //How far the player will be able to see
            call SetCameraTargetController(udg_camera_target_unit[i], 0, 0, false) //Locks the camera to the unit
            call SetCameraField(CAMERA_FIELD_ZOFFSET, GetUnitFlyHeight(udg_camera_target_unit[i]) + GetCameraField(CAMERA_FIELD_ZOFFSET) + z - GetCameraTargetPositionZ() + 128, -0.06)
            call SetCameraField(CAMERA_FIELD_ZOFFSET, GetUnitFlyHeight(udg_camera_target_unit[i]) + GetCameraField(CAMERA_FIELD_ZOFFSET) + z - GetCameraTargetPositionZ() + 128, 0.06) //Height of the camera is adjusted here
          endif
        endif 
    exitwhen i == 11 // Change the value here for more players eg: i==9 for nine players
    set i = i + 1 //Next player is set
    call RemoveLocation(l) //We dont want leaks of points
    endloop //Loop ends for one player and starts for another
    set l = null //We remove the previous l
endfunction
function InitTrig_Multiplayer_Camera takes nothing returns nothing
    set gg_trg_Multiplayer_Camera = CreateTrigger(  )
    call TriggerRegisterTimerEvent(gg_trg_Multiplayer_Camera,0.06,true) //You can change the time if you want the cam to be faster
    call TriggerAddAction( gg_trg_Multiplayer_Camera, function Trig_Multiplayer_Camera_Actions )
endfunction
This is all of the script and the anexed image is the line of the error... what is wrong? I just can't see this, please, help me D:
 

Attachments

Ayanami

칼리
There seems to be a problem with the compiler identifying the functions IsTerrainWalkable and IsTerrainDeepWater. I suggest checking if these functions actually exists and if it's reachable.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Jesus4Lyf Jesus4Lyf:
    Man, I made this account 15 years ago? Wild. :)
  • Ghan Ghan:
    Seeing J4L is definitely a blast from the past.
  • Jesus4Lyf Jesus4Lyf:
    Oh hey Ghan! Long time. :)
    +1
  • jonas jonas:
    J4L! What has happened in your life
  • Jesus4Lyf Jesus4Lyf:
    Hmm, how to summarize... Moved to the USA and got married. Became a professional software engineer and solution lead. Learning Godot for game dev. :)
  • jonas jonas:
    So you are pursuing game dev as a hobby? What industry is your dayjob in?
  • jonas jonas:
    FAANG?
  • Jesus4Lyf Jesus4Lyf:
    Not quite FAANG, less pay for a less hours/stress. Yeah, game dev as a hobby.
  • jonas jonas:
    makes sense. Do we have a hobby game dev subforum to showcase some work?
  • Blackveiled Blackveiled:
    Happy Thursday
    +1
  • The Helper The Helper:
    Happy Thursday!
  • The Helper The Helper:
    TGIF!
  • The Helper The Helper:
    hey tom_mai please do not archive anymore news
  • Ghan Ghan:
    AMD Ryzen 7000 next week :D
    +1
  • The Helper The Helper:
    noice!
  • tom_mai78101 tom_mai78101:
    "hey tom_mai please do not archive anymore news" ----> Got it. What should we do with the "News Archive" subforum?
  • The Helper The Helper:
    I think leave it for real old news that cannot be sorted the reason we had it in the first place was a server issue that we do not have anymore. I don't want to get rid of the archive just not put anything in it for now until we figure it out more
  • The Helper The Helper:
    The side chat has nothing on the discord. it is not possible but the biggest thing on my wish list right now is a sidechat channel on the disord that hooks up to this...
  • Ghan Ghan:
    I've been selected for the Diablo IV beta.
    +1
  • Ghan Ghan:
    Woo!
    +1
  • The Helper The Helper:
    that is so cool
  • V-SNES V-SNES:
    Eh just noticed the new discord section on the side. Looks great!
    +1
  • Blackveiled Blackveiled:
    :( feels bad I can't ever get selected for any beta I sign up for. It's annoying as heck.
    +1

    The Helper Discord

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top