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-nmm7 (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-nmm7 (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-nmm7 (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
Double Target
Author Message
mlyon83
Apprentice
*

Posts: 44
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2013
Reputation: 0



Post: #1
Double Target
I've written a script to tame, and it works fine, however, I'm getting the default target for taming and my own custom target. How would I resolve this?

Code:
ELSEIF (<SRC.ACTION> == skill_Taming)
    //SRC.ACTION=-1
    IF (<SRC.TAG.TAMING_STATUS> == 1)
        SRC.SYSMESSAGE @00 You're already taming a creature. Please wait.
    ELSE
        SRC.TAG.TAMING_STATUS=1
        SRC.NEWITEM=i_player_tame_start
        SRC.ACT.EQUIP
    ENDIF
    RETURN 1
ENDIF

[ITEMDEF i_player_tame_start]
ID=i_memory
TYPE=t_eq_script
LAYER=layer_special
NAME="Player Taming Target Memory"

ON=@Equip
LINK=<SRC.UID>
TARGET

ON=@Targon_Char
IF (<LINK.TARG.NPC>)
    IF (<LINK.TARG.DISTANCE> >= 5)
        LINK.SYSMESSAGE @00 You're too far away to tame that creature.
    ELSEIF (<LINK.TARG.TAMING> <= 0.0)
        LINK.SYSMESSAGE @00 You cannot tame that creature.
    ELSE
        IF (<LINK.TARG.TAMING> <= <LINK.TAMING>)
            LINK.TAG.TAMING_UID=<LINK.TARG.UID>
            LINK.TAG.TAMING_NAME=<LINK.TARG.NAME>
            LINK.MESSAGE @00 You begin to tame <LINK.TARG.NAME>...
            TIMER=3
        ELSE
            LINK.SYSMESSAGE @00 You lack sufficient skill to tame that creature.
            REMOVE
        ENDIF
    ENDIF
ENDIF
RETURN 1

ON=@Timer
//Check distance
LINK.TAG.TAMING_COUNT=<LINK.TAG.TAMING_COUNT>+1
LINK.TAG.TAMING_RANDOM=8
IF (<LINK.TAG.TAMING_COUNT> >= <LINK.TAG.TAMING_RANDOM>)
    LINK.SYSMESSAGE @00 You successfully capture the love and trust of <LINK.TAG.TAMING_NAME>.
    LINK.TAG.TAMING_STATUS=0
    LINK.TAG.TAMING_COUNT=0
        //Set memory to pet owner
    REMOVE
ELSE
    DORAND 10
        LINK.SAY="You're so cute, <LINK.TAG.TAMING_NAME>. I just want to eat you up."
        LINK.SAY="Come here, <LINK.TAG.TAMING_NAME>. I won't hurt you."
        LINK.SAY="Awwwh... you're so precious, <LINK.TAG.TAMING_NAME>."
        LINK.SAY="I love you, <LINK.TAG.TAMING_NAME>."
        LINK.SAY="Come into my open arms, <LINK.TAG.TAMING_NAME>."
        LINK.SAY="You're the most adorable thing I've ever seen, <LINK.TAG.TAMING_NAME>."
        LINK.SAY="I would never trade you in for another <LINK.TAG.TAMING_NAME>."
        LINK.SAY="Give me a kiss, <LINK.TAG.TAMING_NAME>, you cute bastard."
        LINK.SAY="I just want to cuddle you, <LINK.TAG.TAMING_NAME>."
        LINK.SAY="Come here, <LINK.TAG.TAMING_NAME>. I won't eat you."
    ENDDO
    TIMER=5
ENDIF
RETURN 1

ON=@Targon_Cancel
LINK.SYSMESSAGE @00 You cancel your target.
REMOVE
RETURN 1
(This post was last modified: 05-18-2013 02:48 AM by mlyon83.)
05-18-2013 02:46 AM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #2
RE: Double Target
Show us your skill definition for taming...
05-18-2013 03:37 AM
Find all posts by this user Like Post Quote this message in a reply
mlyon83
Apprentice
*

Posts: 44
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2013
Reputation: 0



Post: #3
RE: Double Target
(05-18-2013 03:37 AM)RanXerox Wrote:  Show us your skill definition for taming...

[SKILL 35]
DEFNAME=Skill_Taming
KEY=Taming
TITLE=Animal Tamer
PROMPT_MSG=Tame which animal?
DELAY=2.0
STAT_STR=30
STAT_INT=40
STAT_DEX=60
BONUS_STR=30
BONUS_DEX=10
BONUS_INT=60
BONUS_STATS=20
ADV_RATE=10.0,200.0,800.0

ON=@Fail
SRC.SYSMESSAGE @00 You fail to tame the creature.

ON=@Abort
SRC.SYSMESSAGE @00 You give up trying to tame the creature.
05-18-2013 03:56 AM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #4
RE: Double Target
The only way to prevent the built-in target of the taming skill from showing up is to change the taming skill... add: FLAGS=SKF_SCRIPTED

The down side to this is you probably need to re-implement all the rest of the built-in behaviour (skillgain, success, fail, etc) in your script.

The alternative is to re-implement your idea using the actual skill triggers... you can find an example of this technique in the SCP: http://code.google.com/p/sphere-communit...taming.scp
05-18-2013 06:02 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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