SetPlrView
Player
View
4.6.5.0 CP
bool
int
player
Player whose view distance to want to set.
object
obj
Object to which to want to set the view.
Centers a player's view to the specified object. The view will follow this object until the next player command.
local oFeind;
// TimerCall eines automatischen Aussichtsturms
protected func Timer()
{
// Bereits einen Feind gefunden?
if(!oFeind)
{
// Alarm schlagen?
while(oAlarm = FindObject(0, -100, -100, 200, 200, OCF_CrewMember(), 0, 0, 0, oAlarm))
if(Hostile(GetOwner(oAlarm), GetOwner()))
{
// Ein feindlicher Clonk!
SetPlrView(GetOwner(), oAlarm);
Sound("Bing");
break;
}
}
else
{
if(ObjectDistance(oFeind) < 120)
{
// Noch einige ständige Effekte bei Alarm
Sound("Bing");
Message("!!! FEIND !!!");
}
else
{
// wenn er sich entfernt: Alarm beenden
oFeind = 0;
}
}
}
Automatic watch tower: if an enemy clonk gets near the tower the player's view will be set to the attacker. Also, a sound is played and a message is popped up while the enemy is in range.
GetPlrView
GetPlrViewMode
SetPlrViewRange
SetFoW
PeterW2003-04