Frictional Games Forum (read-only)
bug in my script! - 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: bug in my script! (/thread-8754.html)

Pages: 1 2


bug in my script! - SLAMnesia - 06-22-2011

heres my script:

AddUseItemCallback("", "shank1", "shanktegrunt", "ShankFunc", true);

void ShankFunc(string &in asItem, string &in asEntity)
{
SetEntityActive("shanktegrunt", false);
RemoveItem("shank1");
}

it doesnt error, it just doesnt work (its very basic I know) but is there some game error where you cant use the "ceremony_knife.ent" on a grunt? I want the player to shank the grunt with it and (for now) have the grunt disappear but he doesnt :\


RE: bug in my script! - Roenlond - 06-22-2011

ehm, where's your void OnStart()?


RE: bug in my script! - rojkish - 06-22-2011

(06-22-2011, 09:27 PM)Roenlond Wrote: ehm, where's your void OnStart()?

Probably he just simply left it out. Perhaps you could make an area as large as the grunt? iirc you can use items on areas


RE: bug in my script! - SLAMnesia - 06-22-2011

yeah, but how do i make the area stick to the grunt?
and i left out the void OnStart of course


RE: bug in my script! - rojkish - 06-23-2011

You can't. Perhaps you should remake the scene to something else, it sucks I know, done it several times. Just find another solution than stabbing him.


RE: bug in my script! - xiphirx - 06-23-2011

Put the callback in onStart if you want it to work...


RE: bug in my script! - Rownbear - 06-23-2011

Try the
void FadeEnemyToSmoke(string& asName, bool abPlaySound);
Instantly fades an enemy to smoke.

if just deactivate doesnt work

void ShankFunc(string &in asItem, string &in asEntity)
{
FadeEnemyToSmoke("shankthegrunt", false);
RemoveItem("shank1");
}


RE: bug in my script! - rojkish - 06-23-2011

(06-23-2011, 03:31 AM)Rownbear Wrote: Try the
void FadeEnemyToSmoke(string& asName, bool abPlaySound);
Instantly fades an enemy to smoke.

if just deactivate doesnt work

void ShankFunc(string &in asItem, string &in asEntity)
{
FadeEnemyToSmoke("shankthegrunt", false);
RemoveItem("shank1");
}

Everything works out fine. Except the part where you use the dagger on the grunt, it doesn't work like that. So either he'll need another item, or perhaps a script area, or just rethink and do something new.


RE: bug in my script! - Rownbear - 06-23-2011

(06-23-2011, 03:34 AM)rojkish Wrote:
(06-23-2011, 03:31 AM)Rownbear Wrote: Try the
void FadeEnemyToSmoke(string& asName, bool abPlaySound);
Instantly fades an enemy to smoke.

if just deactivate doesnt work

void ShankFunc(string &in asItem, string &in asEntity)
{
FadeEnemyToSmoke("shankthegrunt", false);
RemoveItem("shank1");
}

Everything works out fine. Except the part where you use the dagger on the grunt, it doesn't work like that. So either he'll need another item, or perhaps a script area, or just rethink and do something new.

I played a custom story where I used the dagger on the grunt, and you "killed" it. So it's possible with the dagger entity.


RE: bug in my script! - rojkish - 06-23-2011


Quote:I played a custom story where I used the dagger on the grunt, and you "killed" it. So it's possible with the dagger entity.

Were the grunt standing still? In that case it seems pretty clear. Otherwise, could you perhaps link a script which works like that? It just seems weird since it didn't work out for me.