Portal-Zone Gothic-Zone Gothic II-Zone Gothic 3-Zone Gothic 4-Zone Modifikationen-Zone Download-Zone Foren-Zone RPG-Zone Almanach-Zone Spirit of Gothic

 

Seite 2 von 2 « Erste 12
Ergebnis 21 bis 24 von 24
  1. Beiträge anzeigen #21 Zitieren
    Local Hero
    Registriert seit
    Feb 2013
    Beiträge
    236
     
    pawbuj ist offline

    change npc routine

    Is possible to change NPC routine by this patch ?

  2. Beiträge anzeigen #22 Zitieren
    Knight
    Registriert seit
    Aug 2009
    Ort
    Hessen
    Beiträge
    1.487
     
    Cryp18Struct ist offline
    Yes, you can call B_StartOtherRoutine.
    Example:
    https://forum.worldofplayers.de/foru...1#post26007437

  3. Beiträge anzeigen #23 Zitieren
    Local Hero
    Registriert seit
    Feb 2017
    Beiträge
    270
     
    F a w k e s ist offline
    Hello pawbuj,
    Alternatively with LeGo ConsoleCalls you can register new marvin console command, for example 'set routine', which will change routine of NPC in your focus:
    Code:
    func string CC_SetRoutine (var string newRtn) {
        var oCNPC her; her = Hlp_GetNPC (hero);
    
        if (!Hlp_Is_oCNpc (her.focus_vob)) { return "No NPC in focus."; };
    
        //Hmmm seems like parameter has extra leading space
        newRtn = STR_Trim (newRtn, " ");
    
        var C_NPC npc; npc = _^ (her.focus_vob);
    
        NPC_ClearAIQueue (npc);
        AI_StandUp (npc);
    
        Npc_ExchangeRoutine (npc, newRtn);
        AI_ContinueRoutine (npc);
    
        //0x006C6C10 public: class zSTRING __thiscall oCNpc_States::GetRoutineName(void)
        const int oCNpc_States__GetRoutineName_G1 = 7105552;
    
        //0x0076E180 public: class zSTRING __thiscall oCNpc_States::GetRoutineName(void)
        const int oCNpc_States__GetRoutineName_G2 = 7790976;
    
        //Here we have inconsistency with class declaration in G1/G2A - different naming, so we have to work with offset instead
        //oCNpc.state_vfptr    // 0x0470
        //oCNpc.state_vtbl    // 0x0588
    
        var int ptr; ptr = _@ (npc);
        var int offset; offset = MEMINT_SwitchG1G2 (1136, 1416);
    
        CALL_RetValIszString ();
        CALL__thiscall (ptr + offset, MEMINT_SwitchG1G2 (oCNpc_States__GetRoutineName_G1, oCNpc_States__GetRoutineName_G2));
        var string curRtn; curRtn = CALL_RetValAszstring ();
    
        //Function above returns routine in full format: RTN_ & routineName & _ID
        //In order to compare routines, we have to convert our newRtn to correct format as well
        newRtn = ConcatStrings ("RTN_", newRtn);
        newRtn = ConcatStrings (newRtn, "_");
        newRtn = ConcatStrings (newRtn, IntToString (npc.ID));
    
        var string msg;
    
        if (Hlp_StrCmp (newRtn, curRtn)) {
            msg = "Done. New routine: ";
            msg = ConcatStrings (msg, newRtn);
            return msg;
        };
    
        msg = ConcatStrings ("Routine ", newRtn);
        msg = ConcatStrings (newRtn, " does not exist.");
    
        return msg;
    };
    
    func void CC_SetRoutine_Init () {
        CC_Register (CC_SetRoutine, "set routine", "Change NPC routine.");
    };
    Couple of notes:
    You need latest Ikarus & LeGo.
    Make sure you initialize your LeGo package with flag LeGo_ConsoleCommands.
    Call CC_SetRoutine_Init from your Init_Global function.
    You will need STR_Trim function from mud-freaks ScriptBin strings.d package:
    https://forum.worldofplayers.de/foru...1#post25717007

    Usage:
    activate marvin
    get NPC into your focus
    type in console (F2) new routine name (for example for Diego in G1):
    set routine PRESTART

  4. Beiträge anzeigen #24 Zitieren
    Local Hero
    Registriert seit
    Feb 2013
    Beiträge
    236
     
    pawbuj ist offline
    I used following code from Ninja Workaround
    Code:
    Npc_ExchangeRoutine npc instance "rotuine name" 1

Seite 2 von 2 « Erste 12

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
Impressum | Link Us | intern
World of Gothic © by World of Gothic Team
Gothic, Gothic 2 & Gothic 3 are © by Piranha Bytes & Egmont Interactive & JoWooD Productions AG, all rights reserved worldwide