Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script problem or Impulse problem?
Bennick Offline
Member

Posts: 77
Threads: 27
Joined: Apr 2011
Reputation: 0
#1
Script problem or Impulse problem?

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

Fratricide (title not finalized): 2/7 maps. :D
09-17-2011, 06:56 AM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#2
RE: Script problem or Impulse problem?

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
Find
Bennick Offline
Member

Posts: 77
Threads: 27
Joined: Apr 2011
Reputation: 0
#3
RE: Script problem or Impulse problem?

(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 @_@

Fratricide (title not finalized): 2/7 maps. :D
09-17-2011, 03:26 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#4
RE: Script problem or Impulse problem?

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.
09-17-2011, 05:01 PM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#5
RE: Script problem or Impulse problem?

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.

09-17-2011, 05:02 PM
Find
Bennick Offline
Member

Posts: 77
Threads: 27
Joined: Apr 2011
Reputation: 0
#6
RE: Script problem or Impulse problem?

I've checked all the names, and retested it, and now "books" won't even work. What the hell just happened?? Sad

Fratricide (title not finalized): 2/7 maps. :D
09-17-2011, 09:16 PM
Find
RainbowDash Offline
Junior Member

Posts: 15
Threads: 3
Joined: Sep 2011
Reputation: 0
#7
RE: Script problem or Impulse problem?

(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
Find
Bennick Offline
Member

Posts: 77
Threads: 27
Joined: Apr 2011
Reputation: 0
#8
RE: Script problem or Impulse problem?

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

Fratricide (title not finalized): 2/7 maps. :D
09-18-2011, 04:32 AM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#9
RE: Script problem or Impulse problem?

Is the script area named "biblescript"?
Is the callback for it in OnStart?
09-18-2011, 05:31 AM
Find
Bennick Offline
Member

Posts: 77
Threads: 27
Joined: Apr 2011
Reputation: 0
#10
RE: Script problem or Impulse problem?

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

Fratricide (title not finalized): 2/7 maps. :D
09-18-2011, 06:09 AM
Find




Users browsing this thread: 1 Guest(s)