Trying to color an effect

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.

Moderator: POL Developer

Post Reply
Zaksmeer
Grandmaster Poster
Posts: 187
Joined: Mon Nov 19, 2012 8:32 pm

Trying to color an effect

Post by Zaksmeer » Tue May 06, 2014 10:07 pm

I have this effect script for hiding and stuff and I would like to color it any color I choose. Here is what I have so far, but having trouble getting it to compile with the custom color.

Code: Select all

/*
        Created by *Edwards    2008-12-13

        Modified by *Zaksmeer    2014-5-01
*/

use uo;
use os;
include "include/client";



program textcmd_devcome( staff )

	var base_colour := color;

        color := ( 2037 );


	PlaySoundEffect( staff, 0x51E );
	PlaySoundEffect( staff, 0x5CF );
	SleepMS(1);


	PlayStationaryEffect( staff.x, staff.y+10, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+10, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x, staff.y-10, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x-10, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );

	PlayStationaryEffect( staff.x-10, staff.y-10, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+10, staff.y+10, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x-10, staff.y+10, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+10, staff.y-10, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	SleepMS(150);


	PlaySoundEffect( staff, 521 );
	PlayStationaryEffect( staff.x, staff.y+9, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x, staff.y-9, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+9, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x-9, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );

	PlayStationaryEffect( staff.x-9, staff.y-9, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+9, staff.y+9, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x-9, staff.y+9, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+9, staff.y-9, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	SleepMS(150);

	PlaySoundEffect( staff, 521 );
	PlayStationaryEffect( staff.x, staff.y+8, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x, staff.y-8, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+8, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x-8, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );

	PlayStationaryEffect( staff.x-8, staff.y-8, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+8, staff.y+8, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x-8, staff.y+8, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+8, staff.y-8, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	SleepMS(150);

	PlaySoundEffect( staff, 521 );
	PlayStationaryEffect( staff.x, staff.y+7, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x, staff.y-7, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+7, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x-7, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );

	PlayStationaryEffect( staff.x-7, staff.y-7, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+7, staff.y+7, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x-7, staff.y+7, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+7, staff.y-7, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	SleepMS(150);

	PlaySoundEffect( staff, 521 );
	PlayStationaryEffect( staff.x, staff.y+6, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x, staff.y-6, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+6, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x-6, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );

	PlayStationaryEffect( staff.x-6, staff.y-6, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+6, staff.y+6, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x-6, staff.y+6, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+6, staff.y-6, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	SleepMS(150);

	PlaySoundEffect( staff, 521 );
	PlayStationaryEffect( staff.x, staff.y+5, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x, staff.y-5, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+5, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x-5, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );

	PlayStationaryEffect( staff.x-5, staff.y-5, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+5, staff.y+5, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x-5, staff.y+5, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+5, staff.y-5, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	SleepMS(150);

	PlaySoundEffect( staff, 521 );
	PlayStationaryEffect( staff.x, staff.y+4, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x, staff.y-4, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+4, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x-4, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );

	PlayStationaryEffect( staff.x-4, staff.y-4, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+4, staff.y+4, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x-4, staff.y+4, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+4, staff.y-4, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	SleepMS(150);

	PlaySoundEffect( staff, 521 );
	PlayStationaryEffect( staff.x, staff.y+3, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x, staff.y-3, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+3, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x-3, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );

	PlayStationaryEffect( staff.x-3, staff.y-3, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+3, staff.y+3, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x-3, staff.y+3, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+3, staff.y-3, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	SleepMS(150);


	PlaySoundEffect( staff, 521 );
	PlayStationaryEffect( staff.x, staff.y+2, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x, staff.y-2, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm);
	PlayStationaryEffect( staff.x+2, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x-2, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm);

	PlayStationaryEffect( staff.x-2, staff.y-2, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+2, staff.y+2, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x-2, staff.y+2, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	PlayStationaryEffect( staff.x+2, staff.y-2, staff.z+1, 0x3709, 0x0a, 0x1e, 0, staff.realm );
	SleepMS(150);


	PlaySoundEffect( staff, 521 );
	PlayStationaryEffect( staff.x, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 1, staff.realm );
	PlayStationaryEffect( staff.x-1, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 1, staff.realm );
	PlayStationaryEffect( staff.x+1, staff.y, staff.z+1, 0x3709, 0x0a, 0x1e, 1, staff.realm );
	PlayStationaryEffect( staff.x, staff.y+1, staff.z+1, 0x3709, 0x0a, 0x1e, 1, staff.realm );
	PlayStationaryEffect( staff.x, staff.y-1, staff.z+1, 0x3709, 0x0a, 0x1e, 1, staff.realm );

	PlayStationaryEffect( staff.x-1, staff.y+1, staff.z+1, 0x3709, 0x0a, 0x1e, 1, staff.realm );
	PlayStationaryEffect( staff.x-1, staff.y-1, staff.z+1, 0x3709, 0x0a, 0x1e, 1, staff.realm );
	PlayStationaryEffect( staff.x+1, staff.y+1, staff.z+1, 0x3709, 0x0a, 0x1e, 1, staff.realm );
	PlayStationaryEffect( staff.x+1, staff.y-1, staff.z+1, 0x3709, 0x0a, 0x1e, 1, staff.realm );
	
	PlaySoundEffect( staff, 520 );
 
	PlaySoundEffect( staff, 0x02a );
	PlayLightningBoltEffect( staff );
	PlayLightningBoltEffect( staff );
	PlaySoundEffect( staff, 0x02a );
	PlayLightningBoltEffect( staff );
	PlayLightningBoltEffect( staff );
	PlaySoundEffect( staff, 0x02a );
	PlayLightningBoltEffect( staff );
	PlayLightningBoltEffect( staff );

	PlayObjectCenteredEffect( staff, 0x3709, 0x0a, 0x1e );
	PlayObjectCenteredEffect( staff, 0x375a, 7, 0x10 );
	PlayObjectCenteredEffect( staff, 0x3709, 0x0a, 0x1e );
	PlayObjectCenteredEffect( staff, 0x375a, 7, 0x10 );
	PlayObjectCenteredEffect( staff, 0x3709, 0x0a, 0x1e );
	PlayObjectCenteredEffect( staff, 0x375a, 7, 0x10 );

	PerformAction( staff, 0x11 );
	PerformAction( staff, 0x0011 );
 
	PlaySoundEffect( staff,520 );
	PlaySoundEffect( staff,519 );
	PlaySoundEffect( staff,0x5CF );



        sleep( 1);      
       //0=visible, 1=invisible
        staff.concealed := 0;

        return 1;

endprogram 

Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: Trying to color an effect

Post by Tomi » Tue May 06, 2014 11:00 pm

okay first thing

Code: Select all

program textcmd_devcome( staff )

   var base_colour := color;

        color := ( 2037 );
You have not defined color anywhere, and you assign to your variable base_colour a non existant variable color.

either do simply var color := 2037; or if you want the color to be chosen by command usage do something like

program textcmd_devcome( staff, color ) and use the command by typing .devcome 2037

After that, you need to insert that color you use to all those effect functions that does not support the color parameter and you need to use PlayStationaryEffectEx for that, check for uo module documentation the difference between those functions.

http://docs.polserver.com/pol099/fullfu ... lfile=uoem

Post Reply