Frictional Games Forum (read-only)
Trying to stab a pig! - 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: Trying to stab a pig! (/thread-12617.html)



Trying to stab a pig! - oscar1007 - 01-15-2012

... 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!


RE: Trying to stab a pig! - Khyrpa - 01-15-2012

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);
}



RE: Trying to stab a pig! - oscar1007 - 01-15-2012

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!


RE: Trying to stab a pig! - flamez3 - 01-16-2012

You are using the wrong syntax for AddUseItemCallback

Replace

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


With

(string &in asItem, string &in asEntity)



RE: Trying to stab a pig! - oscar1007 - 01-16-2012

(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!


RE: Trying to stab a pig! - Shadowfied - 01-17-2012

I smell another PewDiePie map...*sigh*..



RE: Trying to stab a pig! - oscar1007 - 01-17-2012

(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.


RE: Trying to stab a pig! - Shadowfied - 01-17-2012

(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.