![]() |
Way to make inter-NPC communication better
NPCs could communicate much better between each other if they could call each other easier (without callnpc or clunky ol' triggeraction). Graal seems object-oriented enough that the following additions would do well...
A textbox in the editor would set the "true name" by which all other NPCs can call the NPC. goto truename,condition; Calls the specified conditional trigger in the NPC with the specified true name. This should be able to call only NPCs within the NPC's level. Theoretically it should be able to work clientside. applied: if(this.hearts<3){ //if the boss's hearts are less than 3 goto henchman1,attackplayer; //triggers condition attackplayer in npc henchman1 goto henchman2,attackplayer; //triggers condition attackplayer in npc henchman2 } goto2 level,truename,condition; This'd be a serverside version of goto that would allow calling remote NPCs. applied: if(playertouchsme){ goto2 level13.graal,antagostatue,explode; //calls explode in NPC antagostatue, residing in level13.graal } EDIT: Oops, forgot last part about var calling. At this point, npc.var could refer to another NPC's variables, where npc is the true name of an NPC and var is a variable within said NPC |
Cool. Dont forget params though ^^;
|
Okay then, that'd be:
goto truename,condition(1,var,string,array,sarray); Just as in the first post, except that commas can be used to separate params in the parentheses, which can be numbers, vars, strings, and so on. These params specify what string or var or whatever param1, param2, param3, param4, param5, param6, and so on represent. |
What if two NPC's are named the same thing? I suggest a simple command:
settruename name; and if it is not used, it simply does not have a name =) and any duplicates (within the level or two levels used, of course) woukld simply not work, therfore making it that much easier. Basiclly, make it so it ONLY calls to the level it names to use. [edit]This command would make hard npc's now SO much easier! Add it stefan![/edit] |
I just love that idea. :)
|
Yes sounds good
On the npcserver the database npcs already have a name and can be accessed with with (getnpc(Ship1)) ... but it would be much better if you could access them with simple do Ship1.x or Ship1.moveforward() or so. Non-Database-npcs could be named with a command setname or so. I am making a concept for a new/better scripting engine, which will be compatible but make things more easy (using setstring and strtofloat gets annoying after some time) |
woot!
Is it possible to add setfocusx/setfocusy for making movies and the like as well? :( |
Goto would make stuff easier for Tyhm and all the other people working on free servers...right now you have to find exact indices or use for(i=0;i<npcscount;i++;){callnpc i,attackplayer;} to trigger something in another NPC, unless you know the npc's exact location for triggeraction. If there were a way to determine if something is a string or var (dim as in Visual Basic if it comes to it) string=text could be interpreted as "setstring string,text" and string-- (and such) as "setstring string,#v(strtofloat(string)-1)"
|
Quote:
|
Quote:
|
All times are GMT +2. The time now is 10:07 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.