Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   how can i tell a class to perform commands in a lag free efficient way? (https://forums.graalonline.com/forums/showthread.php?t=57145)

Gman4pwnu 01-18-2005 10:40 PM

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?

GoZelda 01-18-2005 10:55 PM

Read Stefan's documents?

Gman4pwnu 01-18-2005 11:15 PM

Quote:

Originally Posted by GoZelda
Read Stefan's documents?

Your looking to get banned for useless spam?

EikeSiewertsen 01-18-2005 11:31 PM

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.

Gman4pwnu 01-18-2005 11:32 PM

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.

Ningnong 01-19-2005 12:10 AM

Use 'with' my friend.

hint: npcscount-1

That is certainly one way of doing it

Gman4pwnu 01-19-2005 01:18 AM

but you cant call a function with that

Lance 01-19-2005 01:27 AM

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.

Lance 01-19-2005 01:32 AM

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.

Tolnaftate2004 01-19-2005 01:39 AM

You can use callnpc to call a flag that runs some code or calls a function (like in the gralats class).

Gman4pwnu 01-19-2005 01:48 AM

lance could you please tell me how callnpc works?

Skyld 01-19-2005 01:54 AM

I thought callnpc was made redundant.

Lance 01-19-2005 02:06 AM

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)


Gman4pwnu 01-19-2005 02:12 AM

Yes... what is eventflag though? what would it call in the npc?

like triggeraction calls action actionname

Lance 01-19-2005 02:45 AM

Whatever you name 'eventflag' in the callnpc, that is what you use in the npc.


All times are GMT +2. The time now is 08:54 AM.

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