Home Gothic Gothic II Gothic 3 Gothic 4 Downloads Forums

 
 
 

Ergebnis 1 bis 8 von 8
  1. Beiträge anzeigen #1
    Fighter Avatar von 4ltair
    Registriert seit
    Apr 2008
    Ort
    Romania
    Beiträge
    308
     
    4ltair ist offline

    Question Assign an C_ITEM instance to a var C_ITEM

    Hi,

    Is there any possibility to assign a scripted item instance to a variable of C_ITEM type?
    (Something similar to Hlp_GetNpc() functions but for items)

  2. Beiträge anzeigen #2
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    654
     
    Frank-95 ist offline
    Code:
    instance MyInstance(C_ITEM) {};
    
    var C_ITEM MyVar;
    
    MyVar = MyInstance;

  3. Beiträge anzeigen #3
    Fighter Avatar von 4ltair
    Registriert seit
    Apr 2008
    Ort
    Romania
    Beiträge
    308
     
    4ltair ist offline
    Sadly, i have already tried that and it does not work.

  4. Beiträge anzeigen #4
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    654
     
    Frank-95 ist offline
    Oh yeah right.. My mistake.

    If you don't use Ikarus, you can assign the pointer/id of the instance in a variable int.

    Code:
    var int pointer; pointer = Hlp_GetInstanceID(instance);
    Then you can use this pointer in functions like:

    Code:
    var int pointer; pointer = Hlp_GetInstanceID(instance);
    
    CreateInvItem(self,pointer);
    Npc_RemoveInvItem(self,pointer);
    B_GiveInvItems(self,other,pointer,1);

  5. Beiträge anzeigen #5
    Adventurer
    Registriert seit
    Feb 2013
    Beiträge
    58
     
    pawbuj ist offline
    Frank,

    maybe you will be know how to enable player perception for access damage . I have added extra functions to zs_reacttodmage, but till now they are working only when player is hiting another NPC.

    this is needed for me to create hero armor with limited number of hits from monters/npc.

    I had tried many possibilties to enable hero perception for damage but no results.
    Geändert von pawbuj (29.03.2013 um 17:27 Uhr)

  6. Beiträge anzeigen #6
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    654
     
    Frank-95 ist offline
    Zitat Zitat von pawbuj Beitrag anzeigen
    Frank,

    maybe you will be know how to enable player perception for access damage . I have added extra functions to zs_reacttodmage, but till now they are working only when player is hiting another NPC.

    this is needed for me to create hero armor with limited number of hits from monters/npc.

    I had tried many possibilties to enable hero perception for damage but no results.
    Well, you could use a not used AIVar slot in which you can store the number of hits. Hits can be manged from B_AssessDamage.

    Anyway this is not a way that can controll every case. For example in case the hero change armor you should every time set to zero that variable but then if the hero wear it again you loose your previous hits.

    Now I'm thinking about a thing I did sometimes ago to implement the stamina. Check the C_ITEM class. You will see many unused attributes. I don't know if, changing a vlue during the game, that will be saved after saving/loading. Have a try.

    Rename the attribute nutrition that I never saw it used in the game in hits. Then in the function B_AssessDamage increase by one that value and if it reaches the maximum value, reset the value to zero and remove the armor.

    This is the one (possible, I don't know if it will work) without using Ikarus or Lego

  7. Beiträge anzeigen #7
    Adventurer
    Registriert seit
    Feb 2013
    Beiträge
    58
     
    pawbuj ist offline
    I am using unusued variable in game : weight and it keeps the variabale data in the memory even if I changed the armor for the exact with the same instance.

    I will check b_combatreacttodamage. (till now still no results).


    there is no b_assessdamage in G1.
    Geändert von pawbuj (30.03.2013 um 07:49 Uhr)

  8. Beiträge anzeigen #8
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    654
     
    Frank-95 ist offline
    Zitat Zitat von pawbuj Beitrag anzeigen
    there is no b_assessdamage in G1.
    There must be somewhere a function in which it is managed the control of hits. I don't have the code but it sounds that b_combatreacttodamage works only for the first damge and the npc should do

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