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 01-17-2005, 10:16 AM
Aethorpe Aethorpe is offline
Their black hands protect
Aethorpe's Avatar
Join Date: Dec 2004
Location: Beyond infinite.
Posts: 265
Aethorpe is on a distinguished road
Send a message via AIM to Aethorpe Send a message via MSN to Aethorpe
Showimg is a pain in the...

I am trying to use an NPC with a list of showimg to display all the images for each level, rather that just setting the NPC image and making alot of useless empty NPCs, and I can't get it to work if I set the x,y. I did, however, manage to get it to work if I set the NPC at the first image location and do showimg at x,y and then base all the other images off of the coordinates of the first image, like so.

NPC Code:

showimg 1,smokeani.mng,x,y;
showimg 2,smokeani.mng,x + 2,y;
showimg 3,smokeani.mng,x + 1,y - 1;
showimg 4,treetop.png,x -1,y + 23;



But now my problem is, if I walk out of range of the original NPC, all the rest disappear, even some that I would still need to be able to see, is there anyway to make them stay visible regardless of where I am in relation to the NPC containing the scripts?

Any suggestions are welcome, thanks.
__________________
Reply With Quote
  #2  
Old 01-17-2005, 10:19 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Perhaps your drawing layer was off, so the coordinates were not showing properly? Also, you can't see NPCs in levels you aren't in, unless you are using a gmap.

Could you post your original attempt to display it with set coordinates?
Reply With Quote
  #3  
Old 01-17-2005, 10:24 AM
Aethorpe Aethorpe is offline
Their black hands protect
Aethorpe's Avatar
Join Date: Dec 2004
Location: Beyond infinite.
Posts: 265
Aethorpe is on a distinguished road
Send a message via AIM to Aethorpe Send a message via MSN to Aethorpe
Quote:
Originally Posted by Lance
Perhaps your drawing layer was off, so the coordinates were not showing properly? Also, you can't see NPCs in levels you aren't in, unless you are using a gmap.

Could you post your original attempt to display it with set coordinates?
Well, I am using a gmap, and I never left the level, just walked off the screen from where the NPC was located.

My original attempt was something like this;

NPC Code:

showimg 1,smokeani.mng,48,6;

__________________
Reply With Quote
  #4  
Old 01-17-2005, 10:27 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Aethorpe
Well, I am using a gmap, and I never left the level, just walked off the screen from where the NPC was located.

My original attempt was something like this;

NPC Code:

showimg 1,smokeani.mng,48,6;

Are you in the upper-left-most level of the gmap? That is where that image would be shown.
Reply With Quote
  #5  
Old 01-17-2005, 10:34 AM
Aethorpe Aethorpe is offline
Their black hands protect
Aethorpe's Avatar
Join Date: Dec 2004
Location: Beyond infinite.
Posts: 265
Aethorpe is on a distinguished road
Send a message via AIM to Aethorpe Send a message via MSN to Aethorpe
Quote:
Originally Posted by Lance
Are you in the upper-left-most level of the gmap? That is where that image would be shown.
You mean, upper right? 48 x, 6 y? :o I tried it at 32 32 as well, and I was in the middle of the level, I tried lots of coordinates, it just didn't seem to help. :|

Oh, you mean in the top of the map. :O

Why would it be shown there, and not my current level?
__________________
Reply With Quote
  #6  
Old 01-17-2005, 10:39 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Aethorpe
You mean, upper right? 48 x, 6 y? :o I tried it at 32 32 as well, and I was in the middle of the level, I tried lots of coordinates, it just didn't seem to help. :|
I'm talking about the position of the level in the gmap. When you have a gmap, the coordinates measure from the top-left corner of the top-left level of the gmap. If you were in the top-left level of the gmap, you would have x and y-coordinates between 0 and 60. If you were in the second level along the top of the gmap, you would have x-coordinates between 60 and 120 and y-coordinates between 0 and 60. If you were in the second level down along the left side of the gmap, you would have x-coordinates between 0 and 60, but y-coordinates between 60 and 120.

If you were drawing something at any coordinates between 0 and 60, it would be shown at the top-left level of the gmap.
Reply With Quote
  #7  
Old 01-17-2005, 07:18 PM
Evil_Trunks Evil_Trunks is offline
Evil
Evil_Trunks's Avatar
Join Date: Dec 2004
Posts: 391
Evil_Trunks is on a distinguished road
This is probably a "problem" with the way the NPC server handles showimgs on the GMAP.

Once the information about the actual NPC which is drawing the showimg is no longer being sent to the client, the client stops displaying that NPC's showimgs as well.

This is my guess.
__________________

Reply With Quote
  #8  
Old 01-17-2005, 07:52 PM
Aethorpe Aethorpe is offline
Their black hands protect
Aethorpe's Avatar
Join Date: Dec 2004
Location: Beyond infinite.
Posts: 265
Aethorpe is on a distinguished road
Send a message via AIM to Aethorpe Send a message via MSN to Aethorpe
Quote:
Originally Posted by Evil_Trunks
This is probably a "problem" with the way the NPC server handles showimgs on the GMAP.

Once the information about the actual NPC which is drawing the showimg is no longer being sent to the client, the client stops displaying that NPC's showimgs as well.

This is my guess.
It's all offline though, there is no NPC server to do that, although the client itself could be doing that, but is there a way around it?
__________________
Reply With Quote
  #9  
Old 01-17-2005, 10:15 PM
xManiamaNx xManiamaNx is offline
Supreme Dictator
xManiamaNx's Avatar
Join Date: Nov 2002
Location: 127.0.0.1
Posts: 385
xManiamaNx is on a distinguished road
Send a message via MSN to xManiamaNx Send a message via Yahoo to xManiamaNx
I've seen this happen before. Have something showimg something, and walk where the actual npc would be off the screen, the showimg will hide if it isn't on layer 4.
__________________
Maniaman

Play Maloria Now: [2.3] [3]
Maloria Website

Reply With Quote
  #10  
Old 01-19-2005, 06:29 PM
Aethorpe Aethorpe is offline
Their black hands protect
Aethorpe's Avatar
Join Date: Dec 2004
Location: Beyond infinite.
Posts: 265
Aethorpe is on a distinguished road
Send a message via AIM to Aethorpe Send a message via MSN to Aethorpe
Quote:
Originally Posted by xManiamaNx
I've seen this happen before. Have something showimg something, and walk where the actual npc would be off the screen, the showimg will hide if it isn't on layer 4.
Yep, that's what it does.

I just wanted to make an update, I found a solution, put all your image showing NPCs on one level of the gmap that isn't visited very often, say out in the water, or on top of a bunch of trees, and do it this way.

NPC Code:
setimg ae_treetop.png;
dontblock;
x = 1107.5; y = 751;



The result is that the NPCs are all plugged away on one universal NPC level instead of spread all over the map in a chaotic messy order, but when you are in the game, they are placed where they need to be, and since you're actually setting the x,y of the NPC where you want the image to be, it fixes the problem with not seeing the images.

Problem solving, orderly, effecient, I hooked a winner.
__________________
Reply With Quote
  #11  
Old 01-19-2005, 08:14 PM
Evil_Trunks Evil_Trunks is offline
Evil
Evil_Trunks's Avatar
Join Date: Dec 2004
Posts: 391
Evil_Trunks is on a distinguished road
why not just put them where they actually go? o.o
__________________

Reply With Quote
  #12  
Old 01-20-2005, 06:47 PM
Aethorpe Aethorpe is offline
Their black hands protect
Aethorpe's Avatar
Join Date: Dec 2004
Location: Beyond infinite.
Posts: 265
Aethorpe is on a distinguished road
Send a message via AIM to Aethorpe Send a message via MSN to Aethorpe
Quote:
Originally Posted by Evil_Trunks
why not just put them where they actually go? o.o
Because I hate having NPCs dragged all over the level, it's messy, causes lag, and a pain in the bum when you have to go back to edit a level.

So, I store them in a univeral location, neatly stacked and oriented on a level specifically for the map NPCs. If I need to edit tiles, I can do so without clutter, if I need to edit NPCs, I can access them all very easily, besides, you can only put NPCs on absolute x,y and most of the time I need them at like x.5,y.3 or something, so putting them where they actually go doesn't help anyways.
__________________
Reply With Quote
  #13  
Old 01-20-2005, 08:09 PM
Evil_Trunks Evil_Trunks is offline
Evil
Evil_Trunks's Avatar
Join Date: Dec 2004
Posts: 391
Evil_Trunks is on a distinguished road
I was just wondering, since it seems like it would get messy if you have a large gmap. You have to open the huge level file with all the NPCs in it, and figure out which one belongs to the level you are changing. I guess comments could fix that....

I'm sure you do this but I had to say it just in case, you should put that stuff in a if (created) block. You would be surprised how many people just make a big list of things and stick them in the NPC with no event. I've seen entire levels of it.
__________________

Reply With Quote
  #14  
Old 01-20-2005, 06:58 PM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Quote:
Originally Posted by Evil_Trunks
why not just put them where they actually go? o.o
Because his way floats his boat.
Reply With Quote
  #15  
Old 01-18-2005, 04:59 AM
Shaun Shaun is offline
Registered User
Shaun's Avatar
Join Date: Jul 2003
Location: Canada
Posts: 1,070
Shaun is a jewel in the roughShaun is a jewel in the rough
Not sure if this is related, but online, in a GMapped level, NPC scripts are "hidden" for me. I know they are there, because if they were imagged before, they will still block (creating invisible force fields!). If the levels are not GMapped, the NPC scripts are there and normal and good, but once the levels are GMapped, the images "hide". Nobody seems to understand GMaps. I don't seem to understand anything beyond the third grade level.

Help
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 11:53 PM.


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