Frictional Games Forum (read-only)

Full Version: Script problem or Impulse problem?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey guys, I'm having a strange problem with a bunch of books I'm trying to launch off shelves. I'll show you my script and tell you what works and doesn't work:


AddEntityCollideCallback("Player", "prebiblescript", "books", true, 1);
AddEntityCollideCallback("Player", "biblescript", "bible", true, 1);


void books(string&in asParent, string &in asChild, int alState)
{
if (HasItem("letterkey"))
{
PlaySoundAtEntity("", "12_girl_scream.snt", "Player", 0, false);
SetEntityActive("shelf01_scriptable_*", true);
SetEntityActive("book_bible_*", true);
SetEntityActive("biblescript", true);
}
}


void bible(string&in asParent, string &in asChild, int alState)
{
AddPropImpulse("book_bible_*", 20.0f, 0.0f, 0.0f, "world");
PlaySoundAtEntity("", "scare_wall_stomp.snt", "Player", 0, false);
GiveSanityDamage(10.0f, true);
}

Basically, the function "books" works, but "bible" doesn't. I can't figure out why. Is it because the function is prevented by the will of God? Tongue
So does your GiveSanityDamage and PlaySoundAtEntity work normally but not the impulse?
With AddPropImpulse you have to play around with the amounts to see if it really works or if you use too low values. You might also want to try the same with AddPropForce, there was some slight difference with those 2 functions but I don't remember what.
(09-17-2011, 09:02 AM)Khyrpa Wrote: [ -> ]So does your GiveSanityDamage and PlaySoundAtEntity work normally but not the impulse?
With AddPropImpulse you have to play around with the amounts to see if it really works or if you use too low values. You might also want to try the same with AddPropForce, there was some slight difference with those 2 functions but I don't remember what.
No, none of it worked, which makes me think that something's wrong with the callback itself. but I don't know what. I don't hear any sound at all when it happens. I know that before I had typed the wrong syntax thingy next to the function name, but I fixed that. Now I don't know what to do @_@
You've got an impulse of 20. Increase this value dramatically to around probably 200-1000. Should work fine from there. Also make sure that it's launched in the correct direction on the x-axis by using positive or negative numbers.
If youre in doubt, just create everything from start. Re-check names and try out things like debug messages (or FadeOut(0); that I use for some reason) to see if the callback happens but something else doesn't.
I've checked all the names, and retested it, and now "books" won't even work. What the hell just happened?? Sad
(09-17-2011, 05:01 PM)Obliviator27 Wrote: [ -> ]You've got an impulse of 20. Increase this value dramatically to around probably 200-1000. Should work fine from there. Also make sure that it's launched in the correct direction on the x-axis by using positive or negative numbers.
Listen to this guy. I'm completely new to this thing, but I remember reading that you need an impulse of about 200, maybe even 2000 to even see any action.
(09-18-2011, 03:58 AM)RainbowDash Wrote: [ -> ]
(09-17-2011, 05:01 PM)Obliviator27 Wrote: [ -> ]You've got an impulse of 20. Increase this value dramatically to around probably 200-1000. Should work fine from there. Also make sure that it's launched in the correct direction on the x-axis by using positive or negative numbers.
Listen to this guy. I'm completely new to this thing, but I remember reading that you need an impulse of about 200, maybe even 2000 to even see any action.
It doesn't matter though. Even if the impulse doesn't work, shouldn't I be hearing at least the sounds? the sounds don't work either. It's some sort of script problem.
Is the script area named "biblescript"?
Is the callback for it in OnStart?
(09-18-2011, 05:31 AM)MrBigzy Wrote: [ -> ]Is the script area named "biblescript"?
Is the callback for it in OnStart?
The scriptarea for "bible" is "biblescript"
And everything is under OnEnter. Should I move all my AddEntityCollideCallbacks to OnStart? What's the difference between OnStart and OnEnter?
Pages: 1 2