need alittle help please
need alittle help please
im trying to make a chromo robe and it wont compile for me :(
-------------------------------------------------------------------------------
use util;
program equip(who, robe)
var validcolors := { 1, 2, 10, 20, 30, 40, 60, 80 }; //Put all valid colors here separated by commas.
var rint := RandomInt(validcolors.size())+1;
var color := validcolors[rint];
robe.color := color;
return 1;
endprogram
-------------------------------------------------------------------------------
Armor 0xff03
{
Name Chromo Robe
Desc chromo robe
Graphic 0x1f03
AR 4
Color 1933
Coverage Body
Coverage Legs/feet
Coverage Arms
VendorSellsFor 68
VendorBuysFor 34
maxhp 20
equipscript equip
}
-------------------------------------------------------------------------------
thats all i got so far
-------------------------------------------------------------------------------
use util;
program equip(who, robe)
var validcolors := { 1, 2, 10, 20, 30, 40, 60, 80 }; //Put all valid colors here separated by commas.
var rint := RandomInt(validcolors.size())+1;
var color := validcolors[rint];
robe.color := color;
return 1;
endprogram
-------------------------------------------------------------------------------
Armor 0xff03
{
Name Chromo Robe
Desc chromo robe
Graphic 0x1f03
AR 4
Color 1933
Coverage Body
Coverage Legs/feet
Coverage Arms
VendorSellsFor 68
VendorBuysFor 34
maxhp 20
equipscript equip
}
-------------------------------------------------------------------------------
thats all i got so far
##
## ecompile.cfg: must be in the same directory as ecompile.exe
##
#
# ModuleDirectory: Location of *.em files
#
ModuleDirectory D:\POL\scripts
#
# IncludeDirectory: Location of *.inc files, if not found relative
# or with a specified package
#
IncludeDirectory D:\POL\scripts
#
# PolScriptRoot: Location of "::file" includes
#
PolScriptRoot D:\POL\scripts
#
# PackageRoot: root directories where packages are stored
# This can be specified multiple times.
#
PackageRoot D:\POL\pkg
PackageRoot c:\pol\devpkg
#
# Default ecompile options
#
GenerateListing 1
GenerateDebugInfo 1
GenerateDebugTextInfo 0
DisplayWarnings 1
CompileAspPages 1
AutoCompileByDefault 1
UpdateOnlyOnAutoCompile 1
OnlyCompileUpdatedScripts 1
DisplaySummary 1
GenerateDependencyInfo 1
DisplayUpToDateScripts 0
------------------------------------------------------------
thats what mine says, i dunno how to check it
## ecompile.cfg: must be in the same directory as ecompile.exe
##
#
# ModuleDirectory: Location of *.em files
#
ModuleDirectory D:\POL\scripts
#
# IncludeDirectory: Location of *.inc files, if not found relative
# or with a specified package
#
IncludeDirectory D:\POL\scripts
#
# PolScriptRoot: Location of "::file" includes
#
PolScriptRoot D:\POL\scripts
#
# PackageRoot: root directories where packages are stored
# This can be specified multiple times.
#
PackageRoot D:\POL\pkg
PackageRoot c:\pol\devpkg
#
# Default ecompile options
#
GenerateListing 1
GenerateDebugInfo 1
GenerateDebugTextInfo 0
DisplayWarnings 1
CompileAspPages 1
AutoCompileByDefault 1
UpdateOnlyOnAutoCompile 1
OnlyCompileUpdatedScripts 1
DisplaySummary 1
GenerateDependencyInfo 1
DisplayUpToDateScripts 0
------------------------------------------------------------
thats what mine says, i dunno how to check it
got it to work, but now when i goto to do .create chromo robe , nothing happens
------------------------------------------------------------
Armor 0xff03
{
Name Chromo Robe
Graphic 0x1f03
AR 4
Coverage Body
Coverage Legs/feet
Coverage Arms
VendorSellsFor 68
VendorBuysFor 34
maxhp 20
equipscript equip
}
------------------------------------------------------------
thats my item.cfg file
also with my world chat im trying to put a timer on long till people can use it again but i always get an error where every i put 'sleep(120);'
--------------------------------------------------------------
use uo;
program textcmd_wc( who, text )
var ppl := EnumerateOnlineCharacters();
foreach x in ppl
if (x.cmdlevel > 0)
SendSysMessage(x, "World Chat From " + who.name + ": " + text, 3, 67);
endif
sleep(120);
endforeach
endprogram
------------------------------------------------------------
Armor 0xff03
{
Name Chromo Robe
Graphic 0x1f03
AR 4
Coverage Body
Coverage Legs/feet
Coverage Arms
VendorSellsFor 68
VendorBuysFor 34
maxhp 20
equipscript equip
}
------------------------------------------------------------
thats my item.cfg file
also with my world chat im trying to put a timer on long till people can use it again but i always get an error where every i put 'sleep(120);'
--------------------------------------------------------------
use uo;
program textcmd_wc( who, text )
var ppl := EnumerateOnlineCharacters();
foreach x in ppl
if (x.cmdlevel > 0)
SendSysMessage(x, "World Chat From " + who.name + ": " + text, 3, 67);
endif
sleep(120);
endforeach
endprogram
I think the space between chromo and robe in the name is the problem. try making the following change to the itemdesc file.
Try .create chromorobe after making the change.
See if that works.
Code: Select all
Armor 0xff03
{
Name chromorobe
Desc Chromo Robe
Graphic 0x1f03
AR 4
Coverage Body
Coverage Legs/feet
Coverage Arms
VendorSellsFor 68
VendorBuysFor 34
maxhp 20
equipscript equip
}
See if that works.
well, if you're using the itemdesc.cfg in C:\POL\CONFIG\
then there is no package and there's another problem.
if it's in something like C:\POL\PKG\PackageName\
then in there there should be a file named pkg.cfg
open it and see if enabled is set to 1 if not, then change it to 1 and run pol and try again.
then there is no package and there's another problem.
if it's in something like C:\POL\PKG\PackageName\
then in there there should be a file named pkg.cfg
open it and see if enabled is set to 1 if not, then change it to 1 and run pol and try again.
Try using ".create 0xff03" instead, and see if that works. If not, then it's probably something in your packages. If your package is enabled, I've had problems putting core cfg files in the "/config" directory inside a package. Try moving it to the same level as "pkg.cfg" and use the command.
As for the text command:
I wouldn't put a sleep in the command itself. I would make it a reference variable; and all the sleep does at the moment is put a delay of 120 seconds in between when it sends a message to each character.
I know it has a lot of constants, but it's the same concept as include files: easy to update or expand several things easily.
As for the text command:
Code: Select all
program textcmd_wc( who, text )
var ppl := EnumerateOnlineCharacters();
foreach x in ppl
if (x.cmdlevel > 0)
SendSysMessage(x, "World Chat From " + who.name + ": " + text, 3, 67);
endif
sleep(120);
endforeach
endprogram
Code: Select all
use uo;
const CHAT_DELAY = 10;
const CHAT_COLOR = 67;
const MIN_CMD_LEVEL = 1;
/* This is a temporary variable to make sure it's not saved
on shut-down, interfering with chat ability on server restart. */
const OBJPROP_CHATDELAY = "#lastchat";
program textcmd_wc(who,text)
// Check the delay.
if( GetObjProperty(who,OBJPROP_CHATDELAY) > ReadGameClock() )
SendSysMessage(who,"You must wait "+CHAT_DELAY+" seconds before using this command." );
return 0;
endif
// Do they have anything to say?
if(!text)
SendSysMessage(who,"Proper usage is: .wc *chat text*");
return 0;
endif
// List all the online characters.
foreach character in EnumerateOnlineCharacters()
// Make sure the character has the appropriate commandlevel.
if( character.cmdlevel >= MIN_CMD_LEVEL )
// Send the message to the character.
SendSysMessage(character, "World Chat From "+character.name+": "+text,_DEFAULT_TEXT_FONT,CHAT_COLOR);
endif
endforeach
// Set the object property to the character.
SetObjProperty(character,OBJPROP_CHATDELAY,ReadGameClock()+CHAT_DELAY);
endprogram
yep that worked thanxs
just need alittle help with my .wc script, i wont to make it so poeple have to wait 120s before they can use it again
----------------------------------------------------
use uo;
program textcmd_wc( who, text )
var ppl := EnumerateOnlineCharacters();
foreach x in ppl
if (x.cmdlevel > 0)
SendSysMessage(x, "World Chat From " + who.name + ": " + text, 3, 67);
endif
sleep(120);
endforeach
endprogram
just need alittle help with my .wc script, i wont to make it so poeple have to wait 120s before they can use it again
----------------------------------------------------
use uo;
program textcmd_wc( who, text )
var ppl := EnumerateOnlineCharacters();
foreach x in ppl
if (x.cmdlevel > 0)
SendSysMessage(x, "World Chat From " + who.name + ": " + text, 3, 67);
endif
sleep(120);
endforeach
endprogram
Okay, so quick walkthrough:
The first thing you're going to want to do is open the equipscript for reference.
The tile will, of course, need the same headers as the equip script.
The next thing you'll want to do is see the basic structure of a "walkon" script. I looked into the scripts folder, and arbitrarily pulled up a script with the name "walkon" in it. I want the parameters, so I copy them to the new script:
Then, it's basically a copy-paste of the code that you want to use.
But wait! The script won't compile yet. Since we've done a copy-paste, the code isn't completely consistent with what we want. The script tries to reference a variable named "robe". Because this variable is named by the second parameter of our source script, and is supposed to reference the object passed as the second parameter of the destination script, the change is as simple as a name. So from here, we search the script for all references to "robe" and change it to "tile".
You now have a functional walkon script, that performs the same action to a tile, as the equipscript does to the robe.
The first thing you're going to want to do is open the equipscript for reference.
Code: Select all
use util;
program equip(who, robe)
/** All valid colors here separated by commas. */
var validcolors := { 1, 2, 10, 20, 30, 40, 60, 80 };
var rint := RandomInt(validcolors.size())+1;
var color := validcolors[rint];
robe.color := color;
return 1;
endprogramCode: Select all
use util;Code: Select all
use util;
program walkon_ChromoTile(who, tile)Then, it's basically a copy-paste of the code that you want to use.
Code: Select all
use util;
program walkon_ChromoTile(who, tile)
/** All valid colors here separated by commas. */
var validcolors := { 1, 2, 10, 20, 30, 40, 60, 80 };
var rint := RandomInt(validcolors.size())+1;
var color := validcolors[rint];
robe.color := color;
return 1;
endprogramCode: Select all
use util;
program walkon_ChromoTile(who, tile)
/** All valid colors here separated by commas. */
var validcolors := { 1, 2, 10, 20, 30, 40, 60, 80 };
var rint := RandomInt(validcolors.size())+1;
var color := validcolors[rint];
tile.color := color;
return 1;
endprogramCode: Select all
Item 0xff05
{
Name chromotile
Desc Chromo Tile
WalkOnScript ChangeColorTile
Graphic 6173
Color 1197
Script WalkOnScript
Movable 1
}The "Script" property refers to the double-click script. The "WalkOnScript" is a script that fires when you walk across the object.
It looks to me like you trued to reference "Script" to the value "WalkOnScript". Is this bad? No. It just means that you'll get an errorlog on the server every time someone doubleclicks the object, saying that there isn't a script named 'WalkOnScript'. You can probably get away with simply deleting that from the file altogether.
A good bit of advice: always include the package name in your itemdesc script references. This way, you're removing any kind of obscurity.
So, for "WalkOnScript", set the value to ":"+Package Name+":ChangeColorTile"
And for the script I posted, name it "ChangeColorTile.src". Compile it, and fire up your server to test it.
arrgghh.. this keeps stuffing up, maybe if i post what i have you can tell me if i had put an error somewhere
.src file:
---------------
use util;
program walkon_ChromoTile(who, tile)
/** All valid colors here separated by commas. */
var validcolors := { 1191, 52, 1936, 1939, 1909, 1192, 60, 1193, 1967, 62, 30, 1194, 1187, 1192, 1966, 1975, 1186 };
var rint := RandomInt(validcolors.size())+1;
var color := validcolors[rint];
tile.color := color;
return 1;
endprogram
------------------------------------------------------------
.cfg file:
---------------
Item 0xff05
{
Name chromotile
Desc Chromo Tile
WalkOnScript ChromorTile:ChangeColorTile
graphic 6173
color 1197
script WalkOnScript
movable 1
}
------------------------------------------------------------
.src file:
---------------
use util;
program walkon_ChromoTile(who, tile)
/** All valid colors here separated by commas. */
var validcolors := { 1191, 52, 1936, 1939, 1909, 1192, 60, 1193, 1967, 62, 30, 1194, 1187, 1192, 1966, 1975, 1186 };
var rint := RandomInt(validcolors.size())+1;
var color := validcolors[rint];
tile.color := color;
return 1;
endprogram
------------------------------------------------------------
.cfg file:
---------------
Item 0xff05
{
Name chromotile
Desc Chromo Tile
WalkOnScript ChromorTile:ChangeColorTile
graphic 6173
color 1197
script WalkOnScript
movable 1
}
------------------------------------------------------------
Code: Select all
Item 0xff05
{
Name chromotile
Desc Chromo Tile
WalkOnScript :ChromorTile:ChangeColorTile
graphic 6173
color 1197
script WalkOnScript
movable 1
}