[FIXED] Neutral Flag bug?

Here we stuff all the bugs we've managed to squash/squish/squelch.
Locked
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Neutral Flag bug?

Post by stranf »

So I loaded Grimson's 3.2-o build and was excited to play.

As I was traveling to Britian I watched a few worldsaves and garbage cleanups take place....I was suprised to see nearly 311 items being removed....I thought, "wow? What is it erasing?"

Then when I hit Britian I realized what it was.........

My FIGHTERS WENT RAMPANT!! Murder in the street! Nearly all my NPCs in all my towns are gone.... (A few guards were able to take down the fighters that got too close...)

So is the reason fighters are hostile due to this neutral bug? I asked Grimson to post 3.2p......this clears this problem right? Looks like I'll have to repopulate some cities again. hehehe.
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

stranf wrote: So is the reason fighters are hostile due to this neutral bug? I asked Grimson to post 3.2p......this clears this problem right? Looks like I'll have to repopulate some cities again. hehehe.

Yeah... the danger of experimental builds, while I try to test every change, time doesn't always allow.... :P

Anyhow, Grimson has already fixed this bug, so as soon as another experimental exe gets posted you'll be all set.
Scott
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

Nice! Generally I back up the worldfile before trying and experiemental exe, but I missed is this time (and a worldsave happened, so I lost some NPCs.)

But you know, it was a lot of fun at the same time. Good 'ol stranf enters town at night....

*another thing....thanks for increasing the light levels, night was VERY dark, couldn't see a thing outside the torch radius*

Stranf enters town, and stumbles upon a corpse. and outside....in the darkness, on all four angles..: *Bob attacks Stranf*....*Bill attacks stranf*....etc. etc.

So Stranf bravely takes down 4 or 5 fighters, and actually saved a noble female from sudden death as he engaged a fighter chasing the poor fleeing maid.

It created some fun roleplaying, and was very surprising.

So here is an idea that came from this bug:
Could we create a massAIChange(tag NPC, int NPCAI) function that can be bound to a specific NPC id? Example: we create a "Rebel" (who appears to the PC as a standard fighter) in a .dfn file. We place these undercover people in various towns across britannia.

Players aren't worried, go about their lives, and eventually, the GM types in: 'massAIChange(Rebel, hostile_int).
Uox3 changes ALL NPCs created from Rebel to hostile....and BAM, you have a syncronized rebellion throughout the land...

could be kind of fun...

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

Post by giwo »

That's quite possible, and I believe were one so inclined they could create a JavaScript that would do just the thing.

Something like this:

Code: Select all

function CommandRegistration()
{
	RegisterCommand( "massAIChange", 2, true );
}

function command_MASSAICHANGE( socket, cmdString )
{
	percentToChange = 100;
	if( cmdString )
		percentToChange = StringToNum( cmdString );

	BroadcastMessage( "Townsfolk everywhere are going crazy!" );
	var count = IterateOver( "CHARACTER" );
}

function onIterate( toCheck )
{
	if( toCheck && toCheck.isChar )
	{
		if( toCheck.npc && toCheck.aitype == 0 )	// They are an NPC and don't have any AI
		{
			if( RandomNumber( 0, 99 ) + 1 <= percentToChange )
			{
				toCheck.aitype = 2;	//Evil
				toCheck.npcFlag = 2;   //Flag Red
				return true;
			}
		}
	}
	return false;
}
Scott
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 »

Wouldn't have to be random either. You could set up all the "Rebels" with a certain tag - like, oh I don't know... "rebel=1" ;) - and then check for that in the onIterate function when determining which NPCs should start rebelling.

Of course that would be easier if we had a way of assigning custom tags through the DFNs. *cough* ;)
-= Ho Eyo He Hum =-
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

stranf wrote:Nice! Generally I back up the worldfile before trying and experiemental exe, but I missed is this time (and a worldsave happened, so I lost some NPCs.)
That's one of the reasons why I choosed the spawn.dfn to place NPCs. Another reason is that I can start over with a clean world without having to redo all spawns.
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

This is a little off-topic of the post,

but Grimson, is there an easy way to add NPCs through the spawn.dfn? I tried once, and found it to be easier to just place them through the GM menu...
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

stranf wrote:but Grimson, is there an easy way to add NPCs through the spawn.dfn? I tried once, and found it to be easier to just place them through the GM menu...
Not in-game, but using the tool from this post: viewtopic.php?p=2697#2697 it isn't very hard.
Locked