Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-05-2011, 10:39 PM
Astram Astram is offline
Era iPhone PR
Astram's Avatar
Join Date: Aug 2010
Posts: 324
Astram can only hope to improve
Send a message via AIM to Astram
Generating A Level

Can someone help me create a level out of another level template?
Like something along the lines of
PHP Code:
createlevel("templatelevel","newlevelname"); 
Please help
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


Reply With Quote
  #2  
Old 05-05-2011, 10:42 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
serverside copylevel(level,newlevel);
Reply With Quote
  #3  
Old 05-06-2011, 04:00 AM
Astram Astram is offline
Era iPhone PR
Astram's Avatar
Join Date: Aug 2010
Posts: 324
Astram can only hope to improve
Send a message via AIM to Astram
Quote:
Originally Posted by DustyPorViva View Post
serverside copylevel(level,newlevel);
Then why doesnt this work?
PHP Code:
function onActionServerSide()
  {
    if (
params[0] == "makehouse")
    {
    
clientr.phouse2 1;
    
copylevel("toad-level1.nw","house1_"@params[1]@"_outside.nw");
    }
  }
//#CLIENTSIDE
function onCreated()
  {
  if (
clientr.phouse2 == NULL)
    {
    
triggerserver("gui",this.name,"makehouse",player.account);
    }
  } 
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


Reply With Quote
  #4  
Old 05-06-2011, 04:04 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
Make sure the NPC-server has proper rights, and specify the destination path.

Quote:
Originally Posted by scripthelp
Script help for 'copylevel':
copylevel(str, str) - parameters are the source level filename and the destination filename; the destination is relative to the levels/ folder
Also, never accept the player's account as a parameter from a trigger. You can access it directly on serverside.
__________________
Reply With Quote
  #5  
Old 05-06-2011, 09:58 PM
Astram Astram is offline
Era iPhone PR
Astram's Avatar
Join Date: Aug 2010
Posts: 324
Astram can only hope to improve
Send a message via AIM to Astram
Quote:
Originally Posted by cbk1994 View Post
Make sure the NPC-server has proper rights, and specify the destination path.



Also, never accept the player's account as a parameter from a trigger. You can access it directly on serverside.
Sorry, Im new to scripting. Can you give me an example?
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


Reply With Quote
  #6  
Old 05-06-2011, 10:11 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
Quote:
Originally Posted by Astram View Post
Sorry, Im new to scripting. Can you give me an example?
PHP Code:
function onActionServerSide(temp.cmd) {
  if (
temp.cmd == "createHouse") {
    if (
player.clientr.phouse2 == null) {
      
copyLevel("toad-level1.nw""world/phouse/house_" player.account ".nw");
      
// no "levels/" in the path
    
}
  }
}

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "create house") {
    
triggerServer("gui"this.name"createHouse");
  }

and then give the NPC-server the rights

Quote:
rw levels/world/phouse/house_*.nw
Haven't tested but it should work.
__________________
Reply With Quote
  #7  
Old 05-06-2011, 11:12 PM
Astram Astram is offline
Era iPhone PR
Astram's Avatar
Join Date: Aug 2010
Posts: 324
Astram can only hope to improve
Send a message via AIM to Astram
That doesnt work...
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


Reply With Quote
  #8  
Old 05-06-2011, 11:14 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
Quote:
Originally Posted by Astram View Post
That doesnt work...
If you actually care about getting this script to work you're going to have to provide more information than that.
__________________
Reply With Quote
  #9  
Old 05-06-2011, 11:36 PM
Astram Astram is offline
Era iPhone PR
Astram's Avatar
Join Date: Aug 2010
Posts: 324
Astram can only hope to improve
Send a message via AIM to Astram
Didnt Work

Quote:
Originally Posted by cbk1994 View Post
If you actually care about getting this script to
work you're going to have to provide more information than that.
Well I added the NPC Server the rights. But nothing happened. And I made the folder rights
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


Reply With Quote
  #10  
Old 05-06-2011, 11:47 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
Quote:
Originally Posted by Astram View Post
Well I added the NPC Server the rights. But nothing happened. And I made the folder rights
Did you add the weapon to yourself? What did you say to use it? Did your player have player.clientr.phouse2 already set? Did you try adding echoes on serverside?
__________________
Reply With Quote
  #11  
Old 05-07-2011, 12:19 AM
Astram Astram is offline
Era iPhone PR
Astram's Avatar
Join Date: Aug 2010
Posts: 324
Astram can only hope to improve
Send a message via AIM to Astram
Its an onCreated() event.
I changed the clientr. variable name.
I have the weapon.
And no I didnt add Echos
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


Reply With Quote
  #12  
Old 05-07-2011, 06:40 AM
Astram Astram is offline
Era iPhone PR
Astram's Avatar
Join Date: Aug 2010
Posts: 324
Astram can only hope to improve
Send a message via AIM to Astram
I got it... Appearently, like my other scripts. It starts working randomly...
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


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 04:48 PM.


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