How to load maps from website
#3

You can write your own file parsing code to load objects from files. I use sscanf for parsing the lines, like that:
PHP код:
if(!strcmp(funcName"CreateDynamicObject") && paramLen)
{
    if(
sscanf(funcParams"p<,>dffffffD(-1)D(-1){D(-1)}F(-1.0)F(-1.0)D(-1)D(0)"modelidposXposYposZrotXrotYrotZworldidinterioridstreamDistdrawDistareaidpriority))
        continue;
    if(
drawDist == -1.0)
        
drawDist gDrawDist;
    if(
streamDist == -1.0)
        
streamDist gStreamDist;
    if(
worldid == -1)
        
worldid gVW;
    if(
interiorid == -1)
        
interiorid gInterior;
    if(
priority == 0)
        
priority gPriority;
    
tempObjID CreateDynamicObject(modelidposX+gOffset[0], posY+gOffset[1], posZ+gOffset[2], rotXrotYrotZworldidinteriorid, -1streamDistdrawDistareaidpriority); 
Creating your own parser is very useful in some cases, as you can create your own 'functions', I have a few of them. For example setting the VW for all objects is as simple as writing
PHP код:
setVW(100); 
same goes for setting streaming/draw distances, priorities etc. I also have a setOffset(x,y,z) func which allows me to move entire maps by an offset I choose.
Reply


Messages In This Thread
How to load maps from website - by akib - 14.11.2018, 01:28
Re: How to load maps from website - by khRamin78 - 14.11.2018, 05:49
Re: How to load maps from website - by dotSILENT - 14.11.2018, 15:02

Forum Jump:


Users browsing this thread: 1 Guest(s)