Jump to content

Ghaunadaur

Supporter
  • Posts

    796
  • Joined

  • Last visited

Posts posted by Ghaunadaur

  1. I don't think you can do this dynamically, it needs to be done individually for each script that you want to access.

     

    For example, if you would want to read a property value from a script on another mod that is attached to a quest, you can do the following:

    Quest OtherModsQuest
    
    Event OnInit()
    	OtherModsQuest = Game.GetFormFromFile(0x00002dca, "OtherMod.esp") as Quest
            if OtherModsQuest
    	   debug.messagebox("Property value is: "+(OtherModsQuest as SomeScript).SomeProperty)
            endif
    EndEvent
    

    A property is not even needed, it can also be a local object variable.

  2. I just tested it, and I can confirm that both methods are working. Adding the script to the weapon itself will not work, if it's already in the inventory. In that case the solution I posted would be preferrable as it will work in all scenarios. Maybe dumb question, but did you fill the property?

  3. I think the problem is with the bow being in a container/inventory, so the script will not receive events, unless the bow was made persistent in some way. But you can do this by using an enchantment, and a spell ability that will be added by the enchantment.

     

    1. Create the spell: type ability / casting constant effect / delivery self.

    2. Add a magic effect to the spell: effect archetype script / casting type constant effect / delivery self.

    3. Create a new enchantment and add it to the bow: type enchantment / casting fire and forget / delivery contact.

    4. Make another magic effect and add it to the enchantment: casting type fire and forget / delivery contact.

    In the 'Equip Ability' dropdown, choose the ability you just created.

    5. Add this script to the ability effect:

    Scriptname DoveCustomArrowScript extends ActiveMagicEffect
    
    Ammo Property DoveCustomArrow auto
    
    Event OnEffectStart(Actor akTarget, Actor akCaster)
    	if akTarget == Game.GetPlayer()
    		akTarget.AddItem(DoveCustomArrow,100,TRUE)
    		akTarget.EquipItem(DoveCustomArrow,TRUE,TRUE)
    	endIf
    endEvent
    
    Event OnEffectFinish(Actor akTarget, Actor akCaster)
    	if akTarget == Game.GetPlayer()
    		akTarget.RemoveItem(DoveCustomArrow,akTarget.GetItemCount(DoveCustomArrow),TRUE)
    	endIf
    endEvent
    

    Obviously the script works only for the player. If you want it to work with all NPC, remove the conditions.

  4.  

    You can't change the script without changing all instances of it. It's still a bad idea, and I strongly recommend the OP not to do so.

    Your too late, already verified the function works perfectly , does NOT effect any other pawns.

     

    Nice try though good luck shooting down sound advice.

     

    The vanilla script 'WICleanupScript' is used by many object in the game. If you change that, it will no longer work properly for all instances. That's just a fact. Not sure what you mean by 'function' or 'pawn'. Gibberish.

  5. Pull up the script in the CK

    Find all lines and carefully comment them out in the Entire script. "The script in question for that NPC" save exit enable the plugin. it should now work.

     

    a comment is this ( ; ) Just the semi colon atthe very beginning of every line During the editing processes, you verify the CK will except it by hitting the black icon saved button.

     

    Should it not except it ,check the edit you last made. again do this 1 line at a time and verify it works when your all done. the script is intact "NOT deleted" and the games engine will see it there ,how ever the data will not run.

     

    let me know how it goes.

    This is a bad idea, since it will affect all instances of the script in the game.

  6. Hello. So, I know that through packages I can make NPC Y follow NPC X. My question is, can I make that package trigger only when NPC X is following me?

     

    Hello, add the following condition to the package:

     

    GetInFaction [PlayerFollowerFaction] == 1.0

    run on reference [NPC x]

     

    or

     

    GetPlayerTeammate == 1.0

    run on reference [NPC x]

     

    you may need to add another condition to the sandbox package, that checks for the opposite (== 0).

  7. No need to start over. Load your mod in TES5Edit, only your mod. Required masters will be loaded automatically with it.

    On the left, expand the CELL section of your mod until you find the Jorvaskr cell. Right click on that entry and remove it.

  8. At first, read the notes from this article. It's an important step when adding fragment scripts and properties. It applies to topic info fragments too.

    Once you've added the script, open the properties window and add a new property. Give it the name Gold001, and for the type choose MiscObject.
    After that, click the 'Auto-fill' button. The property should now be filled with the actual gold object.

    Remove all previous code and paste the following line of code to the code box, either 'On Begin' or 'On End', that's up to you. Compile the script again.

    Game.GetPlayer().RemoveItem(Gold001, 5, false, akSpeaker)
    


    If you haven't done already, you should also add a condition to the topic info, so it will only show up if the player has 5 or more gold.

×
×
  • Create New...