Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Showing level lines (https://forums.graalonline.com/forums/showthread.php?t=134264694)

Emera 10-02-2011 06:23 PM

Showing level lines
 
I was wondering, how would I make a script determine what level I am in, detect the outline of the level and show them using lines? Like FowlPlay4's OLNE. If anybody can help me out with this, it would be great!

fowlplay4 10-02-2011 06:28 PM

You could just draw 64 horizontal lines, and 64 vertical lines to 'outline' it.

I.e:

PHP Code:

//#CLIENTSIDE
function onCreated() {
  for (
temp.0temp.64temp.x++) {
    
with (findimg(200 temp.x)) {
      
polygon = {
        
temp.x0temp.x64
      
};
    }
  }
  for (
temp.0temp.64temp.y++) {
    
with (findimg(300 temp.y)) {
      
polygon = {
        
0temp.y64temp.y
      
};
    }
  }


You'll have to tweak for GMAPs though by calculating the top-left position. You can see how I do it in my OLNE code.

Emera 10-02-2011 06:30 PM

Quote:

Originally Posted by fowlplay4 (Post 1669777)
You could just draw 64 horizontal lines, and 64 vertical lines to 'outline' it.

I.e:

PHP Code:

//#CLIENTSIDE
function onCreated() {
  for (
temp.0temp.64temp.x++) {
    
with (findimg(200 temp.x)) {
      
polygon = {
        
temp.x0temp.x64
      
};
    }
  }
  for (
temp.0temp.64temp.y++) {
    
with (findimg(300 temp.y)) {
      
polygon = {
        
0temp.y64temp.y
      
};
    }
  }


You'll have to tweak for GMAPs though by calculating the top-left position. You can see how I do it in my OLNE code.

I just found through echoing that the level width is 640 x 640 (64 X 64)
I have been studying your code for neatly 2 hours and I seem to be getting nowhere.

Crow 10-02-2011 09:27 PM

A level is 64 times 64 tiles in size. Just show a horizontal and a vertical line every 64 tiles. Done.

Emera 10-02-2011 09:31 PM

Quote:

Originally Posted by Crow (Post 1669795)
A level is 64 times 64 tiles in size. Just show a horizontal and a vertical line every 64 tiles. Done.

Finished. Thanks guys.


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

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