Jump to content
  • 0
Sign in to follow this  
Radian

Changelook Function

Question

Can someone tell me how to restore the old pallets on an item.. because I am using equipped and unequipped on an item. {},{ changelook 7,201 } { restore original pallet } 

Share this post


Link to post
Share on other sites

11 answers to this question

Recommended Posts

  • 0

You need to save in a new variable the previous look value before change it, then when unequip the armor make the changelook with the value saved of the var. Something like these:

 

    OnEquipScript: <"        previouspal = getlook(7);        changelook 7,201;    ">    OnUnequipScript: <" changelook 7,previouspal; "> 
Edited by Ragno

Share this post


Link to post
Share on other sites
  • 0

Just for the record, I missed a quotation mark at the end of the OnUnequipScript in the example. I'm happy it help you, good look in that, the use you give to the item sounds interesting.

Share this post


Link to post
Share on other sites
  • 0

 

You need to save in a new variable the previous look value before change it, then when unequip the armor make the changelook with the value saved of the var. Something like these:

 

    OnEquipScript: <"        previouspal = getlook(7);        changelook 7,201;    ">    OnUnequipScript: <" changelook 7,previouspal; "> 

thanks for this!

how will i make this into item consumable script with time duration example i have certain cloth and hair color and i consume apple#512 which turns the cloth and hair color into red or specific palettes and after 1 minute it will return to the designated palettes thanks! sorry for my bad english

Share this post


Link to post
Share on other sites
  • 0

 

 

You need to save in a new variable the previous look value before change it, then when unequip the armor make the changelook with the value saved of the var. Something like these:

 

    OnEquipScript: <"        previouspal = getlook(7);        changelook 7,201;    ">    OnUnequipScript: <" changelook 7,previouspal; "> 

thanks for this!

how will i make this into item consumable script with time duration example i have certain cloth and hair color and i consume apple#512 which turns the cloth and hair color into red or specific palettes and after 1 minute it will return to the designated palettes thanks! sorry for my bad english

 

You can try calling a function to do that. Maybe trying with the next example you can get it:

 

In Item script:

callfunc "ChangeStyle",201,getlook(7);

Where "201" is the new changelook value and "getlook(7)" is the previous changelook value.

 

In a NPC Script:

function    script    ChangeStyle    {        changelook 7,getarg(0);        dispbottom "Your look has changed to "+getarg(0);        dispbottom "With a duration of a second, then your look will return to normal";        sleep2 1000;        changelook 7,getarg(1);        dispbottom "Your look has returned to normal";        end;}

 

It works for me, but it need to be tested a little more. I hope this help you.

Share this post


Link to post
Share on other sites
  • 0

 

 

 

You need to save in a new variable the previous look value before change it, then when unequip the armor make the changelook with the value saved of the var. Something like these:

 

    OnEquipScript: <"        previouspal = getlook(7);        changelook 7,201;    ">    OnUnequipScript: <" changelook 7,previouspal; "> 

thanks for this!

how will i make this into item consumable script with time duration example i have certain cloth and hair color and i consume apple#512 which turns the cloth and hair color into red or specific palettes and after 1 minute it will return to the designated palettes thanks! sorry for my bad english

 

You can try calling a function to do that. Maybe trying with the next example you can get it:

 

In Item script:

callfunc "ChangeStyle",201,getlook(7);

Where "201" is the new changelook value and "getlook(7)" is the previous changelook value.

 

In a NPC Script:

function    script    ChangeStyle    {        changelook 7,getarg(0);        dispbottom "Your look has changed to "+getarg(0);        dispbottom "With a duration of a second, then your look will return to normal";        sleep2 1000;        changelook 7,getarg(1);        dispbottom "Your look has returned to normal";        end;}

 

It works for me, but it need to be tested a little more. I hope this help you.

 

 

Okay Let me try first thanks! btw will this change only cloth color? or both hair and cloth? and how about different hair and cloth color like (color #25 for hair and color#30 for cloth)

Edited by Reins

Share this post


Link to post
Share on other sites
  • 0

Okay Let me try first thanks! btw will this change only cloth color? or both hair and cloth? and how about different hair and cloth color like (color #25 for hair and color#30 for cloth)

It will change only the cloth color, but you can edit it to make it work as you may need: change cloth or hair color only, change both cloth and hair with the same color, or change both cloth and hair with different colors.

 

To change hair color use "changelook 6" instead of "changelook 7". Please see the hercules documentation for script commands to see how does that scripts works (just search for *changelook in your browser).

Share this post


Link to post
Share on other sites
  • 0

 

Okay Let me try first thanks! btw will this change only cloth color? or both hair and cloth? and how about different hair and cloth color like (color #25 for hair and color#30 for cloth)

It will change only the cloth color, but you can edit it to make it work as you may need: change cloth or hair color only, change both cloth and hair with the same color, or change both cloth and hair with different colors.

 

To change hair color use "changelook 6" instead of "changelook 7". Please see the hercules documentation for script commands to see how does that scripts works (just search for *changelook in your browser).

Thanks it works but i have problem regarding merging those getlook(7); and getlook(6); 

 

here's my item script regards that

 

{ callfunc "ChangeStyle",264,getlook(6); callfunc "ChangeStyle1",554,getlook(7); } somehow it manage to change only the hair color when i consumed the item the cloth color didn't change and how about the both hair color and cloth color with different values into 1 callfunc

Edited by Reins

Share this post


Link to post
Share on other sites
  • 0

For that to work you need to edit the function itself.

1) Replace end with return;

That way it'll change cloth color for a sec, and then change hair color for a sec.

2) If you need both at the same time you need to edit the function more, like this:

function    script    ChangeStyle    {        changelook 7,getarg(0);        changelook 6,getarg(2);        dispbottom "Your cloth color has changed to "+getarg(0)+" and hair color to "+getarg(2);        dispbottom "With a duration of a second, then your look will return to normal";        sleep2 1000;        changelook 7,getarg(1);        changelook 6,getarg(3);        dispbottom "Your look has returned to normal.";        end;}

And, accordingly, change the call from item

callfunc "ChangeStyle",554,getlook(7),264,getlook(6);

Share this post


Link to post
Share on other sites
  • 0

 

For that to work you need to edit the function itself.

1) Replace end with return;

That way it'll change cloth color for a sec, and then change hair color for a sec.

2) If you need both at the same time you need to edit the function more, like this:

function    script    ChangeStyle    {        changelook 7,getarg(0);        changelook 6,getarg(2);        dispbottom "Your cloth color has changed to "+getarg(0)+" and hair color to "+getarg(2);        dispbottom "With a duration of a second, then your look will return to normal";        sleep2 1000;        changelook 7,getarg(1);        changelook 6,getarg(3);        dispbottom "Your look has returned to normal.";        end;}

And, accordingly, change the call from item

callfunc "ChangeStyle",554,getlook(7),264,getlook(6);

will try that asap wait!

 

EDIT: Its ok now thanks guys!

Edited by Reins

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.