# 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

• 104.5 KB Views: 321

#### 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.
• tom_mai78101:
Hmm, about the Headline News, I noticed threads are being moved into the subforum (Health News, Environmental News, etc.). When that happens, the TH Forum Home page loses the articles, and instead would show old articles posted 1 or 2 weeks ago.
• tom_mai78101:
• Ghan:
I added those forums to the filter for that widget.
+1
• tom_mai78101:
Oh nice. They're back. Thanks.
• tom_mai78101:
Now I think it makes more sense for me to put news in their own subforums, without worry.
• The Helper:
Awesome Ghan thanks! I was purposely not moving the first 15 news articles in Headline news to the different subforums but I guess I don't have to do that now?
• tom_mai78101:
Question: Is there a way to remove thread redirects? It creates a copy of the moved thread and takes up space, and I am leaning towards wanting to remove them in the Headline News. But if they have an expiration date, I guess I'm fine with it.
• The Helper:
If you move a thread please leave a permanent redirect. You can delete any redirects after 6 months. The redirects are left to help Search Engines find the moved content.
• tom_mai78101:
What if you move the permanent redirect, not the thread?
• The Helper:
I think that works but I have not messed with it. You can delete redirects though if you have to that will not delete the original thread
• The Helper:
if a redirect ends up in the same forum as the post it goes to though I think the redirect drops or fails or something but they are not bugged out and when you are working on an indirect the original post is safe.
• The Helper:
Happy Early Friday
+1
• V-SNES:
Happy Friday
• tom_mai78101:
Fun Friday for me
• tom_mai78101:
Happy Fun Friday to all.
+2
• The Helper:
Happy Sunday everyone!!!
• V-SNES:
Happy Sunday!!!
+1
• jonas:
Happy monday
• jonas:
Everyone hates mondays?
+1
• The Helper:
Happy Tuesday!
• jonas:
Happy belated tuesday
• tom_mai78101:
I found out you can't delete nor hide redirect links to existing threads. It will just stay there. I have no choice now but to start moving thread redirects to News Archive.
• The Helper:
That is not the way that it works for me I can delete redirects you just have to hit refresh sometimes big deletes will take a while as long as moves\
• The Helper:
You don't have to do that you can just leave stuff there in headline news for up to a year it was already down to like 8 months there is no rush.

### Members online

No members online now.