![]() |
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.
|
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 |
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. |
Quote:
|
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.
|
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.
|
Quote:
|
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? |
Quote:
|
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
|
Quote:
|
| 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.