Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Creating a level via script? (https://forums.graalonline.com/forums/showthread.php?t=134265265)

iBeatz 12-16-2011 02:19 AM

Creating a level via script?
 
Is there any way of creating a level via GScript without the conventional copylevel() function?
What I mean is creating a level file from scratch akin to the level that the GraalEditor program creates upon startup. I've tried looking for a function for this, but haven't found anything.

The only way I could imagine creating a level from scratch is taking a level file on the server, use the copylevel() function to create another and write the text content of the level file somehow so that it matches the GraalEditor startup level.

Any ideas?

DustyPorViva 12-16-2011 02:23 AM

Have a blank level stored on the server and copylevel() that, or simply write the level manually(levels are stored as text, open a level up in wordpad) and savelines or something like that.

iBeatz 12-16-2011 02:31 AM

Quote:

Originally Posted by DustyPorViva (Post 1678034)
Have a blank level stored on the server and copylevel() that, or simply write the level manually(levels are stored as text, open a level up in wordpad) and savelines or something like that.

I'd rather do it dynamically if possible, ie. without having a blank level stored on the server.
So you're saying loadlines() works for .nw files? I can't exactly check for myself at the minute. If so, I didn't know that, so thanks!
So the method I suggested at first would be the way to go about it then?

DustyPorViva 12-16-2011 02:34 AM

What's so dynamic about that? You'd end up with the same result, a blank level is a blank level. And yes, levels are text so anything you could do to a text file you can do to a level.

iBeatz 12-16-2011 02:36 AM

Quote:

Originally Posted by DustyPorViva (Post 1678036)
What's so dynamic about that? You'd end up with the same result, a blank level is a blank level. And yes, levels are text so anything you could do to a text file you can do to a level.

When I mean dynamic, I mean I just want to make it so that only the script is needed for the process.
Thanks for your help.

Tricxta 12-16-2011 08:19 AM

I think what you're after doesn't exist and has no need to exist. I don't see the problem in having a blank template level apart from the portability aspect...

Fulg0reSama 12-16-2011 08:56 AM

Sorry If I misinterpret, but do you mean that you're looking for something for level generation? like for seperate people? If so then no clue. If not, then ignore what I asked.

cbk1994 12-16-2011 11:44 AM

Not really sure what you're asking for, but if you're trying to create levels on-the-fly and delete them afterwards, this will handle it for you.


All times are GMT +2. The time now is 03:10 PM.

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