Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #46  
Old 06-17-2012, 04:14 AM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Quote:
Originally Posted by ff7chocoboknight View Post
Quote #1 don't forget to bold something mash the keyboard until your hand hurts slap on a band-aid and let's bold this part too

just gonna toss in the definition of a word now

aph·ro·dis·i·ac:
A food, drink, or drug that stimulates sexual desire.
A thing that causes excitement.

yup


Quote#2 it's random.
There was this one time that I bolding this part here fell down the stairs. It was painful. That's kind of how I feel when you post. booooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooold Never forget to bold randomly. ever



Learning is hard. Especially when you can only think in large paragraphs and always feel the need to explain yourself (just like Bayne). :U wuuuuuuuuuut


random video



Conclusion
"Most people in this room are playing their cards, Lex Veldhuis is playing poker"


every post needs at least two videos

Why does that quote fit in here? It doesn't, but nobody is going to read my post just like nobody reads your posts.
Ahh.. sorry, I read your post. :X
I suppose all the statements are void... My bad.. @.@;;
Also, bold words can be used to assert statements or ideas, or even ease reading for others. It can also be used to give topic heads, so those who want to skip to the important parts can. You might learn this is technical writing which is very interesting. In case you wanted to know.

Also, I think you should advertise my work more, we could make a good team.
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



Reply With Quote
  #47  
Old 06-17-2012, 04:18 AM
ff7chocoboknight ff7chocoboknight is offline
Skyzer Zolderon
ff7chocoboknight's Avatar
Join Date: Dec 2006
Location: New Hampshire, United States
Posts: 725
ff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of light
Send a message via AIM to ff7chocoboknight Send a message via MSN to ff7chocoboknight
Quote:
Originally Posted by Devil_Lord2 View Post
Also, I think you should advertise my work more, we could make a good team.
I picked that video because it's one of the more laughable ones.
__________________
Reply With Quote
  #48  
Old 06-17-2012, 04:49 AM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Quote:
Originally Posted by ff7chocoboknight View Post
I picked that video because it's one of the more laughable ones.
I thought you liked cows...
You've brought the topic way off topic,
I'm going to stop posting in it.

Also was not my intent..
Don't take my cow.
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



Reply With Quote
  #49  
Old 06-17-2012, 11:49 AM
ff7chocoboknight ff7chocoboknight is offline
Skyzer Zolderon
ff7chocoboknight's Avatar
Join Date: Dec 2006
Location: New Hampshire, United States
Posts: 725
ff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of light
Send a message via AIM to ff7chocoboknight Send a message via MSN to ff7chocoboknight
I grew up in a farm. I hated barnyard animals.
__________________
Reply With Quote
  #50  
Old 06-17-2012, 12:04 PM
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
I'm honestly not sure how much easier I can make this. More verbose perhaps?
  1. As the OP says, give the NPC-server proper rights to the folder where you'll store your levels and the folder where your template levels are stored.


  2. Upload the scripts in the archive attached to the OP, making these changes to the script InstanceManager before hitting "apply":
    • Change the temp path
    • Change the unstick path
    Note: Since it is a SCRIPT, the code for the InstanceManager goes into the NPC's SCRIPT.


  3. Create your instance class (e.g. "quest_instance") from the code in the OP, adjusting it for your situation.


  4. Add your instance type to the script of the InstanceManager, using the commented-out easter map instance type as an example (as stated in OP).


  5. Copy the code in the OP for creating a new instance, adapt it into your code. For example, a door that warps players to a new quest instance:


Congratulations, you're now using instances.


__________________
Reply With Quote
  #51  
Old 06-17-2012, 12:08 PM
ff7chocoboknight ff7chocoboknight is offline
Skyzer Zolderon
ff7chocoboknight's Avatar
Join Date: Dec 2006
Location: New Hampshire, United States
Posts: 725
ff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of light
Send a message via AIM to ff7chocoboknight Send a message via MSN to ff7chocoboknight
Ol' West :D
__________________
Reply With Quote
  #52  
Old 06-17-2012, 09:55 PM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Thank you for taking your time to provide steps, I'll send this to Cujo.
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



Reply With Quote
  #53  
Old 06-17-2012, 11:45 PM
smirt362 smirt362 is offline
Tee Hee
smirt362's Avatar
Join Date: Feb 2005
Location: Texas
Posts: 2,101
smirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant future
Send a message via AIM to smirt362 Send a message via MSN to smirt362
Pretty cool, I wonder if you could do a randomized dungeon sort of thing with it where you have premade level pieces that get stitched together in a random order.
__________________

Don Hertzfeldt <3
Reply With Quote
  #54  
Old 06-17-2012, 11:51 PM
Stephen Stephen is offline
Boom!
Stephen's Avatar
Join Date: May 2004
Location: San Francisco
Posts: 10,410
Stephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud of
Quote:
Originally Posted by smirt362 View Post
Pretty cool, I wonder if you could do a randomized dungeon sort of thing with it where you have premade level pieces that get stitched together in a random order.
Googi would be all over that.
__________________
Reply With Quote
  #55  
Old 06-18-2012, 01:39 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by smirt362 View Post
Pretty cool, I wonder if you could do a randomized dungeon sort of thing with it where you have premade level pieces that get stitched together in a random order.
Maloria has a system like that.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #56  
Old 06-18-2012, 03:43 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
Quote:
Originally Posted by smirt362 View Post
Pretty cool, I wonder if you could do a randomized dungeon sort of thing with it where you have premade level pieces that get stitched together in a random order.
FP4 did that and posted it up here. :]

I think it requires this one to be included somewhere, somehow, someplace.
__________________
Reply With Quote
  #57  
Old 01-13-2013, 06:40 AM
Draenin Draenin is offline
Magnificent Bastard
Draenin's Avatar
Join Date: Dec 2004
Location: Bermuda Triangle
Posts: 6,790
Draenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud of
Send a message via AIM to Draenin Send a message via MSN to Draenin Send a message via Yahoo to Draenin
I am having issues with only one thing so far, and that's the Instance Manager NPC you specified earlier. It doesn't seem to be recognizing the emergency exit commands and whatnot, and I'm not entirely sure what to do about it. RC kicks back the following errors:

Quote:
Originally Posted by RC
Script: Function unknown_object.waitForSetup not found at line 29 in script of InstanceManager (in level onlinestartlocal.nw at pos (30.5, 30))
Script: Function unknown_object.setInstanceID not found at line 31 in script of InstanceManager (in level onlinestartlocal.nw at pos (30.5, 30))
Script: Function unknown_object.setTempPath not found at line 8 in script of InstanceManager (in level onlinestartlocal.nw at pos (30.5, 30))
Script: Function unknown_object.setEmergencyExit not found at line 9 in script of InstanceManager (in level onlinestartlocal.nw at pos (30.5, 30))
And here's what I have entered currently:

PHP Code:
function onInitialized() {
  
this.trigger("created");
}

function 
onCreated() {
  
// basic setup
  
GameInstance newInstanceTemplate("TStaticVar");
  
GameInstance.setTempPath("levels/temp/"); // folder which holds resources
  
GameInstance.setEmergencyExit("main_av-24.nw"3030);
  
  
/*
  // Easter Maps
  EasterMapInstance = newInstanceTemplate("GameInstance");
  
  // you can specify temp folders or exits for each instance,
  // like this:
  EasterMapInstance.setTempPath("levels/eastermaps/");
  
  EasterMapInstance.join("easter2k11_instance_map");*/
}

function 
newInstanceTemplate(parent) {
  
temp.instance = new (@ parent)();
  
  if (! (
"instance" in instance.joinedclasses)) {
    
instance.join("instance");
  }
  
  
instance.waitForSetup();
  
  
instance.setInstanceID("invalid");
  
instance.setup false;
  return 
instance;
}

public function 
registerInstance(instance) {
  
this.instance.(@ instance.getInstanceID()) = instance;
}

public function 
getInstance(id) {
  return 
this.instance.(@ id);


I haven't changed level names or anything yet. It's a fresh install, but I'll be changing them later. Anyway, what would the fix for this be? Everything else seems to be working fine so far. Great work, man.
Reply With Quote
  #58  
Old 01-13-2013, 07:00 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
My guess would be that the instance class isn't being joined to the object. Does it exist, and does it contain the right script? Do those functions work if you join it to some random NPC?
__________________
Reply With Quote
  #59  
Old 01-13-2013, 07:16 AM
Draenin Draenin is offline
Magnificent Bastard
Draenin's Avatar
Join Date: Dec 2004
Location: Bermuda Triangle
Posts: 6,790
Draenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud of
Send a message via AIM to Draenin Send a message via MSN to Draenin Send a message via Yahoo to Draenin
Quote:
Originally Posted by cbk1994 View Post
My guess would be that the instance class isn't being joined to the object. Does it exist, and does it contain the right script? Do those functions work if you join it to some random NPC?
Well, I should explain what I've done so far:

1. Unzipped the files, copy-pasted the scripts in the zip file's 'class' folder to two classes. (instance_main, instance_level)
2. Copy-pasted the script in the zip file's 'npcs' folder to the InstanceManager NPC and added stuff from your first post.
3. Created a third class called instance_control from stuff in your first post.


Haven't attempted to post the first bit of code you posted that creates the instance, but when I copy-paste the code from the InstanceManager text in the zip file into the NPC, I get those errors. The other things seem to be fine.

Is this how it's supposed to be set up? I tried joining a level NPC to the code in each one of those three classes I made, but it still doesn't fix the problem which seems to be coming from the NPC instead.
Reply With Quote
  #60  
Old 01-13-2013, 08: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
Quote:
Originally Posted by Draenin View Post
Well, I should explain what I've done so far:

1. Unzipped the files, copy-pasted the scripts in the zip file's 'class' folder to two classes. (instance_main, instance_level)
2. Copy-pasted the script in the zip file's 'npcs' folder to the InstanceManager NPC and added stuff from your first post.
3. Created a third class called instance_control from stuff in your first post.


Haven't attempted to post the first bit of code you posted that creates the instance, but when I copy-paste the code from the InstanceManager text in the zip file into the NPC, I get those errors. The other things seem to be fine.

Is this how it's supposed to be set up? I tried joining a level NPC to the code in each one of those three classes I made, but it still doesn't fix the problem which seems to be coming from the NPC instead.
"instance_main" probably needs to be just "instance" (just guessing from your naming what you did, but there should be an "instance" class). It's the base instance, not an actual usable instance, so "instance_main" doesn't really make sense. The NPC expects the class to be named just "instance" which is the root of your trouble.

I wrote out these instructions later on (in case you didn't see them):

Quote:
Originally Posted by cbk1994 View Post
  1. As the OP says, give the NPC-server proper rights to the folder where you'll store your levels and the folder where your template levels are stored.


  2. Upload the scripts in the archive attached to the OP, making these changes to the script InstanceManager before hitting "apply":
    • Change the temp path
    • Change the unstick path
    Note: Since it is a SCRIPT, the code for the InstanceManager goes into the NPC's SCRIPT.


  3. Create your instance class (e.g. "quest_instance") from the code in the OP, adjusting it for your situation.


  4. Add your instance type to the script of the InstanceManager, using the commented-out easter map instance type as an example (as stated in OP).


  5. Copy the code in the OP for creating a new instance, adapt it into your code. For example, a door that warps players to a new quest instance:


Congratulations, you're now using instances.


__________________
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:10 AM.


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