The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Players commanding NPCs?
Author Message
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #1
Players commanding NPCs?
how can i have players be able to command npcs if they are high enough level?

with ONLY the basic commands
follow, kill, stay

a speech file duh!

first problem...
how can i bring up a attack target?

Code:
[SPEECH s_wei_infantry]
ON=*kill*
ON=*attack*
    IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004000) && (<SRC.LEVEL>>019) && (<SRC.LEVEL><025)
        SAY Yes sir!
        TARG.ATTACK
    ELSE
    IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004000) && (<SRC.LEVEL>>049)
        SAY Yes sir!
        TARG.ATTACK
    ELSE
        SAY You cannot command me!


or a function to attack?


Code:
[FUNCTION f_attack]
TARGETF
OBJ.SAY Yes sir!
OBJ.ATTACK.ARGO

[SPEECH s_wei_infantry]
ON=*kill*
ON=*attack*
    IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004000) && (<SRC.LEVEL>>019) && (<SRC.LEVEL><025)
        OBJ <UID>
        f_attack
    ELSE
    IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004000) && (<SRC.LEVEL>>049)        
        TARGETF
        SRC.ATTACK
    ELSE
        SAY You cannot command me!

16:54:ERROR:(3kuo_s_speech.scp,4)Undefined keyword 'ATTACK.ARGO'

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 01-29-2015 07:56 AM by x77x.)
01-29-2015 05:11 AM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #2
RE: Players commanding NPCs?
how about making them a pet for few minutes?

Dragons of Time 2000-2020
http://dragonsoftime.com
01-29-2015 07:08 AM
Find all posts by this user Like Post Quote this message in a reply
Jim
Apprentice
*

Posts: 28
Likes Given: 1
Likes Received: 12 in 4 posts
Joined: Jan 2015
Reputation: 0



Post: #3
RE: Players commanding NPCs?
you can try the mercenary scripts, shown at "[CHARDEF c_mercenary]" in "sphere_citizens.scp".
thers is a "HIREDAYWAGE" property, so when you say "hire", the NPC of mercenary will say something, then you put some gold on him,then he/she will be hired by your player. and then you can order him/her to do something

and the custom orders, you can use SPEECH , i think
(This post was last modified: 01-29-2015 10:47 AM by Jim.)
01-29-2015 10:45 AM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #4
RE: Players commanding NPCs?
didnt want to hire...

just command temporarily would be nice


it almost works... just cant figure out how to make this work

OBJ.ATTACK.ARGO

Dragons of Time 2000-2020
http://dragonsoftime.com
01-29-2015 11:59 AM
Find all posts by this user Like Post Quote this message in a reply
Jim
Apprentice
*

Posts: 28
Likes Given: 1
Likes Received: 12 in 4 posts
Joined: Jan 2015
Reputation: 0



Post: #5
RE: Players commanding NPCs?
OBJ.ATTACK <ARGO> ??
01-29-2015 01:57 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #6
RE: Players commanding NPCs?
One tip, Sphere uses hexadecimal values by default so 19 = 19, 019 = 25 and 025 = 37, keep an eye on that... to see real values of hexadecimal ones you can use ingame .show eval 019 and it will give you the decimal value.
01-29-2015 08:08 PM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #7
RE: Players commanding NPCs?
figured it out... WORKING!



Code:
[FUNCTION f_attack]
OBJ.SAY Yes sir!
OBJ.ATTACK <ARGO>
OBJ.SAY <OBJ> will now attack <ARGO>

[SPEECH s_wei_infantry]
ON=*kill*
ON=*attack*
    IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004000) && (<SRC.LEVEL>>019) && (<SRC.LEVEL><025)
        OBJ <UID>
        TARGETF f_attack
    ELSE
    IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004000) && (<SRC.LEVEL>>049)        
        OBJ <UID>
        TARGETF f_attack
    ELSE
        SAY You cannot command me!

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 01-30-2015 12:16 AM by x77x.)
01-30-2015 12:03 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)