Frictional Games Forum (read-only)
[SCRIPT] Custom item and Give Item script help - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Custom item and Give Item script help (/thread-12181.html)



Custom item and Give Item script help - jssjr90 - 12-29-2011

Ok so I have a custom item that I have modified, I turned one of the entities from the game, "Note_generic1" into a puzzle item though the model editor, saved it to its own folder with its required recourse's. I also have its own item picture. But I come across 2 problems.

One of my problems is that when I put the new item in the game, it does not have its glow around the object, it acts like a static object. How can I make it to where when I want to pick up it gives me that custom item in my inventory?

Also how to I use Give Item script properly? I have tried giving the player the custom item from the start. This is part of the script:
//
GiveItem("note_generic", "note_generic", "Funeral Bill", note_generic.png, 1);

But it comes up with errors saying this:
note_generic is not declared.

It also states in the function that the object does not half to be in the world.

Can anybody help me out on this? This is the one thing im truly stumped on, im also the one working on that custom story "The Hands That Resist Him" So if anybody can help me out on these 2 problems I would be grateful.





RE: Custom item and Give Item script help - Obliviator27 - 12-29-2011

(12-29-2011, 09:19 PM)jssjr90 Wrote: Ok so I have a custom item that I have modified, I turned one of the entities from the game, "Note_generic1" into a puzzle item though the model editor, saved it to its own folder with its required recourse's. I also have its own item picture. But I come across 2 problems.

One of my problems is that when I put the new item in the game, it does not have its glow around the object, it acts like a static object. How can I make it to where when I want to pick up it gives me that custom item in my inventory?

Also how to I use Give Item script properly? I have tried giving the player the custom item from the start. This is part of the script:
//
GiveItem("note_generic", "note_generic", "Funeral Bill", note_generic.png, 1);

But it comes up with errors saying this:
note_generic is not declared.

It also states in the function that the object does not half to be in the world.

Can anybody help me out on this? This is the one thing im truly stumped on, im also the one working on that custom story "The Hands That Resist Him" So if anybody can help me out on these 2 problems I would be grateful.



As far as your first issue goes, you need to have the .ent file altered in the ModelEditor in order to make it an item (Found under User Defined Variables) Not sure if you've done this already, but it doesn't hurt to suggest such a thing.

Second issue is simply putting quotation marks around note_generic.png. It'll then look for a phrase instead of a variable in the script.




RE: Custom item and Give Item script help - jssjr90 - 12-29-2011

Well I did alter it to a puzzle item like I said in the post, I can now take the note, but it picks it up like it is a note, and does not appear in my inventory.

Also on the 2nd thing of give item, I did do that, did not have any fatal errors, but it still will not appear in my inventory! Why must this be so frustrating! I give up! Jk, but still this is just uhhhh.


RE: Custom item and Give Item script help - Your Computer - 12-29-2011

(12-29-2011, 09:36 PM)jssjr90 Wrote: Well I did alter it to a puzzle item like I said in the post, I can now take the note, but it picks it up like it is a note, and does not appear in my inventory.

Also on the 2nd thing of give item, I did do that, did not have any fatal errors, but it still will not appear in my inventory! Why must this be so frustrating! I give up! Jk, but still this is just uhhhh.

Altering it is one thing; giving the file a name that differs from the original so that the game doesn't revert to the original .ent file is another thing.