Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bucket to fill with acid ?!
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#1
Bucket to fill with acid ?!

hello Big Grin
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...
08-19-2014, 02:46 PM
Find
burge4150 Offline
Member

Posts: 56
Threads: 15
Joined: Feb 2014
Reputation: 0
#2
RE: Bucket to fill with acid ?!

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.
08-19-2014, 03:06 PM
Find
Rector Offline
Junior Member

Posts: 21
Threads: 5
Joined: Apr 2013
Reputation: 0
#3
RE: Bucket to fill with acid ?!

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 Smile If you need any further help, just PM me, I'll be happy to assist!
08-19-2014, 03:13 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: Bucket to fill with acid ?!

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.

08-19-2014, 05:36 PM
Find
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#5
RE: Bucket to fill with acid ?!

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 Sad
08-19-2014, 07:15 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#6
RE: Bucket to fill with acid ?!

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.

08-19-2014, 07:44 PM
Find
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#7
RE: Bucket to fill with acid ?!

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: (Select All)
void OnStart()
{
SetEntityPlayerInteractCallback("note3""ShowSteve"false);
AddUseItemCallback("""Acidkey""Aciddoor""UsedKeyOnDoor"true);
AddUseItemCallback("""Bucket""AcidArea""Bucket"true);
GiveItemFromFile("Bucket""chemical_container_full.ent");
PlayMusic("12_amb"true0.7f10false);
}

void ShowSteve(string &in asEntity)
{
SetEntityActive("Cellarsteve"true);
ShowEnemyPlayerPosition("Cellarsteve");


void UsedKeyOnDoor (string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("Aciddoor"falsetrue);
PlaySoundAtEntity("""unlock_door.snt""Aciddoor"0false);
RemoveItem("Acidkey");

(This post was last modified: 08-19-2014, 07:50 PM by Amnesiaplayer.)
08-19-2014, 07:45 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#8
RE: Bucket to fill with acid ?!

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: (Select All)
void Bucket(string &in asItemstring &in asEntity)
{
    
//Whatever scripts you want to happen here.


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.

08-19-2014, 07:55 PM
Find
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#9
RE: Bucket to fill with acid ?!

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 Sad is there something wrong in script about that or in level editor ??
08-19-2014, 08:05 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#10
RE: Bucket to fill with acid ?!

Firstly, you probably want to do
PHP Code: (Select All)
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.

08-19-2014, 08:20 PM
Find




Users browsing this thread: 2 Guest(s)