Frictional Games Forum (read-only)

Full Version: Trying to stab a pig!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
... but i cant get it to work! Sad
The deal is that you are suppose to get a key in you inventory when you have stabbed it.
When i try to use the dagger at the pig it says something like: "cannot use item this way".

Here is my script for it:


void OnStart()
{
AddEntityCollideCallback("ceremony_knife_1", "pig_corpse_1", "pig_stab", "true", 1);
}


void pig_stab(string &in asParent, string &in asChild, int alState)
{
GiveItem("Player", "key_torture_chamber_1", "key_torture_chamber_1", "key_torture_chamber_1.tga", 1);
GiveSanityBoostSmall();
}

Can someone help me?!

Thanks!
Grab a dagger ("ceremony_knife_1")
Take out the dagger and prepare it (use it through your inventory)
Take a touch at the pig with the dagger (use it to the pig)
The dagger hits the pigs flesh physically (AddUseItemCallback)
Blood spills around and it makes noises (CreateParticleSystemAtEntity, PlaySoundAtEntity)
etc.

search the stuff from engine script page

doubt that makes any sense... This should:

void OnStart()
{
AddUseItemCallback("", "ceremony_knife_1", "pig_corpse_1", "pig_stab", true);
}
I have changed so i now have this:

void OnStart()
{
AddUseItemCallback("", "ceremony_knife_1", "pig_corpse_1", "pig_stab", true);

}


void pig_stab(string &in asParent, string &in asChild, int alState)
{
GiveItem("Player", "key_torture_chamber_1", "key_torture_chamber_1", "key_torture_chamber_1.tga", 1);
GiveSanityBoostSmall();
}

What do i need to change?
Anyone ? Please!
You are using the wrong syntax for AddUseItemCallback

Replace

(string &in asParent, string &in asChild, int alState)


With

(string &in asItem, string &in asEntity)
(01-16-2012, 03:03 AM)flamez3 Wrote: [ -> ]You are using the wrong syntax for AddUseItemCallback

Replace

(string &in asParent, string &in asChild, int alState)


With

(string &in asItem, string &in asEntity)
Thank you! The combining of the two items work now! Now i will only need to get the Give item line right!
Yes i got it to work!!! Smile Thanks to all of you!
I smell another PewDiePie map...*sigh*..
(01-17-2012, 09:37 AM)Shadowfied Wrote: [ -> ]I smell another PewDiePie map...*sigh*..
No.. actually i have only seen stabbing a pig like one or two other times in custom stories. And i watch every video pewdiepie plays. I think stabbing human bodies have been used more.

TBH i also think there are too many pewdiepie maps out there. And just to prove that this isn't a pewdiepie map... There isn't a "Stephano" in every room.
(01-17-2012, 01:28 PM)oscar1007 Wrote: [ -> ]
(01-17-2012, 09:37 AM)Shadowfied Wrote: [ -> ]I smell another PewDiePie map...*sigh*..
No.. actually i have only seen stabbing a pig like one or two other times in custom stories. And i watch every video pewdiepie plays. I think stabbing human bodies have been used more.

TBH i also think there are too many pewdiepie maps out there. And just to prove that this isn't a pewdiepie map... There isn't a "Stephano" in every room.
If it's not a PewDiePie map you leave those godforsaken statues out of the entire custom story.