Aller au contenu

Photo

NOOBish question -- Could not get script resource information


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

#1
sillyrobot

sillyrobot
  • Members
  • 171 messages
G'day All,

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
Phaenan

Phaenan
  • Members
  • 315 messages
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.

Modifié par Phaenan, 23 novembre 2009 - 02:03 .


#3
AND04

AND04
  • Members
  • 154 messages

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
AND04

AND04
  • Members
  • 154 messages
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



+ 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
Phaenan

Phaenan
  • Members
  • 315 messages
object oChest = CreateObject( OBJECT_TYPE_PLACEABLE, R"campchest.utc"

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...  :blush:

Modifié par Phaenan, 23 novembre 2009 - 02:14 .


#6
sillyrobot

sillyrobot
  • Members
  • 171 messages
Thanks for the help and the sharp eyes.

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
Phaenan

Phaenan
  • Members
  • 315 messages

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. :o

#8
sillyrobot

sillyrobot
  • Members
  • 171 messages
The WR* function definitions seem to be pulled in as part of utility_h. I'll include wrappers_h though.

#9
Phaenan

Phaenan
  • Members
  • 315 messages
Yeaaa~aah. Makes sense. I was prolly grabbing at straws here. ^^
Can't say I've any other idea, tho.

Modifié par Phaenan, 23 novembre 2009 - 02:44 .


#10
sillyrobot

sillyrobot
  • Members
  • 171 messages
I think I found it. My module definition had a bad script name defined. It looks like it had nothing to do with the script I was compliling. *Scratches head*.

Modifié par sillyrobot, 23 novembre 2009 - 02:47 .