![]() |
Bucket to fill with acid ?! - 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 (https://www.frictionalgames.com/forum/forum-35.html) +--- Thread: Bucket to fill with acid ?! (/thread-25902.html) Pages:
1
2
|
Bucket to fill with acid ?! - Amnesiaplayer - 08-19-2014 hello ![]() i'm here again and i want to know how to use an Empty bucket to fill it with acid... if you select the bucket and click on that barrel thing filled with acid...you get a bucket of acid... ( and with that you're gonna kill that slime ding... RE: Bucket to fill with acid ?! - burge4150 - 08-19-2014 Have you attempted the script at all? Give it a shot and see what you come up with, I'd be happy to help you from there. RE: Bucket to fill with acid ?! - Rector - 08-19-2014 What I believe you have to do is to use an interaction callback function that triggers when you use the empty bucket on the barrel with acid. I'm not the best scripter out there, but here's how I'd do it: 1: I'd place a script area right on top of the acid in the barrel. Name the area to whatever you want. 2: Then create this script function in the "void OnStart()" section: AddUseItemCallback(string& asName, string& asItem, string& asEntity, string& asFunction, bool abAutoDestroy); ...where string& asName is the internal name of the function, could be blank, but still requires "" to be put in to avoid errors. string& asItem is the name of the item (in your case, the bucket) that you will use it on. string& asEntity is the name of the script area you created earlier. string& asFunction is the name of the callback function; i.e. "void YourCallbackFunction" bool abAutoDestroy will determine if the item, in your case the bucket, will be destroyed when the callback is called. 3: Now you can use the bucket on the script area, which will be on top of the barrel, and therefore it will look like you're using the bucket right on the acid. Next thing you want to do is to add the filled bucket to your inventory. This is done by using this function: GiveItemFromFile(string& asName, string& asFileName) ...where string& asName is the internal name of the item, can be blank if you want to, and string& asFileName is the file name of the item. Remember to write down the full name, including the extention .ent I hope it helps! I'm in a hurry at the moment, so I just threw it all together really quickly ![]() RE: Bucket to fill with acid ?! - Mudbill - 08-19-2014 A slight correction: The bool abAutoDestroy does not remove the item you used. It removes the callback so that you cannot use the item again and produce the same effect. It's also supposedly recommended to use GiveItem instead of GiveItemFromFile. The latter is described as a debug function, although I do not know what limitations it can cause. RE: Bucket to fill with acid ?! - Amnesiaplayer - 08-19-2014 thankss!!! but i got 1 problem... i can touch it (nothing happens) but i can't use the bucket... and where must i place this ? GiveItemFromFile("", "chemical_container_full.ent"); i placed under the Other thing... ( bucket and acid) that look like this AddUseItemCallback("", "Bucket", "AcidArea", "Bucket", true); and there is no other script things about that bucket... please help me ![]() RE: Bucket to fill with acid ?! - Mudbill - 08-19-2014 You need to input the name "Bucket" into the first string for GiveItemFromFile. That will be the internal name for the item and if it's empty, it cannot be used. RE: Bucket to fill with acid ?! - Amnesiaplayer - 08-19-2014 no , i mean if i put my empty bucket to the acid container ( to GET the acid ) nothing happens ?! but i see a hand... ( that can touch , but nothing happens ) ... ( my whole script ) PHP Code: void OnStart() RE: Bucket to fill with acid ?! - Mudbill - 08-19-2014 You have no callback for it. Nothing will happen if you don't tell the script what to do. Right now you have made a check for when you use "Bucket" on "AcidArea" and you have named the callback "Bucket" but there is no "Bucket" callback to be found. What you need is something like this: PHP Code: void Bucket(string &in asItem, string &in asEntity) Inside this you need to add the scripts that will happen as you use the bucket on the acid area. Do you want to play particle effects? Use timers? Fill the bucket by replacing the empty one with one that is filled? Place those scripts in there. RE: Bucket to fill with acid ?! - Amnesiaplayer - 08-19-2014 i just only want to put that bucket in the acid and the empty is GONE and you got that fille with acid... i know how to remove but not how to get the acid... now i did this void Bucket(string &in asItem, string &in asEntity) { GiveItemFromFile("", "chemical_container_full.ent"); } and if i pick the bucket i get the chemical to |?! and it always doesn;t work if i put bucket in container ![]() RE: Bucket to fill with acid ?! - Mudbill - 08-19-2014 Firstly, you probably want to do PHP Code: RemoveItem(asItem); inside your callback. After that, if you wish, you can use SetEntityActive to enable a static bucket entity on the floor where you want it to appear, then change it to a pickup item of a bucket filled with acid which the player pick up into their inventory. If you only want the acid bucket to appear in their inventory as soon as you use the bucket, just remove the first item then give them the second. I suggest using SetMessage as well to help the player know what's going on. |