[FIXED] Kindling

Here we stuff all the bugs we've managed to squash/squish/squelch.
Locked
John
UOX3 Neophyte
Posts: 32
Joined: Thu Sep 15, 2011 7:41 am
Location: Inside Tom's Brain
Has thanked: 0
Been thanked: 0

Kindling

Post by John »

I've noticed that when I chop a tree the logs are put into my backpack. Then when I make kindling each one is deducted from the total logs I had.

Example: I chop trees until I have 40 logs. I make a kindling and now I have 39 logs. This works like it is suppose to.

However, when i make several kindling and they stack into a pile.. a problem occurs when i double click. It should deduct one from the stack and place a campfire on the ground. Instead it ignites the entire stack and places a single campfire on the ground.

Example: I have a stack of 20 kindling. I double click the stack and all are ignited. It should act like.. doubleclick 19, doubleclick 18, ... etc.

I'm still learning javascript. I've mostly been focusing on dfndata. But I wanted to point out that kindling stacks are not working correctly.
Last edited by John on Thu Jan 09, 2014 6:15 am, edited 1 time in total.
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

Post by dragon slayer »

here is my fix for that but puts the hole stack of kindling under the fire lol.

Code: Select all

                if( iUsed.amount > 1 )
		    iUsed.amount = (iUsed.amount-1);
                    var eKindling = CreateDFNItem( pUser.socket, pUser, "0x0de3", 1, "ITEM", false );
		    if( eKindling && eKindling.isItem )
			eKindling.movable = 2;
                        eKindling.dir = 29;
                        eKindling.StartTimer( 60000, 1, true ); //Campfire burns for 60 second
                    pUser.SysMessage( GetDictionaryEntry( 1765, pSock.Language ));
still not sure how to keep the stack in pack when fire is created
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

Post by dragon slayer »

here you go john i fixed the kindling problem now :)

all works great

Code: Select all

function onUseChecked( pUser, iUsed )
{
    var pSock = pUser.socket;
    var CampingAttempt = pUser.skills.camping / 10;
    var Success = RandomNumber( 0, 100 );	
    if( pSock && iUsed && iUsed.isItem )
    {
	  //Check to see if it's locked down
	  if( iUsed.movable == 2 || iUsed.movable == 3 )
	  {
		socket.SysMessage( GetDictionaryEntry( 774, socket.Language ) ); //That is locked down and you cannot use it
		return false;
	  }
	  if( iUsed.amount > 1 )
		iUsed.amount = (iUsed.amount-1);
	  else
		iUsed.Delete();
          var eKindling = CreateDFNItem( pUser.socket, pUser, "0x0de3", 1, "ITEM", false );
	  if( eKindling && eKindling.isItem )
		eKindling.movable = 2;
                eKindling.dir = 29;
                eKindling.StartTimer( 60000, 1, true ); //Campfire burns for 60 second
          pUser.SysMessage( GetDictionaryEntry( 1765, pSock.Language ));
    }
    return false;
}
John
UOX3 Neophyte
Posts: 32
Joined: Thu Sep 15, 2011 7:41 am
Location: Inside Tom's Brain
Has thanked: 0
Been thanked: 0

Post by John »

Nice! I will try this out. Thanks :)
Last edited by John on Thu Jan 09, 2014 6:16 am, edited 1 time in total.
John
UOX3 Neophyte
Posts: 32
Joined: Thu Sep 15, 2011 7:41 am
Location: Inside Tom's Brain
Has thanked: 0
Been thanked: 0

Post by John »

Found a couple problems. It does subtract 1 from a pile now which is awesome. But now the camping skill don't raise at all. When skill raises should get random str, dex, int but it don't work now. Also, when I double click a kindling, it always says I successfully create a campfire but does not give the message about waiting a few seconds to secure camp nor does it give message that says camp is secure.

The default kindling script raised camping skill, stats, and displayed the two securing camp messages. I hate to ask this but could you check why its not raising skill, stats, or giving those messages? I do want to say thanks for scripting the subtract 1 from pile that works awesome.

I tested with 50 kindling and it did subtract one by one down to none but I had the skill window up and camping skill stayed at 20.1. Strength stayed at 60, Dex at 10, Int at 10.
Last edited by John on Thu Jan 09, 2014 6:16 am, edited 1 time in total.
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

Post by dragon slayer »

My bad forgot to readd skill check when i started to redo the script
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

Post by dragon slayer »

here you go john with skill check now :)

Code: Select all

function onUseChecked( pUser, iUsed )
{
    var pSock = pUser.socket;
    var CampingAttempt = pUser.skills.camping / 10;
    var Success = RandomNumber( 0, 100 );	
    if( pSock && iUsed && iUsed.isItem )
    {
	  //Check to see if it's locked down
	  if( iUsed.movable == 2 || iUsed.movable == 3 )
	  {
		socket.SysMessage( GetDictionaryEntry( 774, socket.Language ) ); //That is locked down and you cannot use it
		return false;
	  }
	  if( pUser.CheckSkill( 10, 0, 1000 ) )
	  {
	     if( iUsed.amount > 1 )
		  iUsed.amount = (iUsed.amount-1);
	     else
		  iUsed.Delete();
             var eKindling = CreateDFNItem( pUser.socket, pUser, "0x0de3", 1, "ITEM", false );
	     if( eKindling && eKindling.isItem )
		eKindling.movable = 2;
                eKindling.dir = 29;
                eKindling.StartTimer( 15000, 1, true );
             pUser.SysMessage( GetDictionaryEntry( 1765, pSock.Language ));
	 }
	 else
            pUser.SysMessage( GetDictionaryEntry( 1764, pSock.Language ));
    }
    return false;
}
I'm still working on the camp secure msgs :)
John
UOX3 Neophyte
Posts: 32
Joined: Thu Sep 15, 2011 7:41 am
Location: Inside Tom's Brain
Has thanked: 0
Been thanked: 0

Post by John »

You have no idea how happy this kindling script makes me :)

I know many don't use camping because most use inns to logout safely, but I've always had fun playing Rangers in UO. Thanks for this and the work you did on bedroll. Much appreciated!
Last edited by John on Thu Jan 09, 2014 6:16 am, edited 1 time in total.
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

Post by dragon slayer »

you could always make inns not insta logout :) me I'm working on a js script to make it so if you log out at a inn it costs you 1k gold :)
John
UOX3 Neophyte
Posts: 32
Joined: Thu Sep 15, 2011 7:41 am
Location: Inside Tom's Brain
Has thanked: 0
Been thanked: 0

Post by John »

I found another problem with the kindling script. After a campfire burns out and you see the ashes on ground, they don't decay or delete themselves.. where ever you placed a campfire the ashes will remain there until you manually 'remove them. They should remove themselves shortly after they burn out.

I didnt notice this until i was practicing camping in yew. I lit campfires from the healer shop to the archery shop and went off to chop wood, when i returned 10 minutes later the ashes where still on ground. I left server running and walked away from computer for about 10 additional minutes to fix me something to eat and when i returned the ashes were still on ground.. a line of 50 of them lol. Some reason the ashes arent decaying.
Last edited by John on Thu Jan 09, 2014 6:17 am, edited 1 time in total.
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

Post by dragon slayer »

Ill fix that and post fix for you :)
John
UOX3 Neophyte
Posts: 32
Joined: Thu Sep 15, 2011 7:41 am
Location: Inside Tom's Brain
Has thanked: 0
Been thanked: 0

Post by John »

Thanks :)

Sorry, I'm not trying to be annoying. Your work is quite awesome. I was just posting any bugs I find in scripts. No hurry and many thanks in advance.
Last edited by John on Thu Jan 09, 2014 6:17 am, edited 1 time in total.
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

Post by dragon slayer »

heck I'm not a dev here I'm just trying to help hehe xuir is the main dev

I'm just glad i could be of some help since xuri is a busy guy :)

But bug you found maybe a decay timer bug on all items.
Locked