Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-30-2007, 02:31 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Level Vars in the .nw file!

It would be very nice to be able to set level variables in .nw files without having to use NPCs.

Like here could be an example .nw file (omitted all but one of the BOARD lines to make it shorter):

NPC Code:
GLEVNW01
BOARD 0 0 64 0 J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4 J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4 J4J4J4J4J4J4J4J4J4J4J4J4J4J4
VAR noplayerkilling 1
VAR myentermessage Hi guys!
VAR testarray 6,1,Testing,"Hello Everyone"

NPC - 0 0
function onCreated() echo(level.testarray[3]);
//#CLIENTSIDE
function onPlayerEnters() {
say2(level.myentermessage);
player.chat = level.testarray[2] @ ": " @ level.testarray[0] + level.testarray[1];
}
NPCEND



I put the details that are important in bold.

I'm sure a lot of you could figure out what that all does.

Here is another way you could do it:
NPC Code:
GLEVNW01
BOARD 0 0 64 0 J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4 J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4J4 J4J4J4J4J4J4J4J4J4J4J4J4J4J4
VARS
noplayerkilling=1
myentermessage=Hi guys!
testarray=6,1,Testing,"Hello Everyone"
VARSEND

NPC - 0 0
function onCreated() echo(level.testarray[3]);
//#CLIENTSIDE
function onPlayerEnters() {
say2(level.myentermessage);
player.chat = level.testarray[2] @ ": " @ level.testarray[0] + level.testarray[1];
}
NPCEND



I put the details that are important in bold.

Anyways: These would both set clientside and serverside variables when the level is updated (uploaded, server restart or "update level" is done). Of course, once they are set they are still independent (changing the clientside var won't effect the serverside with the exception of already shared vars).

I guess if you want you could maybe use:
VARCLIENT
VARSERVER
VARSCLIENT
VARSCLIENTEND
VARSSERVER
VARSSERVEREND

What do you all think?

EDIT: I dunno why it put spaces in the BOARD but just ignore that as it isn't important.
__________________
Do it with a DON!
Reply With Quote
  #2  
Old 06-30-2007, 02:51 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
That is an idea I would love to see in game..
Protected level variables :O
__________________
Reply With Quote
  #3  
Old 06-30-2007, 04:10 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Meh want! Dang thats a nice idea! Though there should be something added in the editor so you can edit those easily
Reply With Quote
  #4  
Old 06-30-2007, 04:31 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
I prefer the way with VARS and VARSEND its a more familiar format.
__________________
Reply With Quote
  #5  
Old 07-01-2007, 04:40 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Inverness View Post
I prefer the way with VARS and VARSEND its a more familiar format.
They are both familier. One is like LEVELS and LEVELSEND while the other is like BOARD.

Either way one of them should be added (I really don't care which nor does it matter except maybe the VARS and VARSEND way would be easier to save using savevarstoarray(); for an online editor or so.)
__________________
Do it with a DON!
Reply With Quote
  #6  
Old 07-01-2007, 06:50 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
I was suggesting VARS and VARSEND because its more like when you're using text files for variable saving.
__________________
Reply With Quote
  #7  
Old 07-01-2007, 09:46 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Inverness View Post
I was suggesting VARS and VARSEND because its more like when you're using text files for variable saving.
This is true (as I stated in my last post).

The main reason why I want this is because this would load the level. variables with the board data when the player enters a level thus avoiding the ever exploitable npc load lag glitch. And this would completely remove the need to have an NPC for such (also don't have to worry about your npc accidentally being deleted).

The only reason why I used a NPC in my example is because I really didn't want to have to give more then two code boxes...it would only add more confusion. I'm sure you all can understand what I mean by this now? Along with the use?
__________________
Do it with a DON!
Reply With Quote
  #8  
Old 07-06-2007, 09:21 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Knock knock!
__________________
Do it with a DON!
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 08:02 PM.


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