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

 

Ergebnis 1 bis 3 von 3
  1. Beiträge anzeigen #1 Zitieren
    Adventurer
    Registriert seit
    Sep 2013
    Beiträge
    66
     
    Vic7im ist offline

    AssignAmbientTalk Problems

    Hello everyone, I'm having a little bit of an issue with assigning dialogues to NPCs.
    I've managed to create a thieving system similar to Gothic 1, based on Returning 2.0's code.

    If your dexterity is lower than the target's, they should turn around and start a conversation with you where you can try to talk your way out or get attacked.

    Problem is, I can't get them to talk, at all. The Npcs turn around, look at me for a split second, then go back to their duties, if I talk to them they won't recognize the theft and act normal.

    Going logically from point A to point B, this is the code of what happens.

    Hero gets caught by focused NPC
    Spoiler:(zum lesen bitte Text markieren)
    Code:
    var oCNpc _hero; _hero = Hlp_GetNpc(PC_HERO);
    var c_npc pNpc; pNpc = MEM_PtrToInst(_hero.focus_vob);
    var C_NPC thiefcatcher; 	
    [...]
    if(pNpc.aivar[AIV_PlayerHasPickedMyPocket] == FALSE && !Npc_CanSeeNpc(pNpc,hero)&& hero.attribute[ATR_DEXTERITY] < pNpc.attribute[ATR_DEXTERITY]  && pNpc.npcType != npctype_friend)
    {
    				thiefcatcher = hlp_getnpc(pNpc);
    				hero_caughtstealing = true;
    				AI_TurnToNpc(pNpc,_hero);
    				//npc_clearaiqueue(pNpc);
    				b_resetthieflevel();	
    				//b_clearperceptions(pNpc);
    				AI_StartState(pNpc,zs_observeplayer,1,"");
    };


    Into ZS_ObservePlayer loop I put a condition that checks if the one who's looking at the player is the one who caught him (the thiefcatcher)

    Spoiler:(zum lesen bitte Text markieren)
    Code:
    func int ZS_ObservePlayer_Loop()
    {
    	if(hero_caughtstealing == TRUE)
    	{
    		b_assigncatchertalk(self);
    	};
    [...]
    };


    Calling B_AssignCatcherTalk() that should assign the "Got you" dialogues I wrote to the NPC that has the same ID of the thiefcatcher
    Spoiler:(zum lesen bitte Text markieren)
    Code:
    func void b_assigncatchertalk(var C_Npc slf)
    {
    	if(Hlp_GetInstanceID(slf) == Hlp_GetInstanceID(thiefcatcher))
    	{
    		b_assigntalkgotyou(slf);		
    	};
    };


    This is B_AssignTalkGotYou()
    Spoiler:(zum lesen bitte Text markieren)
    Code:
    func void B_AssignTalkGotYou(var C_Npc slf)
    {
    	dia_assigntalkgotyou.npc = Hlp_GetInstanceID(slf);
    };


    And then the dialogues:
    Spoiler:(zum lesen bitte Text markieren)
    Code:
    instance dia_assigntalkgotyou(c_info) {
        nr = 1;
        condition = dia_assigntalkgotyou_condition;
        information = dia_assigntalkgotyou_info;
        permanent = true;
        important = true;
    };
    
    [...]
    I put as condition the hero_caughtstealing variable.


    I made the game print me the name of the thiefcatcher NPC to see if I did something wrong, but it correctly writes down the name of the NPC that caught me.

    Problem is, I don't know why it won't talk to me.

    Cheers!

  2. Beiträge anzeigen #2 Zitieren
    Knight
    Registriert seit
    Aug 2009
    Ort
    Hessen
    Beiträge
    1.487
     
    Cryp18Struct ist offline
    Zitat Zitat von Vic7im Beitrag anzeigen
    The Npcs turn around, look at me for a split second, then go back to their duties
    Sounds like the NPC leaves zs_observeplayer immediately.
    Code:
    if (Npc_GetDistToNpc (self, other) > PERC_DIST_INTERMEDIAT)
    {
        Npc_ClearAIQueue(self);
        return LOOP_END;
    }
    if other is invalid then Npc_GetDistToNpc (self, other) will return 2147483647.

    I suggest you make a copy of zs_observeplayer called zs_confrontThief or something and use hero instead of other.

  3. Beiträge anzeigen #3 Zitieren
    Adventurer
    Registriert seit
    Sep 2013
    Beiträge
    66
     
    Vic7im ist offline
    Zitat Zitat von Cryp18Struct Beitrag anzeigen
    Sounds like the NPC leaves zs_observeplayer immediately.
    Code:
    if (Npc_GetDistToNpc (self, other) > PERC_DIST_INTERMEDIAT)
    {
        Npc_ClearAIQueue(self);
        return LOOP_END;
    }
    if other is invalid then Npc_GetDistToNpc (self, other) will return 2147483647.

    I suggest you make a copy of zs_observeplayer called zs_confrontThief or something and use hero instead of other.
    That worked out all right. Thank you!

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