Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-01-2002, 06:07 AM
kao3 kao3 is offline
Registered User
Join Date: Nov 2001
Posts: 1
kao3 is on a distinguished road
I need NPC help

does anybody know how to make a NPC repeat its action? I want someone to tell me how to make a NPC repeadly shoot cannonballs.
Reply With Quote
  #2  
Old 02-01-2002, 06:11 AM
Dustey Dustey is offline
Registered User
Join Date: Nov 2001
Location: Do You Think I Know?
Posts: 193
Dustey is on a distinguished road
Send a message via AIM to Dustey
1 word

WHILE
__________________
And Yes I work For.... Renegade
Reply With Quote
  #3  
Old 02-01-2002, 06:47 AM
Shard_IceFire Shard_IceFire is offline
Registered User
Shard_IceFire's Avatar
Join Date: Jun 2001
Location: Eastern Harkoonia
Posts: 861
Shard_IceFire is on a distinguished road
Here is an example =)
NPC Code:

if (playerenters||timeout) {
shootfireball up;
timeout=0.2;
}

__________________

-=Shard IceFire=-
Reply With Quote
  #4  
Old 02-01-2002, 10:24 AM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
'for' loops are fun.
Reply With Quote
  #5  
Old 02-01-2002, 06:49 PM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
Some time ago I have seen a functions loop... but it only worked for the leader:

NPC Code:

if(playerenters){
loopit();
}

function loopit() {
x+=.05;
sleep .05;
loopit();
}



U shouldn't use it but it's possible too
__________________
No Webhost at the moment
Reply With Quote
  #6  
Old 02-01-2002, 07:39 PM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
whats going to be new with the new engine??
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #7  
Old 02-01-2002, 08:47 PM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
Quote:
Originally posted by Kaimetsu


Ew, infinite recursion. Won't work when the new scripting engine is completed.
Just sid that it is possible at the moment not that it was a good ieda to use it or that it's possible to use it in the future
__________________
No Webhost at the moment
Reply With Quote
  #8  
Old 02-01-2002, 09:53 PM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
will you be able to send things to functions

like
fname(value1,value2)
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #9  
Old 02-01-2002, 10:11 PM
zell12 zell12 is offline
Gone
zell12's Avatar
Join Date: Jun 2001
Location: Alberta, Canada
Posts: 8,541
zell12 has a spectacular aura about
Send a message via ICQ to zell12 Send a message via AIM to zell12 Send a message via MSN to zell12
arg, your mins are so much more complex then mine >.<
__________________
Reply With Quote
  #10  
Old 02-02-2002, 02:18 AM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
Quote:
Originally posted by Kaimetsu


I believe so.
Hmmm Stefan said that he won't add these params on functions because he would have to redo too many things... but I only think the only person who can say anything about this is mr. Bomber hisself
__________________
No Webhost at the moment
Reply With Quote
  #11  
Old 02-02-2002, 04:36 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
o man


*tries to contain self*


this is going to be so great, i cant wait
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #12  
Old 02-02-2002, 04:41 AM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Stefan scares me ...
But these new engine stuff, sounds very nice, hopefully
there will be more easier ways for storing values on the server then server.strings ...
Reply With Quote
  #13  
Old 02-02-2002, 05:07 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
Quote:
Originally posted by nyghtGT
Stefan scares me ...
But these new engine stuff, sounds very nice, hopefully
there will be more easier ways for storing values on the server then server.strings ...
lets just hope so
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #14  
Old 02-02-2002, 09:11 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Well,
Ipersonally think that its pretty retarded to send values thru functions, its trendy, and you could just use triggeractions. Also, that could screw up the scope, and like I personally hate non-global scope, like PHP. Its just pointless... Also this:
NPC Code:

func(10,10);
function func(i,j) {
ans = i*j;
return;
}


is to:
NPC Code:

i = 10;
j = 10;
func();
function func(i,j) {
ans = i*j;
return;
}


Mmmmmmmmmmmm....global scope.
Bootiful.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #15  
Old 02-02-2002, 09:16 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
I want to be helpfula dn help people make the new scripting engine, but i can't seem to work my way to the top...:-/. O well i can reccommend here...
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #16  
Old 02-04-2002, 11:56 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by Kaimetsu


It's pointless because you don't understand the point to it. It's more efficient, leads to fewer conflicts, makes the program more comprehensive etc. If you get into deeper programming than Graal then I hope you'll see the difference.
Ouch, burnt by the seering touch of the whip of Kaimetsu...
But I know that it is good in stuff like Standard C. I understand it is helpful, and there are good points to it, I was just pointing out that you can do it already. It does lead to fewer conflicts, and it is indeed more efficient, but what i was saying is that it can be done as is. I do see the difference and it is not fair to immediatly assume otherwise.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #17  
Old 02-04-2002, 06:12 PM
joseyisleet joseyisleet is offline
Registered User
Join Date: Aug 2001
Posts: 378
joseyisleet is on a distinguished road
-=Josey=-
That would own, you could shorten code by a lot!

function message(text,timeammount){
message text;
sleep timeammount;
message ;
}
if (playertouchsme){
message(hi there,10);
}

If this is how it's going to work, I'll be most delighted. ;D
__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
Reply With Quote
  #18  
Old 02-05-2002, 12:15 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by Kaimetsu


"message" will probably be a reserved word and you won't be able to deliver strings in that way, but yeah. I wonder if it'll use polymorphism...
Polymorphism!? Leet!!! man this is gonna own. I admit that the use of arguments is going to be helpful, but if it required re-writing parts of the scripting engine, that why waste the time...
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #19  
Old 02-05-2002, 05:32 AM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
This sounds awsome you will be able to own in graal but im putting just about all of my money on this that all the good script commands that let you do anything neto will be DUN DUN DUN !!! P2P!!!!!!
__________________
Reply With Quote
  #20  
Old 02-05-2002, 03:58 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Quote:
Originally posted by Kaimetsu
Oops, I didn't even mean polymorphism. I meant the other thing whose name I've forgotten. Basically:

NPC Code:
function hi(i){
<code>
}
function hi(i,j){
<othercode>
}



Same function name, allowed because the params are different. Cookie to the guy who can remind me what it's called.
its called magik ...
Reply With Quote
  #21  
Old 02-06-2002, 12:12 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Isn't that overloading?
NPC Code:

function hi(i) {}
function hi(i,j) {}



yes it is.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #22  
Old 02-06-2002, 06:43 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by Kaimetsu


Cookie!
yay!
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
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 03:31 PM.


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