UOX3 Respawn NPC and multi purpose moongate. ^o^

Forum where anything UOX3-related goes - including, but not limited to: newbie-support, ideas, general questions, comments, etc and-so-forth.
Post Reply
Sweety
UOX3 Newbie
Posts: 14
Joined: Mon Dec 12, 2005 3:29 pm
Has thanked: 0
Been thanked: 0

UOX3 Respawn NPC and multi purpose moongate. ^o^

Post by Sweety »

Hello,

I have replaced the worldfiles 0.06 and spawn.dfn, there have something need your help.

1. I have used ‘make gm to my character but I cannot find the object to respawn NPC pre-set at worldfiles 0.06. Because I would like to learn the better way to create NPC. :o

2. Is it possible to create the moongate when player walk-in and teleport them to different place in sequence? I mean like the moongate will teleport player for different ingame time, similar real UO server. Is there has simple way for it? Because I am newbie in javascript. :oops:

3. I would like to build a sandstone 3 levels house, is there has webpage teach how to make a house step by step? Because I try to place the flat stone on the floor, but it is not like the house make by deed. :oops:

Many Thanks.

Sweety ^o^
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

1.)I'm not entirely sure what you mean (damn language barriers), but there are a couple of different ways to create NPCs. You can spawn them through spawn.dfn, following the method lined out in the example file that comes with UOX3 or in the downloadable spawn.dfn which adds monsters/shopkeepers/animals.

You can also spawn them ingame using 'ADD NPC <npc-section-id> where <npc-section-id> is the name contained within the [ and ] brackets in the NPC DFN files. For instance [orc] or [waterelemental], which means you'd do 'ADD NPC orc and 'ADD NPC waterelemental to add those two specific NPCs.

You can add them through the GM menu, accessable by using the 'ADD command with no additional parameters.

And you can spawn them using "item-based spawners", i.e. items you add ingame with the sole purpose of spawning new NPCs. To learn more about that particular method of spawning NPCs, check out my UOX3 Guide, section 2.07.

2.) Hm it's possible, I guess, using for instance the GetHour() JS method, then teleporting to a different location based on the time.
Quick example follows. Copy & paste into notepad, save as teleport.js file in for instance the UOX3\JS\CUSTOM\ folder, then add a new entry in JSE_FILEASSOCIATIONS.SCP saying 6000=custom/teleport.js, right below where it says 5010=item/axe.js. Start up the server, assign the script to your moongate/teleport item by using 'SETSCPTRIG 6000 on it. Walk on the item to be teleported in a different direction based on the ingame clock.

Code: Select all

function onCollide( trgSock, srcChar, trgItem )
{
	if( !srcChar.npc )
	{
		var iHour = GetHour();
		switch( iHour )
		{
			case 0:
			case 1:
			case 2:
			case 3:
			case 4:
			case 5:
				srcChar.Teleport( srcChar.x + 5, srcChar.y, srcChar.z );
				break;
			case 6:
			case 7:
			case 8:
			case 9:
			case 10:
			case 11:
				srcChar.Teleport( srcChar.x - 5, srcChar.y, srcChar.z );
				break;
			case 12:
			case 13:
			case 14:
			case 15:
			case 16:
			case 17:
				srcChar.Teleport( srcChar.x, srcChar.y + 5, srcChar.z );
				break;
			case 18:
			case 19:
			case 20:
			case 21:
			case 22:
			case 23:
			case 24:
				srcChar.Teleport( srcChar.x, srcChar.y - 5, srcChar.z );
				break;
		}
	}
}
3.) Alas, I don't know of any webpage with tutorials for building houses :| Trial and error has been the way, along with good help from tools such as InsideUO and (in the past at least) my WorldBuilder program. (You'll find a link to InsideUO in the uox3.org links page, and as for WorldBuilder... still working on a new & updated version of it which will work with current UOX3. A TEST-version can be found here, if you're a brave soul ;P
-= Ho Eyo He Hum =-
Sweety
UOX3 Newbie
Posts: 14
Joined: Mon Dec 12, 2005 3:29 pm
Has thanked: 0
Been thanked: 0

Post by Sweety »

Thanks your reply. :)

1.) I would like to spawn the NPC/monster/item in particular area, the UOX3 guide section 2.07 is helpful. I could spawn the NPC/monster in particular time interval, but I am not sure how to set the NPCwander, FX1, FX2, FZ1, FX2. I would like to limit the NPC/monster cannot walk/run/attack out of particular area, when NPC/monster reach the limit, they will disappear and respawn in the area. :?:

When I use ‘ADD NPC <npc-section-id>, is it only create the NPC once and will not respawn in same spot after it killed? :?: I am using the item spawner to respawn NPC/monster, so I need to place the spawner item on the floor to store the parameter. For using the script to respawn NPC/monster is using the coordinate to set the respawn area and store the parameter in spawn.dfn? :?:

I have watched the NPC created by the downloadable spawn.dfn, they will walk around the shop and sometime outside the shop. But they will respawn inside the shop in certain time limit. That is interesting for me to control the NPC action, is it using the spawn.dfn? :?: Would you please teach me the method? :)

At the moment, I am using the command to create NPC step by step:
'ADD SPAWNER 0x0b24
'RENAME White Wyrm Respawn
'SET SPAWNSECTION whitewyrm
'SET MININTERVAL 1
'SET MAXINTERVAL 5
'SET TYPE 62
'SET AMOUNT 2
'SET NODECAY
'SET VISIBLE 3
‘TWEAK --> MOVEABLE --> 2

2.) Could you please teach me how to use the teleport.js file? Because it only teleport the player a few steps away the moongate. :oops:

3.) I have downloaded the test version worldbuilder, I will use it to create my dream house. :o

Also, I have got a error when go to the dungeon ‘go 5763 138 9 0. The UOX3 console pop-up “Error: Walking() - Bad length in multi file. Avoiding stall” over and over. I have not this error in the city. Any idea? :?:

Many Thanks.

Sweety ^o^
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

Code: Select all

srcChar.Teleport( srcChar.x, srcChar.y + 5, srcChar.z )
This is the line to be most concerned with in Xuri's example.

To learn the coordinates for a location, find a spot in the world, and type 'where

It will give you your location in this order x, y, z, world number


Say, for instance, you wanted it to teleport you to world location 1000, 1000, 0. You would change that teleport line to

Code: Select all

srcChar.Teleport( 1000, 1000, 0 )
Scott
Post Reply