|
 |
 |
| Author |
Message |
Poi
Joined: 14 Apr 2006 Posts: 240
|
Posted: Sun Apr 16, 2006 9:15 pm Post subject: |
|
|
Exactly how do you recomple a script, i ecompiled, restarted the server
Haha nevermind i got it, i just cant the the script to print the text :/
My point.src(new script:
| Code: | use os;
use uo;
program textcmd_point( who, text )
var what := Target( who );
if (what)
PrintTextAbove( what, "*", who.name,"points here*" );
PrintTextAbove( who, "*", who.name, "points at that spot*" );
endif
endprogram |
|
|
 |
|
|
 |
 |
|
 |
 |
|
 |
 |
| Author |
Message |
DevGIB
Joined: 06 Feb 2006 Posts: 93
|
Posted: Mon Apr 17, 2006 12:38 pm Post subject: |
|
|
oh right i see the problem...
REF: UO.EM
| Code: |
PrintTextAbove( above_object, text, font := _DEFAULT_TEXT_FONT, color := _DEFAULT_TEXT_COLOR );
PrintTextAbovePrivate( above_object, text, character, font := _DEFAULT_TEXT_FONT, color := _DEFAULT_TEXT_COLOR ); |
youve used printtextabove but with the printtextaboveprivate params change it to say
| Code: |
PrintTextAbove( what, "*"+who.name+"points here*" );
PrintTextAbove( who, "*"+ who.name+ "points at that spot*" ); |
you may also want to add spaces between the beginning of the second text and the word points so rather than saying *joepoints here* it will say *joe points here*...
p.s. + are used to attach to trings not , so thats why you were having trouble |
|
 |
|
|
 |
 |
| Author |
Message |
Poi
Joined: 14 Apr 2006 Posts: 240
|
Posted: Mon Apr 17, 2006 5:16 pm Post subject: |
|
|
Thanks your the best!
Just wondering though, it works, but you can only point at actual items or players, is there a way to make(i know there is) it so you can point anywhere?
Heres my new code, it will not ecompile, is there an error?
| Code: | use os;
use uo;
program textcmd_point( who )
var what := Target( who );
if (what)
PrintTextAbove( what, "*"+who.name+" points here*", font := _DEFAULT_TEXT_FONT, color := 0x33 );
PrintTextAbove( who, "*"+who.name+ " points at "+what.name+"*", font := _DEFAULT_TEXT_FONT, color := 0x33 );
PerformAction( who, ACTION_SALUTE );
endif
endprogram |
|
|
 |
|
|
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
| Author |
Message |
Yukiko
Joined: 02 Feb 2006 Posts: 1094 Location: Southern Central USA
|
Posted: Tue Apr 18, 2006 2:27 am Post subject: |
|
|
PrintTextAbove is looking for an object reference and your "what" is a structure containing coordinates. So first create something invisible at the targetted coordinates using something like this:
| Code: |
use os;
use uo;
program textcmd_point( who )
var what := TargetCoordinates( who );
if (what)
junkitemm := CreateItemAtLocation( what.x, what.y, what.z, <objtype of an invisible item>, 1 )
PrintTextAbove( junkitem, "*"+who.name+" points here*", _DEFAULT_TEXT_FONT, 0x33 );
DestroyItem(junkitem);
PrintTextAbove( who, "*"+who.name+ " points at "+what.name+"*", _DEFAULT_TEXT_FONT, 0x33 );
PerformAction( who, SALUTE );
endif
endprogram
|
Please note I don't know any invisible objtype to insert in that createitem function call so maybe someone else can suggest something. Perhaps a rescob would do. |
|
 |
|
|
 |
 |
| Author |
Message |
Poi
Joined: 14 Apr 2006 Posts: 240
|
Posted: Tue Apr 18, 2006 5:12 pm Post subject: |
|
|
Ok i did that, created (my own) invisible object, and placed the code in there, it still doesn ecompile
Error:
Error compiling statement at E:\pol\scripts\point.src, Line 8
Error in IF statement starting at File: E:\pol\scripts\point.src, Line 7
Error compiling statement at E:\pol\scripts\point.src, Line 7
Error detected in program body.
Error occurred at E:\pol\scripts\point.src, Line 8
Execution aborted due to: Error compiling file
Scipt:
| Code: | use os;
use uo;
program textcmd_point( who )
var what := TargetCoordinates( who );
if (what)
junkitem := CreateItemAtLocation( what.x, what.y, what.z, 0x709s, 1 )
PrintTextAbove( junkitem, "*"+who.name+" points here*", _DEFAULT_TEXT_FONT, 0x33 );
DestroyItem(junkitem);
PrintTextAbove( who, "*"+who.name+ " points at "+what.name+"*", _DEFAULT_TEXT_FONT, 0x33 );
PerformAction( who, SALUTE );
endif
endprogram |
Last edited by Poi on Tue Apr 18, 2006 5:43 pm; edited 1 time in total |
|
 |
|
|
|