Home Gothic Gothic II Gothic 3 Gothic 4 Downloads Forums

 
 
 

Results 1 to 8 of 8
  1. View Forum Posts #1
    Fighter 4ltair's Avatar
    Join Date
    Apr 2008
    Location
    Romania
    Posts
    308
     
    4ltair is 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. View Forum Posts #2
    Veteran
    Join Date
    Jan 2012
    Posts
    680
     
    Frank-95 is offline
    Code:
    instance MyInstance(C_ITEM) {};
    
    var C_ITEM MyVar;
    
    MyVar = MyInstance;

  3. View Forum Posts #3
    Fighter 4ltair's Avatar
    Join Date
    Apr 2008
    Location
    Romania
    Posts
    308
     
    4ltair is offline
    Sadly, i have already tried that and it does not work.

  4. View Forum Posts #4
    Veteran
    Join Date
    Jan 2012
    Posts
    680
     
    Frank-95 is 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. View Forum Posts #5
    Ranger
    Join Date
    Feb 2013
    Posts
    162
     
    pawbuj is 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.
    Last edited by pawbuj; 29.03.2013 at 18:27.

  6. View Forum Posts #6
    Veteran
    Join Date
    Jan 2012
    Posts
    680
     
    Frank-95 is offline
    Quote Originally Posted by pawbuj View Post
    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. View Forum Posts #7
    Ranger
    Join Date
    Feb 2013
    Posts
    162
     
    pawbuj is 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.
    Last edited by pawbuj; 30.03.2013 at 08:49.

  8. View Forum Posts #8
    Veteran
    Join Date
    Jan 2012
    Posts
    680
     
    Frank-95 is offline
    Quote Originally Posted by pawbuj View Post
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
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