Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   showpoly? (https://forums.graalonline.com/forums/showthread.php?t=67889)

cbk1994 08-05-2006 07:51 PM

showpoly?
 
I can't figure out what's wrong with this. Graal bible says the syntax is correct, I haven't found anything searching here. Please help :D
PHP Code:

//#CLIENTSIDE
function onCreated() {
setTimer(0.05);
}
function 
onTimeOut() {
temp.array = {player.x,player.y,mousex,mousey};
showpoly(200,temp.array);
changeimgvis(200,1);
setTimer(0.05);


Thanks

xXziroXx 08-05-2006 09:08 PM

Im not sure of the problem either, but, try either of these two.


PHP Code:

//#CLIENTSIDE
function onCreated() {
setTimer(0.05);
}
function 
onTimeOut() {
temp.polyarray = {player.x,player.y,mousex,mousey};
showpoly(200,temp.polyarray);
changeimgvis(200,1);
setTimer(0.05);



Or..


PHP Code:

//#CLIENTSIDE
function onCreated() {
setTimer(0.05);
}
function 
onTimeOut() {
temp.polyarray = {{player.x,player.y,mousex,mousey}};
showpoly(200,temp.polyarray[0]);
changeimgvis(200,1);
setTimer(0.05);



Meh, dunno.

cbk1994 08-05-2006 10:00 PM

I changed it to
PHP Code:

function onActionServerSide() {
if (
params[0] == "test") {
echo(
params);
}
}
//#CLIENTSIDE
function onCreated() {
setTimer(0.05);
}
function 
onTimeOut() {
temp.polyarray = {{player.x,player.y,mousex,mousey}};
triggeraction(0,0,"serverside",name,"test",temp.polyarray[0]);
showpoly(200,temp.polyarray[0]);
changeimgvis(200,1);
setTimer(2);


Which returned in RC:

PHP Code:

test,"21.5,31,22.1875,54.0625" 

Help please?
It looks like the problem is the showpoly.
It's not serverside, is it? Maybe its a problem with V4.1?
But then how does GK do it?

Omini 08-06-2006 01:50 AM

You need 8 parts for showpoly (9 including img id).

PHP Code:

showpoly(4000,{0,0,screenwidth,0,screenwidth,screenheight,0,screenheight}); 

Takes up the whole screen. You need to give an x and y for each seperate corner (top left, top right, bottom left, bottom right).

I think it's something like, if the screen is like this

x1y1...............................x2y2
...........................................
x4y4...............................x3y3


showpoly(ID,{x1,y1,x2,y2,x3,y3,x4,y4});

Tolnaftate2004 08-07-2006 01:07 AM

Quote:

Originally Posted by Omini
You need 8 parts for showpoly (9 including img id).

Don't be silly.

There's no area to fill, so, no poly (a line has no area).


PHP Code:

temp.array = {player.x,player.y,mousex,mousey,mousex,mousey+1/16}; 

fixes the problem.

ForgottenLegacy 08-07-2006 02:30 AM

Probably repeating what someone else said.

Polys with an area of 0 won't show, which makes the showing of lines impossible.

Omini 08-07-2006 09:57 PM

Quote:

Originally Posted by Tolnaftate2004
Don't be silly.

There's no area to fill, so, no poly (a line has no area).


PHP Code:

temp.array = {player.x,player.y,mousex,mousey,mousex,mousey+1/16}; 

fixes the problem.

But he's using showpoly... unless there are 2 methods of using it.

Tolnaftate2004 08-07-2006 10:23 PM

Quote:

Originally Posted by Omini
But he's using showpoly... unless there are 2 methods of using it.

It doesn't always have to be a quadrilateral, though. A polygon can have 3+ sides.

Omini 08-07-2006 10:33 PM

Oh yeah. I just got used to using poly as a 4 point thing. Silly me.

Angel_Light 08-08-2006 12:22 AM

i know a 1 sided polygon :O

calani 08-11-2006 04:36 AM

Yes, Stefan changed the showpoly code (again).
This happened before in v3, and it was fixed on the next release.
Hopefully he reverts the code again, but for now, no 0-volume polies.
In order to make lines, make a box out of the two points, but at +1/8 to the second set. That should solve your problem.

ZeLpH_MyStiK 08-11-2006 05:29 PM

Quote:

Originally Posted by Angel_Light
i know a 1 sided polygon :O

wow...polygon -.-

Angel_Light 08-11-2006 10:50 PM

Quote:

Originally Posted by ZeLpH_MyStiK
wow...polygon -.-

XD I know but I can make it. Maybe it shoiuld be called a unigon?

smirt362 08-11-2006 10:57 PM

It should be called a LINE.

gamer4lifebitach 08-12-2006 12:50 AM

hmm ya, if you need help with it you can pm me.


All times are GMT +2. The time now is 11:55 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.