Jump to content

Home

Script/placing help


TriggerGod

Recommended Posts

I haven't had one of these in a while :p

 

First off; the purpose: I have this saber I made the other night, and it is almost ready for release, except for this one issue; the box I spawned won't open.

 

Using Redhawke's Spawning Tut, I was able to spawn a metal box.

 

My old script:

void main()
{
object oLocker=CreateObject( OBJECT_TYPE_PLACEABLE, "lcker_saber", Location(Vector(-56.55119, 53.20418, -0.00007), 0.0)); 

CreateItemOnObject("item_resref", oLocker);
}

My box spawned correctly, but it was un-openable. So, I tried adding my item to the box's utp file, and removing the CreateItem line, so my new script is...

void main()
{
object oLocker=CreateObject( OBJECT_TYPE_PLACEABLE, "lcker_saber", Location(Vector(-56.55119, 53.20418, -0.00007), 0.0)); 

}

 

And it was still unopenable.

 

So, is there a solution for my problem, because I sure haven't found one.

Link to comment
Share on other sites

  • 2 weeks later...

Alright, thanks, both of you. Well, I'm almost done with my mod, and I have a problem. I changed one of my boxes' appearance to that of a locker, and put one of my sabers in there. I set up my script, and it works correctly. It spawns when I wanted it to spawn, and where I wanted it to spawn. But, my new problem is that the locker is empty, when I know I put one of the sabers in there. I even double checked the placeable's inventory, the saber is there, but not in the game. I even tried to make the locker back into a metal box (which I like more), but that didn't work (to my surprise...) I made sure I did everything right...

Link to comment
Share on other sites

Are you spawning an item into the locker or is the item already inside the locker?
The item is already in the locker. I can try to make it empty in the utp and have the item be created when the locker is spawned.

Check the Template ResRefs, it could be the reason.

No; thats not it.

Link to comment
Share on other sites

The item is already in the locker. I can try to make it empty in the utp and have the item be created when the locker is spawned.

 

Try that.

 

Puzzles me. The only reason that I know of for the item not showing up in the locker is either the game can't locate the item or the wrong placeable is spawned. You checking the template resrefs rules out both options.

 

- Star Admiral

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...