Aller au contenu

Photo

Adding set of armor to Bodahn? wall of text...


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
yasuraka.hakkyou

yasuraka.hakkyou
  • Members
  • 1 834 messages
I've looked at weriKK's blog on this (http://social.biowar.../5339/blog/576/) a few times, but the way he writes out the script baffles me. I'd like to add a helm, chest, glove pair and boot pair to Bodahn, but this script would need to be changed, and I don't have a clue. Could someone explain this to me / cut out the unneccessary bits? quite simply please, as if you're talking to a 10 year old. Please? haha.

also, I have a couple of mods that are already adding things to Bodahn's Inventory, if that matters.

// ---- SCRIPT STARTS HERE ----

// Later on in this script,
 we will use the UT_AddItemToInventory()
// function to add an item 
to the player's inventory.
// But before we could use it, we have to 
tell the toolset where
// to look for it. The function is in the 
"utility_h" script file
// under _Core Includes, we will include this
 file at the top of
// our script file, above the main function.

#include
 "utility_h"
#include "plt_my_custom_plot"

void main()
{
  
  // If our plot flag is set to TRUE, that means we have already
   
 // given the items to the player, there is no need to continue
   
 // running this script.
    if ( WR_GetPlotFlag( PLT_MY_CUSTOM_PLOT,
 MY_ITEM_CHECK_FLAG ) == TRUE )
        return;

    event ev =
 GetCurrentEvent();
    int nEventType = GetEventType(ev);

   
 // We will watch for every event type and if the one we need
    // 
appears we will handle it as a special case. We will ignore the rest
  
  // of the events
    switch ( nEventType )
    {
        // 
This event happenes every time the module loads
        // This 
usually happenes when creating a new game
        // or loading a 
savegame
        case EVENT_TYPE_MODULE_LOAD:
        {
        
    // The UT_AddItemToInventory function adds various resources to a
  
          // creature's inventory. Here we add one weapon and one 
shield.
            UT_AddItemToInventory(R"my_custom_weapon.uti", 
1);
            UT_AddItemToInventory(R"my_custom_shield.uti", 1);

  
          // Set our plot flag to TRUE, so the next time this script 
tries
            // to run it will not add extra items to the 
player's inventory
            WR_SetPlotFlag( PLT_MY_CUSTOM_PLOT, 
MY_ITEM_CHECK_FLAG, TRUE );

            // We have dealt with the
 event we were waiting for.
            // At this point we can stop 
looking for other events
            break;
        }
       
 default:
            break;
    }
}
// ---- SCRIPT ENDS 
HERE ----


#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
It would be best to handle adding items to Bodahn through the PRCSCR method.

You can use the same script as above - just remove the event code in there.
[dascript]
#include "utility_h"
#include "plt_my_custom_plot"

void main()
{
    if ( WR_GetPlotFlag( PLT_MY_CUSTOM_PLOT, MY_ITEM_CHECK_FLAG ) == TRUE )
        return;

    object oBodahn = GetObjectByTag("bodahns_tag_you_need_to_find_this");

    UT_AddItemToInventory(R"my_custom_weapon.uti", 1, oBodahn);
    WR_SetPlotFlag( PLT_MY_CUSTOM_PLOT, MY_ITEM_CHECK_FLAG, TRUE );

}[/dascript]

#3
yasuraka.hakkyou

yasuraka.hakkyou
  • Members
  • 1 834 messages
hmm, not working so far. here's the rundown...if you need something else, ask.
name (of content, as seen in managing modules): Dalish_Armor
script (as seen in same place): dalish_armor_set

(.nss file):
#include "utility_h"
#include "plt_dalish_armor_set"

void main()
{
    if ( WR_GetPlotFlag( PLT_DALISH_ARMOR_SET, MY_ITEM_CHECK_FLAG ) == TRUE )
        return;

    object oBodahn = GetObjectByTag("bodahns_tag_you_need_to_find_this");

    UT_AddItemToInventory(R"dalish_armor_set.uti", 1, oBodahn);
    WR_SetPlotFlag( PLT_DALISH_ARMOR_SET, MY_ITEM_CHECK_FLAG, TRUE );

}

(.plo file):
MY_ITEM_CHECK_FLAG    Flag:0    Reward:None    Has Journal: (blank)    Final: No    Repeatable:No    Default Value: Not Set.

Modifié par yasuraka.hakkyou, 02 mai 2010 - 08:12 .


#4
_L_o_B_o_

_L_o_B_o_
  • Members
  • 117 messages
Replace "bodahns_tag_you_need_to_find_this" with "store_camp_bodahn"

#5
yasuraka.hakkyou

yasuraka.hakkyou
  • Members
  • 1 834 messages
I apologize for my toolset-related "retardedness", but its still not working. I've exported w/o resources, and the 2 XML files, as that blog says, and I've even disabled the content, force-loaded, and that whole process. here's the modified script, if you need anything else, ask. The main plot flag is named exactly what it is in the script, etc...

Maybe I'm missing this somewhere?
___

event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);
___

#include "utility_h"
#include "plt_dalish_armor_set"

void main()
{
if ( WR_GetPlotFlag( PLT_DALISH_ARMOR_SET, MY_ITEM_CHECK_FLAG ) == TRUE )
return;

object oBodahn = GetObjectByTag("store_camp_bodahn");

UT_AddItemToInventory(R"dalish_armor_set.uti", 1, oBodahn);
WR_SetPlotFlag( PLT_DALISH_ARMOR_SET, MY_ITEM_CHECK_FLAG, TRUE );

}

Modifié par yasuraka.hakkyou, 02 mai 2010 - 06:34 .


#6
TimelordDC

TimelordDC
  • Members
  • 923 messages
Are you running this as a PRCSCR script?

http://social.biowar...ndex.php/PRCSCR

#7
yasuraka.hakkyou

yasuraka.hakkyou
  • Members
  • 1 834 messages
Ok, I took a look at that, and I'd be happy just getting the items into the game / PC inventory at this point. here's the edited script, as seen here (http://social.biowar...ayers_Inventory).

#include "utility_h"
#include "plt_dalish_armor_set"

void main()
{
    if ( WR_GetPlotFlag( PLT_DALISH_ARMOR_SET, MY_ITEM_CHECK_FLAG ) == FALSE )
    {
        UT_AddItemToInventory(R"andruils_sight.uti", 1);
        UT_AddItemToInventory(R"elgarnans_vengeance.uti", 1);
        UT_AddItemToInventory(R"falondins_rest.uti", 1);
        UT_AddItemToInventory(R"mythals_grace.uti", 1);
        WR_SetPlotFlag( PLT_PLT_DALISH_ARMOR_SET, MY_ITEM_CHECK_FLAG, TRUE );
    }
}

Modifié par yasuraka.hakkyou, 02 mai 2010 - 07:32 .