Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Createing Levels (https://forums.graalonline.com/forums/showthread.php?t=134268462)

i8bit 07-12-2013 03:54 PM

Createing Levels
 
I need help making a script to create a level every time a new player logs on.

I have a first log on script that checks if the player has been on before, so I will just add it to that.

I want it to create level with the players account name in it. For example, i8bit logs on, so it creates:
i8bit.nw

devilsknite1 07-12-2013 10:29 PM

Quote:

Originally Posted by Skyld
1. Be clear on your ability level. In other words, do not post asking for scripts, or asking people to fix scripts that are above your ability level. If you are writing a script to aid learning, then try writing a simpler script. If you are looking for a script for a server, then the best solution is probably to hire a scripter.

2. Similarly, do not just post whole scripts for people as a response to their difficulties. If you wish to post a wordy solution, then please feel free; however, please do not post things that people can just copy and paste. It isn't helping people to learn just by doing so. If you'd like to show off your scripts to others, post them in the Code Gallery subforum.

However, you can run it through a DB or something and have it check if the level exists
[levelexists(str) - returns boolean]
and if it doesn't, you could do plenty of things to create an entire level, but the easiest might be to use
[copylevel(str, str) - parameters are the source level filename and the destination filename; the destination is relative to the levels/ folder]
to draw from one level to another. Plenty of ways to do this part though.

callimuc 07-14-2013 09:44 PM

you might want to use escapefilename(player.account) when creating levels using the account/communityname and give it a nicer name for better script detections in the future.. like temp.lvl = "privatelevel_" @ escapefilename(player.account);


All times are GMT +2. The time now is 10:41 AM.

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