Jump to content

Adding chest to existing area help


ilsolas

Recommended Posts

Over the last few hours I have been trying to add a chest via a prcscr script to the King's Camp (night version). I have to admit I seem to be terrible with scripts!

 

I have created a new module, made up my chest which contains a test item, got the vector numbers for the location by duplicating the area and deleting it afterwards (no exporting). I use this script (a template from the datoolset wiki) along with their instructions:

 

 

//const string TAL_STORAGE_CHEST_SPAWNED = "TAL_STORAGE_CHEST_SPAWNED";
const string TAL_IP_STORAGE_CHEST = "gwo_storage_chest";
const resource TAL_RESOURCE_IP_STORAGE_CHEST = R"joining_storage_chest.utp";
void main()
{
object oMainControlled = GetMainControlled();
object oChest = UT_GetNearestObjectByTag(oMainControlled, TAL_IP_STORAGE_CHEST);
//DisplayFloatyMessage(oMainControlled, "storage script working", FLOATY_MESSAGE, 16777215, 30.0);
if (!IsObjectValid(oChest))
{
location lSpawn = Location(GetArea(oMainControlled), Vector(658.13, 473.23, 8.51), 0.0);
CreateObject(OBJECT_TYPE_PLACEABLE, TAL_RESOURCE_IP_STORAGE_CHEST, lSpawn);
//DisplayFloatyMessage(oMainControlled, "storage chest created", FLOATY_MESSAGE, 16777215, 30.0);
}
}
I also modified the gda file from the storage mod as I don't have excel and trying to make it on google sheets didn't work unfortunately.
I'm not sure what I have done wrong, as the chest doesn't appear. I have seen another people use this script and their items have turned up fine. I also tried looking for another scripts but can't seem to find any and the datool wiki site doesn't go into a lot of detail.
Link to comment
Share on other sites

Yes I did, I have tried using the area code for the kings camp night and day also tried the area list names. I have even tried the cousland castle and I can only get the camp area to work. So I do think there is an issue with the gda file I edited. I'm going to try and do the google sheet xlsx again with the method the user mentioned in the post you linked.

 

EDIT: didn't work with the google sheets method, I also made it from scratch in the gda tool,also converted that to excel and used the excel processor.

Edited by iLoveStimpaks
Link to comment
Share on other sites

Ok so I messed around with the scripts a little more. Also added in an npc using a tutorial: https://dragonagemodding.wordpress.com/2009/11/15/creating-a-custom-merchant-for-the-players-camp-part-1/ to see if I was making a mistake on my end.

 

That npc worked straight away when I created a gda file from scratch in the gda app, so I went back to the chest script. Wrote it all out by hand and redid the gda file with the area lists typed in by hand. Then suddenly the chest appeared as planned.

 

So I think copying and pasting in the names lead to me making a mistake somewhere but can't figue it out but at least it's working!

Link to comment
Share on other sites

Try this.....make sure you use your information and when making the gda (use GDApp) that you are using the area list for the king's camp.....and the name of your script.

#include "utility_h"
#include "placeable_h"
#include "wrappers_h"
#include "plot_h"
#include "YOUR_PLOT_GOES_HERE"

void main()
{
	object oKingsCamp = GetObjectByTag("pre100ar_kings_camp_night");
	object oPC = GetMainControlled();
    	object oArea = GetArea(oPC);
	location vChestLoc = Location(GetArea(oArea), Vector(Use_Your_Coordinates), Your_Coordinates); 

	if(IsObjectValid(oKingsCamp))
	{
		if (!WR_GetPlotFlag(YOUR_PLOT, YOUR_FLAG))
        	{
            		CreateObject(OBJECT_TYPE_PLACEABLE, R"YOUR_CHEST_ID.utp", vChestLoc);
            		WR_SetPlotFlag(YOUR_PLOT, YOUR_FLAG, TRUE);
        	}
         }
}
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...