I've created an md2a (PRCSCR) that governs scripts that introduce certain changes in various areas. I did run into some difficulty, but got that solved for the Prelude when I discovered that some areas can't be called directly; they must be called by the area list to which they belong.
However, whatever I do, trying to mod Redcliffe village -- the general store, to be exact -- fails. My PRSCR has a row for the correct area list, and as far as I know the script calls the correct area tag and placeable tag (I've copied and pasted them).
Has anyone else run into this?
The area list is 'arl01al_redcliffe_village', the area tag is 'arl170ar_general_store' and the chest I'm trying to add to is 'arl170ip_dwarven_chest'.
Problems with modding Redcliffe?
Débuté par
fkirenicus
, mars 16 2011 09:18
#1
Posté 16 mars 2011 - 09:18
#2
Posté 16 mars 2011 - 11:18
Perhaps go to a chest where you know there is inventory and look at all the settings for that chest then compare it to the one you want to change.
#3
Posté 17 mars 2011 - 04:41
With your tip in mind I thought I found something, but I don't think it matters... The resource for the chest has Treasure Category set to "INVALID", whereas the placed instance has "Dwarven".
The chest does spawn treasure when opened, so there's nothing "wrong" with that, as such.
The area simply refuses to fire my script, it seems.
Now, in the Korcari Wilds case I call the first area in the list. This is not the case here - at least as far as I understand it (that would be the Redcliffe village exterior). Could that be an issue?
The chest does spawn treasure when opened, so there's nothing "wrong" with that, as such.
The area simply refuses to fire my script, it seems.
Now, in the Korcari Wilds case I call the first area in the list. This is not the case here - at least as far as I understand it (that would be the Redcliffe village exterior). Could that be an issue?
Modifié par fkirenicus, 17 mars 2011 - 06:17 .
#4
Posté 18 mars 2011 - 07:53
Either the script isn't running at all, or one or more of the resources identified is invalid. You could narrow that down by displaying or logging whether the resources are valid (which doubles as confirmation that the script is running).
AFAIK what you're doing is correct, in principle.
AFAIK what you're doing is correct, in principle.
#5
Posté 19 mars 2011 - 12:05
I just don't get this. The other area list in Redcliffe (the castle) works just fine. As does any other modification I've done, as far as I've been able to test them (done Denerim pre-Landsmeet, Broken Circle and Arl Eamon now).
The only real diiference I can find between area lists or areas that work and this which doesn't, is that the first time you enter Redcliffe there's a cutscene if Alistair is present. I therefore tried entering the area without Alistair, but that didn't help either.
Anyway, here are my resources -
* the entry for the area list Redcliffe village in my .GDA:
10107226 arl01al_redcliffe_village fk_add_arl170ar
* the entry in my plot file, 0fk_plot.plo :
FK_CHECK_ARL170AR (flag 26/33)
* the script, which is built on the same foundation as all the other scripts that work just fine. Note that the PrintLogToWindow does nothing in-game, so either I use it the wrong way, or the script doesn't actually fire (which is my suspicion):
#include "utility_h"
#include "plt_0fk_plot"
void main()
{
PrintToLog("fk_prcscr: BEGIN");
string areaTag = GetTag(GetArea(GetMainControlled()));
PrintToLog(" area: " + areaTag);
object oPlaceable = OBJECT_INVALID;
if ( WR_GetPlotFlag( PLT_0FK_PLOT, FK_CHECK_ARL170AR ) == TRUE ) return;
if (areaTag == "arl170ar_general_store")
{
oPlaceable = GetObjectByTag("arl170ip_dwarven_chest");
}
if (!IsObjectValid(oPlaceable)) return;
if (UT_CountItemInInventory(R"gen_im_cft_hrb_202.uti", oPlaceable) < 1)
{
PrintToLog("stocking items");
PrintToLogWindow("Script has fired!", "LogWindow");
CreateItemOnObject(R"gen_im_cft_hrb_202.uti", oPlaceable, 1, "", TRUE);
CreateItemOnObject(R"gen_im_copper.uti", oPlaceable, 11430, "", TRUE);
WR_SetPlotFlag( PLT_0FK_PLOT, FK_CHECK_ARL170AR, TRUE );
}
else
{
PrintToLog("no items!");
}
}
The only real diiference I can find between area lists or areas that work and this which doesn't, is that the first time you enter Redcliffe there's a cutscene if Alistair is present. I therefore tried entering the area without Alistair, but that didn't help either.
Anyway, here are my resources -
* the entry for the area list Redcliffe village in my .GDA:
10107226 arl01al_redcliffe_village fk_add_arl170ar
* the entry in my plot file, 0fk_plot.plo :
FK_CHECK_ARL170AR (flag 26/33)
* the script, which is built on the same foundation as all the other scripts that work just fine. Note that the PrintLogToWindow does nothing in-game, so either I use it the wrong way, or the script doesn't actually fire (which is my suspicion):
#include "utility_h"
#include "plt_0fk_plot"
void main()
{
PrintToLog("fk_prcscr: BEGIN");
string areaTag = GetTag(GetArea(GetMainControlled()));
PrintToLog(" area: " + areaTag);
object oPlaceable = OBJECT_INVALID;
if ( WR_GetPlotFlag( PLT_0FK_PLOT, FK_CHECK_ARL170AR ) == TRUE ) return;
if (areaTag == "arl170ar_general_store")
{
oPlaceable = GetObjectByTag("arl170ip_dwarven_chest");
}
if (!IsObjectValid(oPlaceable)) return;
if (UT_CountItemInInventory(R"gen_im_cft_hrb_202.uti", oPlaceable) < 1)
{
PrintToLog("stocking items");
PrintToLogWindow("Script has fired!", "LogWindow");
CreateItemOnObject(R"gen_im_cft_hrb_202.uti", oPlaceable, 1, "", TRUE);
CreateItemOnObject(R"gen_im_copper.uti", oPlaceable, 11430, "", TRUE);
WR_SetPlotFlag( PLT_0FK_PLOT, FK_CHECK_ARL170AR, TRUE );
}
else
{
PrintToLog("no items!");
}
}
Modifié par fkirenicus, 19 mars 2011 - 02:25 .
#6
Posté 20 mars 2011 - 11:04
Hm, strange.
Do you have script logging enabled?
If so, the script isn't running at all, so I'd check all the motherhood stuff, like typo in the script name, compilation errors, script / GDA in the wrong folder (or being overridden by a higher priority folder).
Grasping at straws, I notice that if you enter the village by night, the area list is (implicitly) arl101ar_redcliffe_night, so your script won't run (and the general store won't load, either).
Do you have script logging enabled?
If so, the script isn't running at all, so I'd check all the motherhood stuff, like typo in the script name, compilation errors, script / GDA in the wrong folder (or being overridden by a higher priority folder).
Grasping at straws, I notice that if you enter the village by night, the area list is (implicitly) arl101ar_redcliffe_night, so your script won't run (and the general store won't load, either).
#7
Posté 20 mars 2011 - 06:51
how exactly can you edit previously made levels? i can't seem to find the specific file to open in the toolset...
#9
Posté 28 mars 2011 - 09:11
I've run into the same problem in Haven village store, actually... Area list is correct, area tag is correct, chest tag is correct... But the items do not spawn. Now, I use the same structure everywhere, and it's so far (Landsmeet and climax only left now) only Redcliffe Village (Store ) and Haven Village (Store) that don't work. However, when I enter the area and run the script manually, the items that are supposed to spawn DO spawn... So I definately think that the scripts don't fire when entering the "main" areas (i.e. the entry area of the area list in question). Problem is, I have no bloody clue everything else seems to work just fine... :-S
There are area lists both for Ostagar & Korcari Wilds in the prelude, and e.g. Orzammar Mines (Caridin's Cross) and Ortan Thaig. These do work as they should.
There are area lists both for Ostagar & Korcari Wilds in the prelude, and e.g. Orzammar Mines (Caridin's Cross) and Ortan Thaig. These do work as they should.
Modifié par fkirenicus, 28 mars 2011 - 09:14 .
#10
Posté 29 mars 2011 - 06:22
I guess you spotted that in Haven the area list name is urn01al_ruined_village, which is not what you'd expect?
The Redcliffe area list also has an irregular name (arl01al_redcliffe_village).
The Redcliffe area list also has an irregular name (arl01al_redcliffe_village).
#11
Posté 29 mars 2011 - 06:33
No, I didn't pay those much attention, really... Are you suggesting that the area lists have "invalid" names (invalid in the sense that the PRCSCR won't recognize them properly)?
Does this also go for the Denerim Market? I've added one of my new dog set items to the Warden's Cache (the warehouse), if the Denerim Market area list also has a "bogus" resource name I may have to reconsider that...
What I have noticed though, is that I try to add to "sub-areas" of the main area in both the Redcliffe and Haven cases. In the other my modifications actually are in the entry area of the area list (at least as far as I know).
Does this also go for the Denerim Market? I've added one of my new dog set items to the Warden's Cache (the warehouse), if the Denerim Market area list also has a "bogus" resource name I may have to reconsider that...
What I have noticed though, is that I try to add to "sub-areas" of the main area in both the Redcliffe and Haven cases. In the other my modifications actually are in the entry area of the area list (at least as far as I know).
#12
Posté 29 mars 2011 - 06:49
If I want to avoid the entire problem by using a keyword rather than area list names, should I type any or "any" (yes, with quotation marks) in my PRCSCR? I don't think the toolset wiki is very clear on this...
#13
Posté 29 mars 2011 - 11:22
Doh!
Looking at your script again, I just noticed you check whether you're in the General Store area.
The wiki says that PRCSCR runs whenever the area list loads. You won't normally be in the General Store at that time (unless you start or save the game there).
If I'm right, it should work if you don't check the area. The chest won't be a valid object unless you're in the correct area list, owing to the naming convention.
The non-standard area list names shouldn't be a problem as long as you've used those names in the 2DA. Looking at the OP again, I guess you have?
If you decide to use the "any" keyword, I doubt whether you need the quotes.
Looking at your script again, I just noticed you check whether you're in the General Store area.
The wiki says that PRCSCR runs whenever the area list loads. You won't normally be in the General Store at that time (unless you start or save the game there).
If I'm right, it should work if you don't check the area. The chest won't be a valid object unless you're in the correct area list, owing to the naming convention.
The non-standard area list names shouldn't be a problem as long as you've used those names in the 2DA. Looking at the OP again, I guess you have?
If you decide to use the "any" keyword, I doubt whether you need the quotes.
Modifié par Proleric1, 29 mars 2011 - 11:57 .
#14
Posté 29 mars 2011 - 04:30
And... Voila! It works for the Haven case, so I presume it'll work also for the others.
Thanks!!
But I think I must check for the area as well somehow, since many of the placeables I've modfiied have "standard tags"; like e.g. genip_chest_iron. If several placeables in a script that runs on an area list have the same tag, I must be able to specify which of them (or, in which area) should be called, mustn't I...?
Any ideas how I can do this, without pointing to the GetMainControlled()?
Thanks!!
But I think I must check for the area as well somehow, since many of the placeables I've modfiied have "standard tags"; like e.g. genip_chest_iron. If several placeables in a script that runs on an area list have the same tag, I must be able to specify which of them (or, in which area) should be called, mustn't I...?
Any ideas how I can do this, without pointing to the GetMainControlled()?
Modifié par fkirenicus, 29 mars 2011 - 06:23 .
#15
Posté 30 mars 2011 - 07:16
You can either have a different script for each area list, or check whether the area you want to mod is a valid object.
AFAIK there's no direct way to discover the current area list by scripting.
If there are several objects with the same tag in an area list, you can certainly discover them all using the second parameter of GetObjectByTag (loop from 0 onwards until it returns an invalid object).
Perhaps you can use GetNearestObjectByTag to pinpoint the instance you want to mod (using a unique nearby object as the target). I haven't tested whether that works for objects in a different area, though.
AFAIK there's no direct way to discover the current area list by scripting.
If there are several objects with the same tag in an area list, you can certainly discover them all using the second parameter of GetObjectByTag (loop from 0 onwards until it returns an invalid object).
Perhaps you can use GetNearestObjectByTag to pinpoint the instance you want to mod (using a unique nearby object as the target). I haven't tested whether that works for objects in a different area, though.
Modifié par Proleric1, 30 mars 2011 - 08:06 .





Retour en haut






