Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   defining player position online (https://forums.graalonline.com/forums/showthread.php?t=56084)

Salaisuus 11-19-2004 09:12 PM

defining player position online
 
if (actionleftmouse && playerx=30) {plah plah}

works ofline but when online it doesnt seem to care about the playerx.
Why is that, and is there another way?

Admins 11-19-2004 09:19 PM

You are sure that the player is on that position? You could print out the position to verify (message #v(playerx)). Or do you actually want to access the position of the npc (x) ?

protagonist 11-19-2004 10:56 PM

Quote:

Originally Posted by Salaisuus
if (actionleftmouse && playerx=30) {plah plah}

works ofline but when online it doesnt seem to care about the playerx.
Why is that, and is there another way?


That's clientside, right?

falco10291029 11-19-2004 11:59 PM

Change the = to == (usually won't fix, but it's good to do), make sure it's clientsided, and make sure all of the commands and flags are valid.

Ajira 11-20-2004 12:13 AM

I'm pretty sure it doesn't need to be clientside.

Slash-P2P 11-20-2004 12:24 AM

//#CLIENTSIDE
if (actionleftmouse && int(playerx)==30) {
plah plah
}

You can get an integer of the playerx to make the position stuff less strict. That might solve your problem.

Salaisuus 11-20-2004 02:06 AM

if (actionleftmouse && int(playerx)=<30) {
playerdir=0; unfreezeplayer; setani idle,; setlevel2 effthis.nw,38,61;
}

I did this and it when clientside, it only sets gani.
serverside it works just fine except when on gmap.
In gmap its weird because sometimes it randomly works, mostly not.

I've had other proplems with x's and y's on gmap,
if (mousex=>41 && mousey=>43 && mousex=<44 && mousey=<46)
{showtext 1,1,400,,,plaaplaa;}

Npc like that only works if its on the first level (upper left corner) of gmap and not on others. And to make it work on other I'd have to put it on the first level and use x & y vallues like 125 or so.

Someone tell me how to use npcs on gmaps x_x

Kaimetsu 11-20-2004 02:16 AM

GMaps are just like huge levels. (30,30) only refers to one point on the whole thing, not one per level.

Salaisuus 11-20-2004 02:27 AM

I put two of hese npc on gmap:

if (mousex=>41 && mousey=>43 && mousex=<44 && mousey=<46)
{showtext 1,1,400,,,plaaplaa;}

Only one works.

And the one that works is in the upper left corner (a1) reacts to the x & y as if they where only on that one level.

Kaimetsu 11-20-2004 03:01 AM

No, I would imagine that both are working. They're just not doing what you think they should.

zokemon 11-20-2004 03:09 AM

Wether you use = or == doesn't matter.
And the mouse and keyboard functions ONLY work clientside.

Slash-P2P 11-20-2004 03:27 AM

Quote:

Originally Posted by Salaisuus
And the one that works is in the upper left corner (a1) reacts to the x & y as if they where only on that one level.

Like Kai said, GMAPs act like 1 big level. Meaning, playerx and playery will go over 64.

Use a method of displaying your x (npc, f5) then place the npc where it should go on the map and change the x stuff to that x. Same goes for y if your using it.

Salaisuus 11-20-2004 05:12 PM

But when I press f5 on gmap it shows the level name and the cordinates on that one level.

Salaisuus 11-21-2004 12:34 AM

Quote:

GMaps are just like huge levels. (30,30) only refers to one point on the whole thing, not one per level.
If I have a 9 level gmap and I say warpto 30 30 name.gmap
Where should thsi take me?
Because when I do this it warps me in midle of the upper left corner level.

VeX_RaT_Boy 11-21-2004 02:14 PM

yeah, and if you do 90 30 you will come to the middle of the level right to the first one.


All times are GMT +2. The time now is 05:03 PM.

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