Order/Honor Scripts

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Mephisto
New User
Posts: 13
Joined: Mon Mar 06, 2006 10:28 pm

Order/Honor Scripts

Post by Mephisto »

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: Select all

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
Mithril
New User
Posts: 25
Joined: Sat Feb 04, 2006 5:15 pm

Post by Mithril »

You were actually quite close :)

Code: Select all

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.
nevalon
Neophyte Poster
Posts: 39
Joined: Tue Mar 07, 2006 7:28 am

Post by nevalon »

Code: Select all

SetObjProperty ( player, "honor", yourhonor );
and:

Code: Select all

SendSysMessage ( player, "You have " + CStr ( yourhonor[2] ) + " honor." );
Mithril
New User
Posts: 25
Joined: Sat Feb 04, 2006 5:15 pm

Post by Mithril »

Doh! I missed those other spots

*goes to find more coffee*
Mephisto
New User
Posts: 13
Joined: Mon Mar 06, 2006 10:28 pm

Post by Mephisto »

*smacks head*
:shock:

Can't believe I missed those heh. Thanks. Maybe I shouldn't try scripting at 2-3am again... hehe
DevGIB
Grandmaster Poster
Posts: 248
Joined: Mon Feb 06, 2006 6:12 am

Post by DevGIB »

i dont think i script any other time :P
Mephisto
New User
Posts: 13
Joined: Mon Mar 06, 2006 10:28 pm

Post by Mephisto »

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: Select all

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!
XtehseA
New User
Posts: 22
Joined: Thu Feb 23, 2006 8:33 pm

Post by XtehseA »

mephisto whats your msn or email i wish to talk to you.
Mephisto
New User
Posts: 13
Joined: Mon Mar 06, 2006 10:28 pm

Post by Mephisto »

Can MSN me at skyhawc@hotmail.com
Post Reply