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, 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
  #7  
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
  #8  
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
  #9  
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
  #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, 01:54 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
I thought callnpc was made redundant.
__________________
Skyld
Reply With Quote
  #13  
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
  #14  
Old 01-19-2005, 02:12 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
Yes... what is eventflag though? what would it call in the npc?

like triggeraction calls action actionname
Reply With Quote
  #15  
Old 01-19-2005, 02:45 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
Whatever you name 'eventflag' in the callnpc, that is what you use in the npc.
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:18 PM.


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