change graphic?

Archive of the older Feature Request Forum Posts
Locked
Yerome
New User
Posts: 5
Joined: Fri Sep 07, 2007 8:43 am

change graphic?

Post by Yerome »

How can i change graphic to a player?
GetObjProperty(who,"graphic");
SetObjProperty(who,"graphic",133);

I found 133 in inside uo as some dragon.. but its no work on me... any idea?
mr bubbles
Grandmaster Poster
Posts: 120
Joined: Thu Jan 18, 2007 2:34 am

Post by mr bubbles »

gotta change the players graphic member. so something like

who.graphic := 133;
Yerome
New User
Posts: 5
Joined: Fri Sep 07, 2007 8:43 am

Post by Yerome »

mr bubbles wrote:gotta change the players graphic member. so something like

who.graphic := 133;
And when i want to swap between them?
player click on item and it change his graphic and second click turn him back.

Code: Select all

use uo;
use os;
use unicode;


program gump(who);
var human:=Cint(GetObjProperty(who,"graphic"));
who.graphic := 7;


if (who.graphic==7);
who.graphic :=human;
endif;
SendSysMessage(who,"bla bla"); 
but this script save his property actually.. i need to save his property permanently.
User avatar
Tritan
Grandmaster Poster
Posts: 147
Joined: Sat Feb 04, 2006 8:17 am

Post by Tritan »

You want to this to based off and item getting used?

In order to do that you would first have to check to see what the players current graphic is then change it accordingly.

Code: Select all

use uo; 
use os; 
use unicode; 

program gump(who); 
var human_form:=Cint(GetObjProperty(who,"human")); 
var beast_form:=Cint(GetObjProperty(who,"beast"));
// Check if prop is set, if not set it now.
if (!beast_form)
beast_form:=7;
SetObjProperty (who, "beast", beast_form);
endif

// Check if prop is set, if not set it now.
if (!human_form)
human_form:=who.graphic;
SetObjProperty (who,"human", human_form);
endif

if (who.graphic==beast_form); 
who.graphic :=human_form; 
elseif (who.graphic==human_form)
who.graphic := beast_form;
endif; 

SendSysMessage(who,"bla bla"); 

This would allow for the switching between the two graphics when called depending on the current form the player is set to currently. You can either set the beast form in the script or have it be another cprop on the player. I showed the example of using a cprop on the player.
Locked