NOOBish question -- Could not get script resource information
#1
Posté 23 novembre 2009 - 01:48
As a place to start, I'm trying to build a camp chest (original I know...)
I built my placeable and am constructing the spawn script for it. I'm getting the error in the title (Could not get script resource information.) and don't know enough to understand what the error is trying to say or what I should be looking for.
I have checked-in the placeable "campchest.utp" and the plot "mgltest3plot.plo". I found the tag "cam100ar_camp_plains" in a different mod as a tag to the player camp.
Any help would be appreciated.
My code is below:
#include "utility_h"
#include "plt_mgltest3plot"
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
switch ( nEventType )
{
case EVENT_TYPE_MODULE_LOAD:
if ( WR_GetPlotFlag( PLT_MGLTEST3PLOT, CHESTADDEDTOCAMP ) == 0 )
{
object oCamp = GetObjectByTag("cam100ar_camp_plains", 0);
vector vChestLocation = Vector(148.77, 117.68, -0.94);
object oChest = CreateObject( OBJECT_TYPE_PLACEABLE, R"campchest.utc",
Location(oCamp, vChestLocation, 0.0));
WR_SetPlotFlag( PLT_MGLTEST3PLOT, CHESTADDEDTOCAMP, 1 );
}
break;
default:
break;
}
}
#2
Posté 23 novembre 2009 - 02:02
Anyway.
I'm not sure GetObjectByTag() works for areas. You may want to try :
object oCamp = GetArea(GetHero());
And see if it does change anything.
Modifié par Phaenan, 23 novembre 2009 - 02:03 .
#3
Posté 23 novembre 2009 - 02:06
Phaenan wrote...
I have to say the toolset compiler error messages are truly compiler style. Those things always loved unfanthomable messages.
Anyway.
I'm not sure GetObjectByTag() works for areas. You may want to try :
object oCamp = GetArea(GetHero());
And see if it does change anything.
it does work - though i usually don't give the 2nd Param for an Area,
#4
Posté 23 novembre 2009 - 02:11
+ check if your Area is valid before you use it (with IsObjectValid) and just to be sure better use a IsLocationValid() check too - i guess the script won't break without it - but its bad style.
#5
Posté 23 novembre 2009 - 02:13
I think I found it. Isn't your resource a placeable/utp ?
Aa~ahh, the overjoy of typos making you pull your hair out for hours...
Modifié par Phaenan, 23 novembre 2009 - 02:14 .
#6
Posté 23 novembre 2009 - 02:23
I have a bit more information.
I've corrected the .utc to .utp.
I literally commented all lines other than void main() and the main braces and am still getting the error. Is there another file / resource / item I need to define first?
ahh - well for your problem - you didn't name the plot the same as what your trying to include - hence couldn't find the ressource
The tutorial I was reading implied the include name should be the resource main with the prefix "PLT_" to inform the compliler that it is a plot file. Was that incorrect? My plot is named mgltest3plot.plo so I figured the include should be PLT_MGLTEST3PLOT.
Modifié par sillyrobot, 23 novembre 2009 - 02:27 .
#7
Posté 23 novembre 2009 - 02:28
The tutorial I was reading implied the include name should be the resource main with the prefix "PLT_" to inform the compliler that it is a plot file. Was that incorrect? My plot is named mgltest2plot.plo so I figured the include should be PLT_MGLTEST3PLOT.
No, that part is correct. If your plot resource name is xxxxx, you have to include plt_xxxxx indeed.
You're missing a #include "wrappers_h" tho, since you're using WR_* functions. Didn't spot that earlier.
#8
Posté 23 novembre 2009 - 02:32
#9
Posté 23 novembre 2009 - 02:44
Can't say I've any other idea, tho.
Modifié par Phaenan, 23 novembre 2009 - 02:44 .
#10
Posté 23 novembre 2009 - 02:47
Modifié par sillyrobot, 23 novembre 2009 - 02:47 .





Retour en haut






