Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-22-2008, 04:50 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Well you can run a loop when the player enters a level like...

PHP Code:
function onPlayerenters() {
  for (
i=0;i<64*64;i++) { // check every tile in the level
    
if (tiles[i%64,int(i/64)] == watertilehex) { // this would have to be edited to check the current level, as on a gmap this would just check the top left corner
      
this.levelcontainswater true// yes, there's water in the level
      
break; // no need to check for more water, right? So let's stop checking!
    
}
  }

The problem with this is the fact that depending on the levels, you could be right next to water, but there will actually be no water in your current level(because of gmaps), so it could end up reading as false. So instead of checking the level, just check the tiles surrounding the player?

An even simpler method would just be using level.vars!
Reply With Quote
 


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 04:44 PM.


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