Instance Manager
1 Attachment(s)
This is something I originally wrote for Kingdoms iPhone, which has since been used and tested on Graal Kingdoms for the Easter event. It allows you to create clones ("instances") of a level (or set of levels).
Example usage: You have a quest which can be completed by groups of three players. Each group of three players needs their own private set of levels so that other players don't interfere with their quest. This script will clone the levels and take care of changing links, as well as deleting the levels after you're done with them. An example of creating an instance: PHP Code:
Creating a new instance type involves adding the following to the main InstanceManager NPC: PHP Code:
PHP Code:
One thing to note is if you are creating GMAPs, it will add them to gmaps= in server options. There is currently no way to remove them except for manually, so it will crowd server options very fast. There is no negative effect on the server that I am aware of—Kingdoms was running fine with at least 300 maps in gmaps=—but you will want to remove them periodically. If Stefan adds a way to remove them dynamically, I will update this script. It should be able to copy any kind of GMAP (including ones generated with the terrain generator or dungeon generator). Setup To get started, you first need to give (npcserver) rights to a location for files to be stored (be sure they're also in folder config). You can change these rights to suit your preferences: Quote:
Quote:
To add more instances, just modify the Easter example which I left commented out. If you have any questions or if I left anything out just post here and I'll be happy to help :). |
That's really nice ^^ Great job.
|
You're so divine.
|
Good work, definitely will be useful considering where Graal is moving.
|
I'll most likely be using this later on. Thanks!
|
I'm not exactly sure who it was, maybe Ziro...but I recall seeing someone use a method similar to this to create a turn-based battle system. Now that I think about it it was DEFINITELY Ziro...in any event do you think it's necessary to use objects with this? Eventually there will be a lot of objects around at one point or another.
Edit: Although they'll be temporary. Edit 2: In any event great work. |
Quote:
|
Quote:
I see the funtionality possible using objects, I think this should have a broader use though considering the use of objects. |
Quote:
|
I'm not sure why when I type in "Instance System" or "Instance Manager" I can never find this thread.. That or even looking in the Code Gallery which this thread is said to be in...
Anyway, the problem is... well I don't know... Cujo started the process, we have a class called "instance" and a class called "intro_instance_map". a Then inside our NPCs we have InstanceManager. Inside Folderconfig level temp/*.graal level temp/*.nw level temp/*.gmap file temp/*.gmap Inside NPC Server: r levels/0intro/* rw levels/temp/*.nw We both aren't sure what is supposed to happen next, but we do know for the most part that it is not working. This is something we would absolutely love to have for the intro, but he and I cannot seem to figure it out. I just checked today, the whole thing is confusing. The only thing it seemed like I had to do that it did not look like he did was add the rights to the NPC server.. Not sure what type of details are needed.. // class "easter2k11_instance_map" public function prepare() { // choose a random map this.mapLevelName = IntroMapControl.getRandomMapName(); temp.resources = { "levels/0intro/" @ realMapLocation }; function onCreated() { // basic setup GameInstance = newInstanceTemplate("TStaticVar"); GameInstance.setTempPath("levels/temp/"); // folder which holds resources GameInstance.setEmergencyExit("shaded_p09.nw", 30, 30); IntroMapInstance = newInstanceTemplate("GameInstance"); IntroMapInstance.setTempPath("levels/intro0/"); IntroMapInstance.join("intro_instance_map"); } He joined the class in basically all the levels.. It doesn't use a gmap.. I don't know ... Can anyone help? |
Quote:
http://uploads.graalcenter.org/uploa...17.09%20AM.png http://uploads.graalcenter.org/uploa...18.06%20AM.png Quote:
Also see how I created new instances. All of that information is in the OP. |
Quote:
|
3 Attachment(s)
I had no reason to use Google since I knew the instance manager is on this forums, as well as I only type in the name "Instance Manager" and "Instance System" since... well that is the name.
Oddly enough now that I've brought it back, or 'bumped' the post, it shows up, previously, I had to search for your name, view your profile, statistics, and any threads by you. I am well aware how to use a search system. But you are correct, compared to Graal Forums, and Wiki, obviously Google is better organized, and better to use for searching which is why I should have used it. I've had a class both in high school, and college teaching about key words, and searching through a search system. Now, since I'm trying to get help, and not argue, lets just say we have tried again, still not working... Do you, or anyone, mind actually trying to help? It would be better off to leave out statements like "Check wiki".. Sure, not many people may need this system, and step-by-step instructions probably aren't asked for due to this fact, however, we find what you've done to be something that could be useful. Whereas we could work around this and do the old style of putting people in a wait room, we would appreciate it if someone could give instructions instead of hoping we can look at the first post and inside the program to understand. (Point is, not many people might need this, and those that do and don't have any programming experience may not understand any of this since the first post doesn't exactly explain much but what to add...) |
I already explained what you need to do in my previous post. Did you ignore the bottom half? This isn't just a copy-and-paste system, but it's not difficult to use if you read the OP.
|
pretty sure the forum search orders by the most recent post by default, and doesn't order by relevancy unless you tell it to. I'm guessing the keyword "manager" has probably been used a lot since the creation of this thread, which is why you couldn't find it until now.
|
All times are GMT +2. The time now is 01:23 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.