![]() |
New scripting engine fixes
Today a new npcserver has been uploaded which fixes several things. Restart it to update it to the latest version:
- player.triggerclient(weaponscript [,params]) has been added, works like triggeraction(0,0,"clientside",params) - object.trigger("action",params) is also accepting single parameters (was only accepting parameters before if there were at least 2 of them) - when a script is run for a player (e.g. if you player.join("myclass")) then the current player is correctly set and functions like setlevel2 should work correctly - npc.save[] can correctly be accessed on clientside - if a variable is not an array (size()==0) then you can access the content of the variable also with "var[0]", which is the same like using "var" then; this is for compatibility with old Graal script. - in compound statements like "if (var) { this.test = 1; drawunderplayer}" it is now accepting old style graal commands (e.g. drawunderplayer) without semicolon if it's used directly before the closing bracket }. This is for compatibility with old Graal script. - arrays like npcs[] and players[] can now be assigned to normal variables (still using a link to the originial array so no speed problems), like e = level.npcs; echo("npc count: " @ e.size()); - assigning a sub array to the array variable is not crashing the npcserver anymore, so you can do stuff like this now: this.arr = {{1,2},3,4}; this.arr = this.arr[0]; |
Quote:
Quote:
|
npc.save[]
What does this do? |
Quote:
if (created || timeout) { save[0]++; timeout = 1; } //#CLIENTSIDE if (created || timeout) { setcharprop #c,#v(save[0]); // will increase timeout = 1; } |
I mean what does it actually do? save npcs o_o?
and how would you use it in a script what would benefit the player/npc server? |
Quote:
|
Quote:
|
Oh,cool :D.
Thanks for clearing that up. |
Quote:
|
Some great stuff there, but:
Quote:
EDIT: Ah, it's different, .trigger works with the current player, but if you trigger on another player, e.g. with findplayer(..) or players[i] it isn't working. Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
NPC Code:text = obj.substring(...); Also, it's not really relevant to the thread, but is it possible that we could get clipboard access from within scripts? Mostly for scripted chat bars and suchlike. |
It might be abused for that one (Some people copy and paste their passwords when it's new, and going on a server with that in clipboard may serve as a vulnerbility to the actual player).
|
Quote:
About clipboard: the question is security yes, may be we could make some onClipboardInsert event that is called when you do Ctrl+V or Shift+Insert |
Quote:
Quote:
NPC Code:a = 1; Then my chat is set to '1', meaning that altering b had no effect on a :confused: |
Quote:
|
Quote:
|
Quote:
|
| All times are GMT +2. The time now is 05:49 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.