PenUltima Online

It is currently Sun Sep 07, 2008 2:46 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Order/Honor Scripts
PostPosted: Thu Mar 09, 2006 12:26 am 
Offline

Joined: Mon Mar 06, 2006 10:28 pm
Posts: 13
I'm using the sanctuary script files to begin with, and have fixed the common bugs thusfar, I'm still quite new to scripting, and am currently trying to create a dot comman for honor, such as the one for exp and virtue. Does anyone have any suggestions, I can't test anything I do at the moment, since my main computer with my test shard is out of service at the moment, But what I've tossed together in the last 10 mins is this....


Code:
use uo;

include "../pkg/character/orders/orders";

program honor ( player, parms )

        var yourvirtue := abs ( GetVirtueAmount (you) );
   var yourhonor := GetObjProperty ( player, "honor" );

   if ( !yourhonor )
      yourhonor := {};
      yourhonor[1] := yourvirtue;
      yourhonor[2] := 0;
      yourhonor[3] := 0;

      SetObjProperty ( player, "honor[2]", 0 );
   endif

   SendSysMessage ( player, "You have " + CStr ( honor[2] ) + " honor." );
   
endprogram


Now I haven't finished thinking this script through, and i know as it stands right now, it won't work.... atleast I don't believe so, any tips, hints, etc...? Any help will be appreciated. Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 09, 2006 7:07 am 
Offline

Joined: Sat Feb 04, 2006 5:15 pm
Posts: 25
You were actually quite close :)
Code:
use uo;

include "../pkg/character/orders/orders";

program honor ( player, parms )

        var yourvirtue := abs ( GetVirtueAmount (you) );
   var yourhonor := GetObjProperty ( player, "honor" );

   if ( !yourhonor )
      yourhonor := {};
      yourhonor[1] := yourvirtue;
      yourhonor[2] := 0;
      yourhonor[3] := 0;

      SetObjProperty ( player, "honor", 0 );
   endif

   SendSysMessage ( player, "You have " + CStr ( honor[2] ) + " honor." );
   
endprogram


That should do what you need I believe. Was just the seeting of the property to the array, not the 2nd element.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 09, 2006 7:47 am 
Offline

Joined: Tue Mar 07, 2006 7:28 am
Posts: 39
Location: Poland
Code:
SetObjProperty ( player, "honor", yourhonor );

and:
Code:
SendSysMessage ( player, "You have " + CStr ( yourhonor[2] ) + " honor." );

_________________
Sorry for my English... I don't know it well.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 09, 2006 8:06 am 
Offline

Joined: Sat Feb 04, 2006 5:15 pm
Posts: 25
Doh! I missed those other spots

*goes to find more coffee*


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 09, 2006 8:21 am 
Offline

Joined: Mon Mar 06, 2006 10:28 pm
Posts: 13
*smacks head*
:shock:

Can't believe I missed those heh. Thanks. Maybe I shouldn't try scripting at 2-3am again... hehe


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 09, 2006 11:12 pm 
Offline

Joined: Mon Feb 06, 2006 6:12 am
Posts: 93
i dont think i script any other time :P


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 10, 2006 1:02 am 
Offline

Joined: Mon Mar 06, 2006 10:28 pm
Posts: 13
Well, I did get it functional for the most part. Thanks for everyone's help. Here is the code thusfar, I need to do some more tweaking to it...

Code:
use uo;

include "../pkg/character/orders/orders";

program honor ( player, parms )

        var yourvirtue := GetObjProperty (player, "virtue" );
   var yourhonor := GetObjProperty ( player, "honor" );

   if ( !yourhonor )
      yourhonor := {};
      yourhonor[1] := yourvirtue;
      yourhonor[2] := 0;
      yourhonor[3] := 0;

      SetObjProperty ( player, "honor", yourhonor );
   endif

   SendSysMessage ( player, "You have " + CStr ( yourhonor[2] ) + " honor." );
   
endprogram


What it is doing, is if I use my GM chars to add honor to anyone, which is the only way I've tested it thusfar... When you use the command .honor it shows how much honor the character has, plus what it was given...

So If I give a character 3000 honor points, then give them another 500, what appears on screen is... "You have 3000 , 500 honor" and so forth... Any suggestions? I'm assuming I have my array a bit scewed perhaps? Maybe it's honor3 that is the total honor... and 2 is the amount that has been given. I'll have to run through my order scripts again to be certain... Thanks again!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 10, 2006 2:05 am 
Offline

Joined: Thu Feb 23, 2006 8:33 pm
Posts: 22
mephisto whats your msn or email i wish to talk to you.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 10, 2006 6:06 am 
Offline

Joined: Mon Mar 06, 2006 10:28 pm
Posts: 13
Can MSN me at skyhawc@hotmail.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl