SphereCommunity

Full Version: Players commanding NPCs?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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'
how about making them a pet for few minutes?
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
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
OBJ.ATTACK <ARGO> ??
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.
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!
Reference URL's