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 12-03-2012, 02:45 AM
greggiles greggiles is offline
Registered User
greggiles's Avatar
Join Date: Sep 2007
Posts: 149
greggiles has a spectacular aura about
Default map loadout

Default map is set up so when on a gmap, it shows where you have been. the rest is black.

How do I make it load out the whole map even with parts un-explored?

Is this a server-ops problem?
Reply With Quote
  #2  
Old 12-03-2012, 03:10 AM
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
afaik it's not possible without pre-rendering the entire map yourself (using something like NW2PNG) and a custom map script.
__________________
Reply With Quote
  #3  
Old 12-03-2012, 04:46 AM
greggiles greggiles is offline
Registered User
greggiles's Avatar
Join Date: Sep 2007
Posts: 149
greggiles has a spectacular aura about
Quote:
afaik it's not possible without pre-rendering the entire map yourself (using something like NW2PNG) and a custom map script.
Hmmm. okay. Well I'm going to make a weapon that draws a .png map, but I'm not sure how I'm and going to tell the client where the player is on the map.
Any suggestions?

Perhaps do a check on the players level so it will highlight the area the player is in.
example: Do a check if the player is in map_a1|_a2|_b1|_b2 and then the map will highlight that area.
Not sure how I would make it pin-point on player's location.
Reply With Quote
  #4  
Old 12-03-2012, 05:15 AM
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
player.x and player.y on clientside refer to the player's position relative to the top-left of the map (not just the top-left of the current level). You can get the map width and height (in tiles) with player.gmap.width and player.gmap.height (again, clientside).

Divide the player's current x by the gmap width and you'll get a decimal representing their location on the map. If they're in the middle of the map, it'll be 0.5 for both.

When you display the player's head on a map, you can use basic math to figure out where to show it:

PHP Code:
// calculate head position on the map image
playerHeadX = ((player.player.gmap.width) * WIDTH_OF_MAP_IMAGE) - (WIDTH_OF_HEAD_IMAGE 2);
playerHeadY = ((player.player.gmap.height) * HEIGHT_OF_MAP_IMAGE) - (HEIGHT_OF_HEAD_IMAGE 2); 
Does that make sense?

There are some examples of maps in the Code Gallery you can look at as well. This one by Dusty is a few years old but replicates the default map with extra features (like being able to show a pre-rendered image). I can tell just by looking at it that some parts of it aren't done in the best way (sorry Dusty, I love you), but you can at least get an idea of the general method.
__________________
Reply With Quote
  #5  
Old 12-03-2012, 05:32 AM
greggiles greggiles is offline
Registered User
greggiles's Avatar
Join Date: Sep 2007
Posts: 149
greggiles has a spectacular aura about
Quote:
Does that make sense?
Yes, this does make sense.

Simple math can take you a long way
Reply With Quote
  #6  
Old 12-03-2012, 11:51 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
You can render the whole map if you press "M" in the offline Level Editor.. while you are editing if you have already entered the level that sets the map up.. (so you see other levels and see whole map while editing).. quality is less then a NW2PNG tho

Last edited by scriptless; 12-04-2012 at 12:07 AM..
Reply With Quote
  #7  
Old 12-04-2012, 02:24 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
Quote:
Originally Posted by cbk1994 View Post
(sorry Dusty, I love you)
No problem, 4 year ago is a long time and even I can tell my scripting has improved since then.
Reply With Quote
  #8  
Old 10-20-2014, 10:35 PM
Stowen Stowen is offline
Graalian since '01
Join Date: Sep 2005
Location: Massachusets, USA
Posts: 156
Stowen will become famous soon enough
Send a message via AIM to Stowen Send a message via MSN to Stowen
Not sure if many of you know this, but in offline editor if you load a gmap with loadmap mapname; you can render a detailed map image by pressing Ctrl + M.
__________________
Quote:
Originally Posted by Felix_Xenophobe View Post
He is no carpenter's son but Stowen will breathe life into pc graal.
Unholy Nation is my home.
Reply With Quote
  #9  
Old 10-21-2014, 04:54 AM
Jakov_the_Jakovasaur Jakov_the_Jakovasaur is offline
Deleted by Darlene159
Jakov_the_Jakovasaur's Avatar
Join Date: Sep 2013
Location: Deleted by Darlene159
Posts: 360
Jakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud of
Quote:
Originally Posted by Stowen View Post
Not sure if many of you know this, but in offline editor if you load a gmap with loadmap mapname; you can render a detailed map image by pressing Ctrl + M.
you can do it without pressing ctrl
__________________
This signature has been deleted by Darlene159.
Reply With Quote
  #10  
Old 10-22-2014, 12:22 AM
Stowen Stowen is offline
Graalian since '01
Join Date: Sep 2005
Location: Massachusets, USA
Posts: 156
Stowen will become famous soon enough
Send a message via AIM to Stowen Send a message via MSN to Stowen
Quote:
Originally Posted by Jakov_the_Jakovasaur View Post
you can do it without pressing ctrl
Actually, you can't. When you are in editor mode (not "Play" mode), press Ctrl + M, and it will begin creating a full-sized map image (in .PNG format too, SCORE) for you. It reads each level of the currently loaded gmap, (setmap mapName and fully renders it into a detailed image that can be used with custom map systems.
__________________
Quote:
Originally Posted by Felix_Xenophobe View Post
He is no carpenter's son but Stowen will breathe life into pc graal.
Unholy Nation is my home.
Reply With Quote
  #11  
Old 10-22-2014, 01:07 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Stowen View Post
Actually, you can't. When you are in editor mode (not "Play" mode), press Ctrl + M, and it will begin creating a full-sized map image (in .PNG format too, SCORE) for you. It reads each level of the currently loaded gmap, (setmap mapName and fully renders it into a detailed image that can be used with custom map systems.
u might want to check again champ
__________________
Quote:
Reply With Quote
  #12  
Old 10-22-2014, 05:03 AM
Jakov_the_Jakovasaur Jakov_the_Jakovasaur is offline
Deleted by Darlene159
Jakov_the_Jakovasaur's Avatar
Join Date: Sep 2013
Location: Deleted by Darlene159
Posts: 360
Jakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud of
Quote:
Originally Posted by Stowen View Post
Actually, you can't. When you are in editor mode (not "Play" mode), press Ctrl + M, and it will begin creating a full-sized map image (in .PNG format too, SCORE) for you. It reads each level of the currently loaded gmap, (setmap mapName and fully renders it into a detailed image that can be used with custom map systems.
Quote:
Originally Posted by fowlplay4 View Post
u might want to check again champ
yeah champ you might want to check again!
__________________
This signature has been deleted by Darlene159.
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:12 AM.


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