FOnline Development > General Discussion
Unveiled worldmap problem
(1/1)
elqoro:
From http://forum.newfmc.pl/index.php?topic=213.0
I have script works but in fonline server console display warnings.
--- Code: ---void SetStartLocation(Critter& cr) // Export
{
Map@ replicator=GetStartReplicatorMap();
if(not valid(replicator)) return;
// Hidden fog on default player position
uint zoneX=cr.WorldX/__GlobalMapZoneLength;
uint zoneY=cr.WorldY/__GlobalMapZoneLength;
for(zoneX=0;zoneX<=Q;zoneX++) //za Q podstawiamy ilosc zon'ow dla osi x
{
for(zoneY=0;zoneY<=Z;zoneY++) //za Z podstawiamy ilosc zon'ow dla osi y
{
cr.SetFog(zoneX,zoneY,FOG_HALF);
}
}
cr.TransitToMap(replicator.Id,ENTIRE_REPLICATION);
cr.SetKnownLoc(true,replicator.GetLocation().Id);
//funkcje dające widoczność lokacji przy punktach respawn'u
//cr.SetKnownLoc(false,LOCATION_ReplicationHell);
//uint16 replPid=replicator.GetLocation().GetProtoId();
//if(replPid==LOCATION_Replication1)
//{
// cr.SetKnownLoc(false,LOCATION_Den);
// cr.SetKnownLoc(false,LOCATION_Klamath);
//}
//else if(replPid==LOCATION_Replication2)
//{
// cr.SetKnownLoc(false,LOCATION_Modoc);
//}
//else if(replPid==LOCATION_Replication3)
//{
// cr.SetKnownLoc(false,LOCATION_Redding);
//}
//else if(replPid==LOCATION_Replication4)
//{
// cr.SetKnownLoc(false,LOCATION_BrokenHills);
// cr.SetKnownLoc(false,LOCATION_NewReno);
//}
zoneX=cr.WorldX/__GlobalMapZoneLength;
zoneY=cr.WorldY/__GlobalMapZoneLength;
cr.SetFog(zoneX ,zoneY ,FOG_NONE);
}
--- End code ---
Warnings
--- Code: ---[06:01:164] FOServer::SScriptFunc::Cl_SetFog : Script error: Invalid world map pos arg. : replication : void SetStartLocation(Critter&inout) : 267, 4 : FOServer::Process_CreateClient : admin1.
[06:01:164] FOServer::SScriptFunc::Cl_SetFog : Script error: Invalid world map pos arg. : replication : void SetStartLocation(Critter&inout) : 267, 4 : FOServer::Process_CreateClient : admin1.
[06:01:164] FOServer::SScriptFunc::Cl_SetFog : Script error: Invalid world map pos arg. : replication : void SetStartLocation(Critter&inout) : 267, 4 : FOServer::Process_CreateClient : admin1.
[06:01:164] FOServer::SScriptFunc::Cl_SetFog : Script error: Invalid world map pos arg. : replication : void SetStartLocation(Critter&inout) : 267, 4 : FOServer::Process_CreateClient : admin1.
[06:01:164] FOServer::SScriptFunc::Cl_SetFog : Script error: Invalid world map pos arg. : replication : void SetStartLocation(Critter&inout) : 267, 4 : FOServer::Process_CreateClient : admin1.
[06:01:164] FOServer::SScriptFunc::Cl_SetFog : Script error: Invalid world map pos arg. : replication : void SetStartLocation(Critter&inout) : 267, 4 : FOServer::Process_CreateClient : admin1.
--- End code ---
Berko:
there is some errors :
--- Code: --- uint zoneX=cr.WorldX/__GlobalMapZoneLength;
uint zoneY=cr.WorldY/__GlobalMapZoneLength;
for(zoneX=0;zoneX<=Q;zoneX++)
{
for(zoneY=0;zoneY<=Z;zoneY++)
...
--- End code ---
zoneX and zoneY is affect by a value and after in "for loop" it's re-affected to 0.
Q and Z are never affected.
And I don't see the point to stop at the critter location. Just set "fog half" on the whole map and set where the critter is to "fog none".
Navigation
[0] Message Index
Go to full version