Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-26-2009, 08:11 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
triggeraction problem on gmaps

I'm trying to trigger an NPC on a gmap, but unless I am in the same 64x64 level as the NPC, it won't receive the trigger.
For example, If my character is at (20,20) on a 128x128 tile gmap, and the NPC I am sending a triggeraction to is at (70,20) it will not catch the trigger. However, if I move the NPC to (63,20) it will.

I checked the x,y location of the trigger, and it matches the NPC's x,y on the gmap, so that's not the problem. Even if the NPC is 4 tiles away from me, but we happen to be right at the split between levels, it won't catch the trigger.



I'm using a putnpc2(), so I could possibly just use findNPC( name ) and trigger it that way, but it would make my life a lot easier if triggeraction would work instead.

I'm not quite sure why my location even matters, the NPC is triggering itself.
Reply With Quote
  #2  
Old 03-26-2009, 09:55 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Are the triggeraction's coordinates sent based on the gmap dimensions or level dimensions?
__________________
Reply With Quote
  #3  
Old 03-26-2009, 11:30 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by Chompy View Post
Are the triggeraction's coordinates sent based on the gmap dimensions or level dimensions?
Gmap's
Reply With Quote
  #4  
Old 03-26-2009, 11:42 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by salesman View Post
Gmap's
If the trigger is clientside, it's likely using level coordinates. Not certain about that, though.

Fairly certain this won't work, but you could try finding out what 'name' on clientside equals, and if it's the same as serverside, try

PHP Code:
triggerserver("npc"name"hi"); 
Otherwise, you might try settings an attr on serverside of the NPC name then doing

PHP Code:
triggerserver("npc"this.attr[3], "hi"); 
I'm not certain whether putnpc2's can receive triggers via triggerserver, but they are really just DB NPCs, so I don't see why they couldn't.
__________________
Reply With Quote
  #5  
Old 03-27-2009, 01:56 AM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by cbk1994 View Post
If the trigger is clientside, it's likely using level coordinates. Not certain about that, though.

Fairly certain this won't work, but you could try finding out what 'name' on clientside equals, and if it's the same as serverside, try

PHP Code:
triggerserver("npc"name"hi"); 
Otherwise, you might try settings an attr on serverside of the NPC name then doing

PHP Code:
triggerserver("npc"this.attr[3], "hi"); 
I'm not certain whether putnpc2's can receive triggers via triggerserver, but they are really just DB NPCs, so I don't see why they couldn't.
I've already said that the xy that the trigger is being sent to is based on the gmap (i.e. 70,20 not 6,20). But on top of that, it works when my character is in the same level (no matter where the NPC is) so I know that the xy is right. EDIT: Oh, I see what you were saying...I don't see why that would be the case though, seems pretty silly

I'll try getting the NPC's name and triggering it via a weapon though, and see if that works.

Another thing: would sleepwhennoplayers=true/false have anything to do with it? I tested it but had no luck either.
Reply With Quote
  #6  
Old 03-27-2009, 06:16 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Clientside coordinates are based on the level not the gmap, because on clientside you don't always have the whole gmap loaded.
__________________
Reply With Quote
  #7  
Old 03-27-2009, 09:03 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by Inverness View Post
Clientside coordinates are based on the level not the gmap, because on clientside you don't always have the whole gmap loaded.
Ah, thanks

I solved the problem by storing the NPC's name and using findNPC( name ) and triggering it that way.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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