Frictional Games Forum (read-only)

Full Version: bug in my script!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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 :\
ehm, where's your void OnStart()?
(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
yeah, but how do i make the area stick to the grunt?
and i left out the void OnStart of course
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.
Put the callback in onStart if you want it to work...
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");
}
(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.
(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.

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.
Pages: 1 2