Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-17-2005, 07:14 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Non-Prefixed Vars

On Classic, Master Storm uses non-prefixed vars for global temp clientside vars in his movement system. I was making a Guard NPC for a new quest, and testing in Graal v4. However, when I wanted to disable movement and the gani system, something completely screwed up and movement went haywire until I used update level. Still does it. Then I tried an old script I made quite a long time ago that burnt players on a stake, and I had the same problem, just from a different kind of aspect (in the guard NPC I freeze the player temporarily, movement become choppy after; whereas in the stake NPC I freeze the player permanently until the player is released, movement remained frozen). I'm thinking that it may have something to do with non-prefixed var use. I already emailed this to Ibo, and it would be an extra treat if someone would give me variable scopes.
Reply With Quote
  #2  
Old 10-17-2005, 02:40 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
non-prefixed variables using the new engine are global, and can be used by any script that is being executed.

the ones I know are:
this. - variables that are exclusive to the NPC, and continue to remain after execution has finished

temp. - variables that are exclusive to the NPC, but only remain for one execution

and client, clientr, server and serverr.

There are others, but I can't remember them off the top of my head :x
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #3  
Old 10-17-2005, 02:52 PM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
local, level, temp are but a few others.

EDIT:
Hrm -- Second thoughts on local... I think it is... I believe none-prefix vars are treated as level.var?

Now with GS2, you have a lot more. Any weapon is a prefix: GUI.on = true; as well as findnpc("NPC-Server").testing

The only difference lies, in reality, on the usage of it.
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #4  
Old 10-17-2005, 06:16 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Velox Cruentus
local, level, temp are but a few others.

EDIT:
Hrm -- Second thoughts on local... I think it is... I believe none-prefix vars are treated as level.var?

Now with GS2, you have a lot more. Any weapon is a prefix: GUI.on = true; as well as findnpc("NPC-Server").testing

The only difference lies, in reality, on the usage of it.
I wouldn't class those as prefixes that change the scope.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #5  
Old 10-17-2005, 09:58 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
I don't know, what could be causing the movement to mess up when the nonprefixed vars are changed though? I know that Storm's movement was scripted with the knowledge that nonprefixed vars are global-clientside, but when you edit the vars with an NPC they just screw up the movement. I wouldn't know why.
Reply With Quote
  #6  
Old 10-18-2005, 02:21 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
do the non-prefixed vars have common names, ie: 'i' or 'j'? If so, another script could be editing them, beacuse non-prefixed vars have a global scope, and can be changed/viewed by other scripts.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #7  
Old 10-18-2005, 03:48 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by ApothiX
do the non-prefixed vars have common names, ie: 'i' or 'j'? If so, another script could be editing them, beacuse non-prefixed vars have a global scope, and can be changed/viewed by other scripts.
well, the point of these vars are to be edited. I don't think movement_handlemoving is going to be accidently edited. Also, the problem occurs in only v4, not v2.
Reply With Quote
  #8  
Old 10-19-2005, 06:41 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
Old scripting clientside: non-prefixed variables were belonging to the current level
Old scripting serverside: non-prefixed variables were belonging to the current script (npc, class, etc.)

New scripting: non-prefixed variables are global

About movement_handlemoving: There are 10 weapon scripts and 4 classes which are modifying that variable, you are sure it is meant for what you want to use it?
Reply With Quote
  #9  
Old 10-22-2005, 03:19 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Stefan
Old scripting clientside: non-prefixed variables were belonging to the current level
Old scripting serverside: non-prefixed variables were belonging to the current script (npc, class, etc.)

New scripting: non-prefixed variables are global

About movement_handlemoving: There are 10 weapon scripts and 4 classes which are modifying that variable, you are sure it is meant for what you want to use it?
yes, i'm sure.
Reply With Quote
  #10  
Old 10-23-2005, 03:29 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
Well, need to add more monitoring functionality to know what scripts take a lot of CPU time, are modifying certain variables, are calling certain functions
Reply With Quote
  #11  
Old 10-23-2005, 09:19 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Stefan
Well, need to add more monitoring functionality to know what scripts take a lot of CPU time, are modifying certain variables, are calling certain functions
I don't know, I'd be afraid that Master Storm would guillotine me if I did that. By the way, Stefan, have you looked at any of my forum PMs?
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 05:17 AM.


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