Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-29-2001, 12:43 AM
jeff335 jeff335 is offline
Registered User
Join Date: Oct 2001
Posts: 605
jeff335 is on a distinguished road
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
__________________

Quote:
Some people like standing around talking to idiots in the real world, and some don't. Neither choice is inherently better than the other.

-Kaimetsu
Reply With Quote
  #2  
Old 12-29-2001, 08:23 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
Cool. Dont forget params though ;
__________________

subliminal message: 1+1=3
Reply With Quote
  #3  
Old 12-29-2001, 09:27 AM
jeff335 jeff335 is offline
Registered User
Join Date: Oct 2001
Posts: 605
jeff335 is on a distinguished road
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.
__________________

Quote:
Some people like standing around talking to idiots in the real world, and some don't. Neither choice is inherently better than the other.

-Kaimetsu
Reply With Quote
  #4  
Old 12-29-2001, 09:51 AM
LilNiglet LilNiglet is offline
Registered User
Join Date: Jun 2001
Posts: 3,178
LilNiglet is on a distinguished road
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]
Reply With Quote
  #5  
Old 12-29-2001, 07:00 PM
Slaktmaster Slaktmaster is offline
man with the mastahplan
Slaktmaster's Avatar
Join Date: Apr 2001
Location: Half-way over the river styx
Posts: 4,422
Slaktmaster is an unknown quantity at this point
Send a message via ICQ to Slaktmaster Send a message via AIM to Slaktmaster
I just love that idea.
Reply With Quote
  #6  
Old 12-29-2001, 09:49 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
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)
Reply With Quote
  #7  
Old 12-29-2001, 10:16 PM
Slaktmaster Slaktmaster is offline
man with the mastahplan
Slaktmaster's Avatar
Join Date: Apr 2001
Location: Half-way over the river styx
Posts: 4,422
Slaktmaster is an unknown quantity at this point
Send a message via ICQ to Slaktmaster Send a message via AIM to Slaktmaster
woot!

Is it possible to add setfocusx/setfocusy for making movies and the like as well?
Reply With Quote
  #8  
Old 12-30-2001, 11:12 AM
jeff335 jeff335 is offline
Registered User
Join Date: Oct 2001
Posts: 605
jeff335 is on a distinguished road
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:
Some people like standing around talking to idiots in the real world, and some don't. Neither choice is inherently better than the other.

-Kaimetsu
Reply With Quote
  #9  
Old 12-30-2001, 01:37 PM
Faheria_GP2 Faheria_GP2 is offline
Banned
Faheria_GP2's Avatar
Join Date: Oct 2001
Posts: 1,177
Faheria_GP2 is on a distinguished road
Quote:
Originally posted by Stefan
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)
dont forget the function parameters!
Reply With Quote
  #10  
Old 12-30-2001, 02:25 PM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
Quote:
Originally posted by Slaktmaster
woot!

Is it possible to add setfocusx/setfocusy for making movies and the like as well?
I believe you are talking about setfocus x,y; and resetfocus; Stefan said he would enable the command to work around 2 Graal versions ago. Maybe if we bug him......
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
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 10:45 AM.


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