Graal Forums  

Go Back   Graal Forums > Private forums > Graal4 Forums > Graal V4 Main Forum
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 03-26-2006, 08:20 AM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
GMAP Variables

Would it be possible to allow to make gmap variables?

It is currently possible to create level.variables (Correct?) But what about variables global to the gmap?

Would be nice for Mana Realms since each gmap is a new area and I could have an npc somewhere that sets variables like:
NPC Code:

function onCreated(){
gmap.areaname="Main Town";
gmap.areadescription="This is the main town";
}



This would purely be for convenience.. but would be better (in my opinion) than having to create a database (either on file browse or as DBNpc) to manage this information.

Also, now as I am typing I am pretty sure I tested level.vars out (also local.vars) and they didn't work properly. Are there no longer local to the level variables? Would be good for a day/night system to have something like:
NPC Code:

level.disabledaynight=false;


Could be done with strings (ie: client.disabledaynight=true) but would sometimes cause bugs if player warps out somehow. (ie: using warpto or some type of warping spell) This would also have to cause me to put an npc in all levels connected to the level disabling day/night in order to enable it again.

Just a suggestion, any feedback is welcome (as long as its positive)
  #2  
Old 03-28-2006, 09:33 AM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
I get what you're saying, but it seems like it isn't really vital. There is always the option of grabbing the data on the serverside, or if you're really wanting to handle it all on the client you could have it create client.level.<levelname>.vars during onActionPlayerOnline(). Either way, checking onplayerenters for what to do in that level has been what I've always done in the past. I'm not sure about level.vars anymore, but it's easier to administrate such things via a database NPC anyway.
__________________
Who has time for life these days?
  #3  
Old 03-28-2006, 10:03 AM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
I wouldnt at all say its easier.
It would be much easier to have a single npc that says gmap.var="varvalue";
than to have to set a string on every player. Its cluttered and unorganized.
  #4  
Old 03-28-2006, 11:34 AM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
Quote:
Originally Posted by Warcaptain
I wouldnt at all say its easier.
It would be much easier to have a single npc that says gmap.var="varvalue";
than to have to set a string on every player. Its cluttered and unorganized.
I don't think it would be cluttered or unorganized by any means. Setting a string for every level on each player isn't preferable but it really isn't that bad of a concept. In the string list it would be organized still because they'd all be clientr.level.<lvlname>.var so they'd in a list. My main issue with level and/or gmap vars is that there really isn't a centralized place to read and/or set them, at least with a database NPC you are able to view and edit all of the strings easily.
__________________
Who has time for life these days?
  #5  
Old 03-30-2006, 02:09 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Gmap-wide variables:
On serverside you cannot access the map parts anyway, so level.vars are always gmap-wide.
On clientside the next version will have a new variable 'object.gmap' for accessing the whole map. The 'level.' var is directing to the map part for compatibility reasons.

Synchronization of serverside and clientside: it might be possible to add level.clientr.vars and level.client.vars, sending level attributes from server to client is needed anyway for the new tile layers thingy
  #6  
Old 03-30-2006, 02:15 AM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
So setting a level.variable serverside will set a variable LOCAL to the gmap?

Can this variable be read clientside is all I really need.

ie: a npc anywhere on a gmap that does:
NPC Code:

function onCreated(){
level.areaname="Towny Town";
}



And then can I access it in a CLIENTSIDE script (like a weapon) using:
NPC Code:

function onCreated(){
showtext(200,screenwidth/2,screenheight/2,"System","c",level.areaname);
changeimgvis(200,4);
}



Because this is the most important thing about it.. that it can be read clientside. If level variables work like I imagine they do, I'm sure they can.. because its just like reading a server.variable clientside.. (which I didn't think you could, but I am told you can) only its for the level only.

If not, you will have to explain to me how I can do this.
  #7  
Old 03-30-2006, 09:22 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Would be level.clientr.areaname
  #8  
Old 03-30-2006, 10:22 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Hmm, would level. variables still work the way they already are? I have been using them without problems for awhile, wouldn't be very nice if they were suddenly changed and things I made were broken.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
  #9  
Old 03-30-2006, 10:26 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
You are able to use them simply as level.varname??

Because I have tried that and unfortunately it has not worked.

I tried it with my time system (to disable day/night locally in levels) and it doesnt work.
  #10  
Old 03-30-2006, 10:27 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Warcaptain
You are able to use them simply as level.varname??

Because I have tried that and unfortunately it has not worked.

I tried it with my time system (to disable day/night locally in levels) and it doesnt work.
It works serverside
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
  #11  
Old 03-30-2006, 10:27 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
ah... the variable needs to be set serverside or has to read serverside (or both, of course)
  #12  
Old 03-30-2006, 10:35 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Warcaptain
ah... the variable needs to be set serverside or has to read serverside (or both, of course)
You have to read it in the scope that you set it. ie: if it's set serverside, it has to be read serverside. If it's set clientside, it has to be read clientside. (I just checked this, wasn't sure if the clientside worked or not, never had a need to use it clientside)
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
 


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:46 PM.


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