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
    Apprentice
    Registriert seit
    May 2017
    Beiträge
    38
     
    LootaBox ist offline

    Understanding passing of C_NPC from one function to another

    Hey,

    [EDIT] Nevermind this.

    I am using Lehona's DMG_OnDmg script that you can find here:
    https://forum.worldofplayers.de/foru...densberechnung

    You have this function called when something is damaged by something else:
    Code:
    func int DMG_OnDmg(var int victimPtr, var int attackerPtr, var int dmg, var int dmgDescriptorPtr)
    I'm not sure how the magic that calls that function works, but in that function I can reference the npcs behind those pointers like so:
    Code:
    Var c_npc vic; vic = _^(victimPtr);
    Var c_npc att; att = _^(attackerptr);
    This works, att and vic are valid, as long as the pointers are valid. However, if I call another function like so:
    Code:
    dmg = Handle_Weapon_Dmg(vic, att);
    Those C_NPCs are no longer valid in that other function. There is nothing special about the function I am calling:
    Code:
    func int Handle_Weapon_Dmg(var c_npc vic, var c_npc att)
    If I instead pass the pointers and reference the npcs using the _^() operator it works just fine.
    What am I missing here? Why are those valid C_NPCs no longer valid when passed to the other function?
    Geändert von LootaBox (20.10.2019 um 08:29 Uhr)

  2. Beiträge anzeigen #2 Zitieren
    Apprentice
    Registriert seit
    May 2017
    Beiträge
    38
     
    LootaBox ist offline
    Nevermind the above!

    I was completely off the mark with that. I did not realize the game no longer considers "readied" weapons as "equipped". Sorry if I took anyone's time with this!


  3. Beiträge anzeigen #3 Zitieren
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    Zitat Zitat von LootaBox Beitrag anzeigen
    Nevermind the above!

    I was completely off the mark with that. I did not realize the game no longer considers "readied" weapons as "equipped". Sorry if I took anyone's time with this!

    Don't worry, that is an easy mistake to make. In general, when using an item (e.g. a broom, ...), it leaves the inventory and is put into a hand-slot (ZS_HAND if I remember correctly).

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