Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   ? on ai handler (https://postpacific.loc-online.com/showthread.php?t=6683)

DevilsAssociate 30.01.2007 05:38

? on ai handler
 
i am still learning how to write ai.
Working on some script for a npc and i need to to check for karma then check for the pledge id. Got it in one talked handler and for some reason one or the there don't check.

Edited: figured it out stupid mistake

Code:

handler 3 82        //  TALKED
        variable_begin
                "talker"
                "myself"
                "_choiceN"
                "_code"
                "_from_choice"
        variable_end

        push_event        //  talker
        push_const 40
        add
        fetch_i        //  karma
        push_const 468
        add
        fetch_i4
        push_const 0
        greater
        branch_false L4841
L4850
        push_event        //  myself
        push_const 704
        add
        fetch_i
        push_event        //  talker
        push_const 40
        add
        fetch_i
        push_parameter fnYouAreChaotic
        func_call 184680516        //  func[ShowPage]
        shift_sp -2
        shift_sp -1
        jump L4847

L4841
        push_event        //  myself
        push_const 704
        add
        fetch_i
        func_call 184549553        //  func[Castle_GetPledgeId]
        push_event        //  talker
        push_const 40
        add
        fetch_i        //  pledge_id
        push_const 792
        add
        fetch_i4
        equal
        push_reg_sp
        fetch_i
        branch_false L4845
        push_event        //  talker
        push_const 40
        add
        fetch_i        //  pledge_id
        push_const 792
        add
        fetch_i4
        push_const 0
        not_equal
L4843
        branch_false L4845
L4844
        push_event        //  myself
        push_const 704
        add
        fetch_i
        push_event        //  talker
        push_const 40
        add
        fetch_i
        push_parameter fnHi
        func_call 184680516        //  func[ShowPage]
        shift_sp -2
        shift_sp -1
        jump L4846
L4845
        push_event        //  myself
        push_const 704
        add
        fetch_i
        push_event        //  talker
        push_const 40
        add
        fetch_i
        push_parameter fnNotMyPledge
        func_call 184680516        //  func[ShowPage]
        shift_sp -2
        shift_sp -1
       

       
L4846
L4847
L4842
handler_end


DevilsAssociate 30.01.2007 07:38

since i already posted this and figured it out i had a question on how handler value made up

what all is added up to ge tthe number. right now i am useing hf script make o find the right value. kinda want to find it without the scriptmaker.


All times are GMT. The time now is 15:27.