Author Topic: Unveiled worldmap problem  (Read 2941 times)

Unveiled worldmap problem
« on: December 29, 2012, 04:16:21 pm »
From http://forum.newfmc.pl/index.php?topic=213.0

I have script works but in fonline server console display warnings.

Code: [Select]
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);
   
}

Warnings
Code: [Select]
[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.



Offline Berko

  • Tim Tom Ted
    • http://kabefis.deviantart.com/
Re: Unveiled worldmap problem
« Reply #1 on: December 30, 2012, 04:40:41 pm »
there is some errors :
Code: [Select]
   uint zoneX=cr.WorldX/__GlobalMapZoneLength;
   uint zoneY=cr.WorldY/__GlobalMapZoneLength;
   for(zoneX=0;zoneX<=Q;zoneX++)
   { 
         for(zoneY=0;zoneY<=Z;zoneY++)   
...
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".
~~~ Ashes of Phoenix project --> http://fonline-aop.net/ ~~~