Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Load GMAP without adding to server options? (https://forums.graalonline.com/forums/showthread.php?t=134262867)

cbk1994 04-18-2011 02:32 AM

Load GMAP without adding to server options?
 
I have a gmap named "mymap.gmap". I have a script which creates temporary copies of it.

For example, it will create one called "mygmap1234.gmap" and copy all of the levels and change the GMAP file contents.

The only way for the server to load the GMAP on serverside (i.e. for the player's level to be "mymap1234.gmap" rather than "mymap1234_a1.nw") is if I use the addgmap function.

Quote:

Originally Posted by scripthelp
addgmap(str) - adds dynamicly a gmap to the options and loads it

The problem is that the GMAP is then also added to server options. This means that after a day there will be several hundred of these temporary GMAPs inside server options.

Is there a way to load a GMAP on the server via script without adding it to server options?

MrOmega 04-18-2011 03:47 AM

Maybe store the gmap data in a file and when it's not active remove it from the options via script (If you can), then when I player needs to use it load the file and add it to the server opts

cbk1994 04-18-2011 03:50 AM

Quote:

Originally Posted by MrOmega (Post 1644041)
remove it from the options via script

This is the only thing I need. I don't know of any way to remove GMAPs from server options.

fowlplay4 04-18-2011 06:27 AM

I had this exact same issue when I expanded Zodiac's Instance Generator to also work with GMAPs.

I think the only elegant solution to this is for Stefan to add a removegmap(gmap); function.

By any chance did you try just calling loadmap on the serverside?

Bump-it

cbk1994 04-18-2011 07:25 AM

Quote:

Originally Posted by fowlplay4 (Post 1644067)
I had this exact same issue when I expanded Zodiac's Instance Generator to also work with GMAPs.

I think the only elegant solution to this is for Stefan to add a removegmap(gmap); function.

By any chance did you try just calling loadmap on the serverside?

Bump-it

Sounds like we're doing the exact same thing.

I tried loadmap, doesn't exist serverside. Updating the level (via sendToRC) didn't work either :(.

Deas_Voice 04-18-2011 09:08 AM

loadmap clientside (in GS2) always seemed to work for me... but i might be wrong.

these gmaps are a big mystery.

cbk1994 04-18-2011 09:12 AM

Quote:

Originally Posted by Deas_Voice (Post 1644085)
loadmap clientside (in GS2) always seemed to work for me... but i might be wrong.

these gmaps are a big mystery.

I need it to load serverside, not clientside. Clientside is not an issue.

Deas_Voice 04-18-2011 09:22 AM

Quote:

Originally Posted by cbk1994 (Post 1644086)
I need it to load serverside, not clientside. Clientside is not an issue.

what's the difference? please enlighten me.

cbk1994 04-18-2011 01:20 PM

Quote:

Originally Posted by Deas_Voice (Post 1644089)
what's the difference? please enlighten me.

The server views it as many different levels rather than one big level (player's level will be like mygmap_a1.nw instead of mygmap.gmap). This is a problem because then I cannot do something like
PHP Code:

for (temp.npc findLevel("mygmap.gmap").npcs) { 


cbk1994 04-20-2011 03:03 AM

Stefan, is it possible at all for the server to load a GMAP without adding it to server options?

cbk1994 12-21-2011 11:39 PM

Bump, need this again.

Spikedude 10-21-2014 09:15 PM

Sorry to revive a dead thread, but I'm assuming this is still unanswered - the Era Instance Manager still adds a crapton of temporary gmaps that we have to clear if we decide to go that route with a gmap. Sorta sucks.

I hear that Delteria and Zod are both using gmaps in their Instance scripts - how are you doing it? Is someone manually deleting the entries from Server Ops every day?

MysticalDragon 10-21-2014 10:10 PM

Era is using delterias instance system by the way. And created gmaps are not added to server options on delteria. Maybe its a login thing.

fowlplay4 10-22-2014 12:15 PM

Quote:

Originally Posted by Spikedude (Post 1732205)
I hear that Delteria and Zod are both using gmaps in their Instance scripts - how are you doing it? Is someone manually deleting the entries from Server Ops every day?

Not actually using gmaps.

cbk1994 10-22-2014 03:28 PM

See this thread:

Quote:

Originally Posted by cbk1994 (Post 1720660)
Oops, forgot to reply to this. You can load GMAPs dynamically now by using findLevel(gmapName) but as far as I know there is still no way to unload them without restarting the server. This does mean you don't need to add GMAPs to the server options to load them, though.

Here's an excerpt from the email from Stefan, I don't think he'll mind me sharing this:
Quote:

This new version should make it easier to add gmaps. Instead of calling addgmap just call findlevel(levelname) to force loading, it will then also automatically load it on the gserver.
When you want to delete the instance then just deletelevel() the gmap and nw files. Right now the gserver is not unloading the gmap, but i will add that sometime (need to make sure that it's not crashing when removing the gmap from memory so I don't want to risk random server crashes).


Spikedude 10-27-2014 01:27 AM

Quote:

Originally Posted by cbk1994 (Post 1732229)
See this thread:

Thank you, Chris! I would up-rep you but it seems I've done so too recently already. I always appreciate the scripting help.


All times are GMT +2. The time now is 07:41 PM.

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