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.

Skyld 11-21-2004 02:18 PM

Quote:

Originally Posted by Salaisuus
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.

It should take you to the top-left level. As Kaimetsu said, a GMAP links the levels together as one. If you warp to (94,94) on name.gmap, it'll take you to (30,30) of the level b2 (if your GMAP level filenames follow that pattern).

ZeroTrack 11-21-2004 04:03 PM

or you could just use the map and ctrl + leftmouseclick that warps you to where ever you click

Slash-P2P 11-21-2004 04:37 PM

Just have an npc define the players position for you.
PHP Code:

if (playerchats && strequals(#c,show position)) {
setplayerprop #c,(#v(playerx),#v(playery));



Salaisuus 11-21-2004 08:41 PM

Well this still doesnt work on gmap and I dont know why.

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

Works fine on normal levels, In gmap it only sets gani and doesnt warp.






:pissed: :pissed: :pissed: :pissed: :pissed: :pissed:

Kaimetsu 11-21-2004 09:31 PM

No clientside setlevel2.

ZeroTrack 11-21-2004 10:42 PM

use triggeraction to serverside for the setlevel2

Salaisuus 11-22-2004 02:05 AM

Quote:

use triggeraction to serverside for the setlevel2
Like this?

if (actionserverenter) {
setlevel2 ihategscripts.nw,30,30;}
//#CLIENTSIDE
if (actionleftmouse && int(playerx)=<30) {
playerdir=0; unfreezeplayer; setani idle,; triggeraction playerx,playery,serverenter,;
}

Because it doesnt work. or did I miss something?

Skyld 11-22-2004 02:29 AM

Is this a level NPC or a weapon?

Salaisuus 11-22-2004 03:13 AM

Level npc. You mouse click it and it warps you to a level.
Or thats what its supposed to do.
I cant understand why it works on normal levels online but not on gmap.

Tolnaftate2004 11-22-2004 03:32 AM

Unless you're on the npc, it won't trigger.

Salaisuus 11-22-2004 03:54 AM

Doesnt trigger eeven if the player is on it. And the way I undertand that script, it should comit the action on the player on the playerx/y.
But Im propaly mistaken.

Tolnaftate2004 11-22-2004 04:05 AM

It triggers to the NPC at (playerx,playery).

Salaisuus 11-22-2004 04:31 AM

Ehhh..? It send the action (warp to a level) to the playerx/y or I dont understand anything.

ZeroTrack 11-22-2004 02:50 PM

Quote:

Originally Posted by Salaisuus
Like this?

if (actionserverenter) {
setlevel2 ihategscripts.nw,30,30;}
//#CLIENTSIDE
if (actionleftmouse && int(playerx)=<30) {
playerdir=0; unfreezeplayer; setani idle,; triggeraction playerx,playery,serverenter,;
}

PHP Code:

if (actionenter) {
  
setlevel2 ihategscripts.nw,30,30;
}
//#CLIENTSIDE
if (actionleftmouse && int(playerx)=<30) {
 
playerdir=0unfreezeplayersetani idle,; triggeraction x+1,y+1,enter,;


the action is supposed to happen to the npc, the way you had it is the only way it could work is if the playerx and playery were the same as the npc's x and y. this way it triggers it inside the npc no matter where the player is
understand now?

--- Edit ---
Oh wow , well ok theres another problem that i encountered while testing it... this is an odd one, but you can't have server as the begining word .... just put enter and actionenter

Tolnaftate2004 11-22-2004 11:56 PM

Quote:

Originally Posted by ZeroTrack
Oh wow , well ok theres another problem that i encountered while testing it... this is an odd one, but you can't have server as the begining word .... just put enter and actionenter

Triggers beginning with server automatically trigger to the Control-NPC (other than serverside). I think.

Salaisuus 11-23-2004 01:16 AM

Thank thee.
It works now. Whee..!

ZeroTrack 11-23-2004 03:01 AM

no problem


All times are GMT +2. The time now is 12:04 AM.

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