Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   Non-Prefixed Vars (https://forums.graalonline.com/forums/showthread.php?t=61779)

jake13jake 10-17-2005 07:14 AM

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.

ApothiX 10-17-2005 02:40 PM

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

Velox Cruentus 10-17-2005 02:52 PM

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.

ApothiX 10-17-2005 06:16 PM

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.

jake13jake 10-17-2005 09:58 PM

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.

ApothiX 10-18-2005 02:21 PM

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.

jake13jake 10-18-2005 03:48 PM

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.

Admins 10-19-2005 06:41 PM

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?

jake13jake 10-22-2005 03:19 AM

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.

Admins 10-23-2005 03:29 PM

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

jake13jake 10-23-2005 09:19 PM

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?


All times are GMT +2. The time now is 02:04 PM.

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