RDNWiki: DOWScar/Tutorials/Advanced/CanSeeExample ...

RDN Wiki Home | Page Index | Recent Changes | Recently Commented | Users | Registration | Login:  Password:  

Can See Example


Contents


The “CanSee" functions refer to whether or not the indicated target is revealled by the FOW
NOT whether or not the indicated target is onscreen or not. Using debug cheats like FOW_RevealAll
will result in all of your «CanSee" functions returning true! So be careful!


--[[ CAN I SEE YOU ]]


--[[ Player can see a position ]]
function Rule_PlayerCanSee_Position()

	--[[ Note - this relies on g_PlayerID, a variable commonly set in all SCAR mission scripts 
	additionally, a scar position can be defined in numerous ways, this is an example using a marker 
	you could also use the utility function Util_ScarPos(0, 0) to produce a valid position value]]
	local pos = Marker_GetPosition(Marker_FromName("marker_name", "basic_marker"))
	
	if Player_CanSeePosition(playerID, pos) then
		
		print("the Player can see the position")
		
	else
		
		print("the Player cannot see the position")
		
	end
	
end

--[[ Player can see an Sgroup ]] 
function Rule_PlayerCanSee_Sgroup()

	if Player_CanSeeSGroup(playerID, "sgroup_name", true) then
		
		print("the player can see the whole sgroup")
		
	elseif Player_CanSeeSGroup(playerID, "sgroup_name", false) then
		
		print("the Player can only see part of the sgroup")
		
	else
		
		print("the Player cannot see the sgroup at all")
		
	end

end

--[[ Sgroup can see an Sgroup ]] 
function Rule_SgroupCanSee_Sgroup()

	if SGroup_CanSeeSGroup("sgroup_viewer", "sgroup_target", true) then
		
		print("the Sgroup can see the whole target sgroup")
		
	elseif Player_CanSeeSGroup("sgroup_viewer", "sgroup_target", false) then
		
		print("the Sgroup can only see part of the target sgroup")
		
	else
		
		print("the Sgroup cannot see the target sgroup at all")
		
	end

end

Links


SCAR
Wiki Home

End of Page


Referring pages: DOWScar
DOWScar/Tutorials
DOWScar/Tutorials/Advanced

There are no files on this page. [Display files/form]
There is no comment on this page. [Display comments/form]