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
  #16  
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
  #17  
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
  #18  
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
  #19  
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
  #20  
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
  #21  
Old 01-21-2005, 09:14 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 Evil_Trunks
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.
I don't use if (created) because to me it seems redundant, by default, if the NPC exists, it was created. Unless I am complete wrong about that, if I am, I would love to hear about it, but as of now, the only time I stated created, is when it is nessesary to be in combination and not just simply automatically done.
__________________
Reply With Quote
  #22  
Old 01-21-2005, 09:41 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
I don't use if (created) because to me it seems redundant, by default, if the NPC exists, it was created. Unless I am complete wrong about that, if I am, I would love to hear about it, but as of now, the only time I stated created, is when it is nessesary to be in combination and not just simply automatically done.
Consider yourself corrected. It's not redundant. Also, read KSI-GS. You'll learn a lot.
Reply With Quote
  #23  
Old 01-22-2005, 11:17 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
Consider yourself corrected. It's not redundant. Also, read KSI-GS. You'll learn a lot.
I read the KSI GS like you said, makes sense, but 95% of it was already stuff I knew and followed, and the other 5% I will probably pick up on now,, however...

Quote:
Rule One

Never include code that is not part of an event block. Think about when you want your code to execute, and place it in a corresponding event block.
There was no reason given why this was wrong, and if I want to it execute immediately and regardless of everything else, then why bother?
__________________
Reply With Quote
  #24  
Old 01-22-2005, 11:29 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Aethorpe
There was no reason given why this was wrong, and if I want to it execute immediately and regardless of everything else, then why bother?
There is no "immediately". Scripts are processed in response to events. If the code is outside of an event block, it will be executed every time an event is triggered. So:
  1. Putting it in an event block makes the code clearer. It unequivocally states what the script is meant to do, instead of letting its execution depend on external factors. This means that:
    1. The code is futureproof - modifications to Graal's behaviour will not likely break it, and it conforms roughly to GS2's event model.
    2. Other scripters will know what you're doing, and be able to tell that you're not simply misunderstanding the nature of GScript.
  2. Assuming your NPC doesn't just do one thing and then destroy itself, you don't want its code to be executed randomly in response to external events. At best, it's just wasteful. At worst it's destructive.
__________________
Reply With Quote
  #25  
Old 01-22-2005, 06:42 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 Kaimetsu
There is no "immediately". Scripts are processed in response to events. If the code is outside of an event block, it will be executed every time an event is triggered. So:
  1. Putting it in an event block makes the code clearer. It unequivocally states what the script is meant to do, instead of letting its execution depend on external factors. This means that:
    1. The code is futureproof - modifications to Graal's behaviour will not likely break it, and it conforms roughly to GS2's event model.
    2. Other scripters will know what you're doing, and be able to tell that you're not simply misunderstanding the nature of GScript.
  2. Assuming your NPC doesn't just do one thing and then destroy itself, you don't want its code to be executed randomly in response to external events. At best, it's just wasteful. At worst it's destructive.
Ahh, ok. Thank you Kai.
__________________
Reply With Quote
  #26  
Old 01-26-2005, 06:20 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
How would one show images above the gamescreen, like, an image that stays on the screen in the same spot, like the GUI? :x
__________________
Reply With Quote
  #27  
Old 01-26-2005, 06:32 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
changeimgvis
__________________
Reply With Quote
  #28  
Old 01-26-2005, 06:33 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 Kaimetsu
changeimgvis

Ok thanks again Kai.
__________________
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 10:31 PM.


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