Distro spawnSystem

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Ullr
New User
Posts: 7
Joined: Mon Mar 17, 2014 8:57 pm

Distro spawnSystem

Post by Ullr »

Alright so I've got a runaway script in the distro spawner. From what I can tell it's due to an incorrect method, missing a parameter in spawnUtil.inc.

Here's the error:
Script Error in 'pkg/systems/spawnSystem/engines/npcFill/spawnCycle.ecl' PC=991:
Call to function ListStaticsAtLocation:
Parameter 3: Expected datatype Integer, got datatype String
Core notes from Shinigami:
07-04 Shinigami
2510: Changed : uo::ListStaticItemsAtLocation to uo::ListStaticsAtLocation( x, y, z, flags, realm )
06-01 Shinigami
Added : uo::ListStaticItemsAtLocation( x, y, flags, realm )
Added : uo::ListStaticItemsNearLocation( x, y, range, flags, realm )
creates an array of structures with Static and Multi Items at or around location.
you can specify via flags which Items you want to get. check IGNORE_* constants.
Code from Distro spawnerUtil where that gets called:

Code: Select all

function SS_IsValidCreationTile( x, y, z, realm )

        var landtiles_cfg := ReadConfigFile( "::landtiles" );
	var map_info := GetMapInfo( x, y, realm );
	var tile_elem := landtiles_cfg[Hex( map_info.landtile )];

	if( !tile_elem.MoveLand )
		var tiles_cfg := ReadConfigFile( "::tiles" );
		foreach static in ( ListStaticsAtLocation( x, y, z, realm ))
			if( static.z == z )
				if( tiles_cfg[Hex( static.objtype )].MoveLand )
					return 1;
				endif
			endif
			SleepMS(10);
		endforeach

		foreach item in ( ListItemsAtLocation( x, y, z, realm ))
			if( item.z == z )
				if( tiles_cfg[item.graphic].MoveLand )
					return 1;
				endif
			endif
			SleepMS(10);
		endforeach

		return 0;
	endif

	return 1;
endfunction
I assume it should read like this;

Code: Select all

function SS_IsValidCreationTile( x, y, z, flags, realm )

        var landtiles_cfg := ReadConfigFile( "::landtiles" );
	var map_info := GetMapInfo( x, y, realm );
	var tile_elem := landtiles_cfg[Hex( map_info.landtile )];

	if( !tile_elem.MoveLand )
		var tiles_cfg := ReadConfigFile( "::tiles" );
		foreach static in ( ListStaticsAtLocation( x, y, z, flags, realm ))
			if( static.z == z )
				if( tiles_cfg[Hex( static.objtype )].MoveLand )
					return 1;
				endif
			endif
			SleepMS(10);
		endforeach

		foreach item in ( ListItemsAtLocation( x, y, z, flags, realm ))
			if( item.z == z )
				if( tiles_cfg[item.graphic].MoveLand )
					return 1;
				endif
			endif
			SleepMS(10);
		endforeach

		return 0;
	endif

	return 1;
endfunction
Who can tell me about this flags parameter?
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: Distro spawnSystem

Post by Turley »

Ullr
New User
Posts: 7
Joined: Mon Mar 17, 2014 8:57 pm

Re: Distro spawnSystem

Post by Ullr »

Hrm, ok so I scripted in what I would think is a fix based on that page you just linked.

Function as follows:

Code: Select all

function SS_IsValidCreationTile( x, y, z, realm )
	var flags := 0x40000000;
	
        var landtiles_cfg := ReadConfigFile( "::landtiles" );
	var map_info := GetMapInfo( x, y, realm );
	var tile_elem := landtiles_cfg[Hex( map_info.landtile )];

	if( !tile_elem.MoveLand )
		var tiles_cfg := ReadConfigFile( "::tiles" );
		foreach static in ( ListStaticsAtLocation( x, y, z, flags, realm ))
			if( static.z == z )
				if( tiles_cfg[Hex( static.objtype )].MoveLand )
					return 1;
				endif
			endif
			SleepMS(10);
		endforeach

		foreach item in ( ListItemsAtLocation( x, y, z, flags, realm ))
			if( item.z == z )
				if( tiles_cfg[item.graphic].MoveLand )
					return 1;
				endif
			endif
			SleepMS(10);
		endforeach

		return 0;
	endif

	return 1;
endfunction
Still spams this error in my debug logs. Also found that this error appears to be caused due to too many spawn regions in the .cfg file. It appears to cap out at 97 regions. Anyone else run into this problem? We're running map0 and SMALL portion of Ilshenar so I'm curious if others have surpassed the 97 limit without concern?
Post Reply