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 01-18-2005, 10:40 PM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
how can i tell a class to perform commands in a lag free efficient way?

the title tells it all :o

Since there are idiots out there i decided id make it simple for them...

I am scripting an RTS server for graal.

What would be the best way to tell a unit that its supposed to move?

Last edited by Gman4pwnu; 01-18-2005 at 11:29 PM..
Reply With Quote
  #2  
Old 01-18-2005, 10:55 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Read Stefan's documents?
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #3  
Old 01-18-2005, 11:15 PM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
Quote:
Originally Posted by GoZelda
Read Stefan's documents?
Your looking to get banned for useless spam?
Reply With Quote
  #4  
Old 01-18-2005, 11:31 PM
EikeSiewertsen EikeSiewertsen is offline
Fry
EikeSiewertsen's Avatar
Join Date: Apr 2001
Location: Germany
Posts: 64
EikeSiewertsen is on a distinguished road
Send a message via ICQ to EikeSiewertsen
First, a class in Graal is just something like 'include' in C[++], so you should work on your question and add more detail to it.

Quote:
Originally Posted by Gman4pwnu
Your looking to get banned for useless spam?
I doubt he'll get banned for it.
__________________
Graal Wiki - Graal Forum
Reply With Quote
  #5  
Old 01-18-2005, 11:32 PM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
Quote:
Originally Posted by EikeSiewertsen
First, a class in Graal is just something like 'include' in C[++], so you should work on your question and add more detail to it.


I doubt he'll get banned for it.
Im pretty sure my question gives enough information.
Reply With Quote
  #6  
Old 01-19-2005, 01:27 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Gman4pwnu
Your looking to get banned for useless spam?
Please leave that to the moderators.

If I've interpreted your problem correctly, you want a way to tell a putnpc2-ed unit what to do. I'd suggest a combination of testnpc and with to reach the NPC and give it instructions accordingly. The NPC could idly wait for instructions to act upon or you could callnpc it to execute the instructions without having to wait.
Reply With Quote
  #7  
Old 01-19-2005, 12:10 AM
Ningnong Ningnong is offline
Registered User
Ningnong's Avatar
Join Date: Nov 2002
Location: < -- way
Posts: 262
Ningnong is on a distinguished road
Use 'with' my friend.

hint: npcscount-1

That is certainly one way of doing it
__________________
Former Global Scripting Team Member


Reply With Quote
  #8  
Old 01-19-2005, 01:32 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Ningnong
Use 'with' my friend.

hint: npcscount-1

That is certainly one way of doing it
Sure, if you want to access the last npc added. I do not think this is the case here.
Reply With Quote
  #9  
Old 01-19-2005, 01:18 AM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
but you cant call a function with that
Reply With Quote
  #10  
Old 01-19-2005, 01:39 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
You can use callnpc to call a flag that runs some code or calls a function (like in the gralats class).
Reply With Quote
  #11  
Old 01-19-2005, 01:48 AM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
lance could you please tell me how callnpc works?
Reply With Quote
  #12  
Old 01-19-2005, 02:06 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Gman4pwnu
lance could you please tell me how callnpc works?
From commands.rtf:

NPC Code:
callnpc index,eventflag;		calls the script of another npc (not immediatelly)

Reply With Quote
  #13  
Old 01-19-2005, 04:37 AM
Evil_Trunks Evil_Trunks is offline
Evil
Evil_Trunks's Avatar
Join Date: Dec 2004
Posts: 391
Evil_Trunks is on a distinguished road
Stefan once said callnpc was laggy and should be avoided
__________________

Reply With Quote
  #14  
Old 01-19-2005, 04:39 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Evil_Trunks
Stefan once said callnpc was laggy and should be avoided
A level triggeraction would be better, anyway, as long as NPCs aren't stacked on top of one another.
Reply With Quote
  #15  
Old 01-19-2005, 04:43 AM
Evil_Trunks Evil_Trunks is offline
Evil
Evil_Trunks's Avatar
Join Date: Dec 2004
Posts: 391
Evil_Trunks is on a distinguished road
what if the NPC is hidden?

the other day, I was wondering what the best way to trigger it would be
__________________

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:41 PM.


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