Frictional Games Forum (read-only)

Full Version: Something weird is happening with my script.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was making a final script for a level of mine, where you have to hit a wall with a sledge to destroy it, so you can go to the other side. However, when I hit the area with the sledge, nothing happens.


Code:
void OnStart()
{
AddEntityCollideCallback("Sledge_1", "Area_use_sledge", "Destroywall", true, 1);
}

void Destroywall (string &in asParent, string &in asChild, int alState)
{
SetEntityActive("cracks_brown_1", false);
SetEntityActive("cellarbase_wall_cracked_2", false);
SetEntityActive("cellarbase_wall_cracked_1", false);
SetEntityActive("cellarbase_wall_destroyable_1", true);
CreateParticleSystemAtEntity("Particle_dust", "ps_dust_break_25.ps", "Area_use_sledge", false);
PlaySoundAtEntity("Destroydawall", "explosion_rock_large.snt", "Player", 0.1, false);
}

The curious thing is that if I try exactly the same script with the exact names in another map, it works...

Any clue of this?
So does nothing at all from that function work, as in, there's no sound playing & no particles showing? And there is no error?
  • Double check all the names in the HPL Level Editor
  • Double check all the names in the script
  • Make sure that there is no other function in your script that might trigger this one to not work
  • Remove the space after calling the Destroywall function

    Code:
    void Destroywall (string &in asParent, string &in asChild, int alState)
    Should be:
    Code:
    void Destroywall(string &in asParent, string &in asChild, int alState)

    That's all I got for now. If it still doesn't work, send me the files and I'll fix it for you.

Well, now that I realize, I haven't told much from the necessary:

-There is no map_cache
-The names are okay
-I tried the EXACT script in another map, with the SAME names and it worked
-It doesn't give any kind of error, it just doesn't work.

Well, I'll just send the files to Wapez, to see if he can fix it.
(07-02-2013, 02:24 PM)The chaser Wrote: [ -> ]Well, now that I realize, I haven't told much from the necessary:

-There is no map_cache
-The names are okay
-I tried the EXACT script in another map, with the SAME names and it worked
-It doesn't give any kind of error, it just doesn't work.

Well, I'll just send the files to Wapez, to see if he can fix it.

in the script put in a debug message and then try to do it in the unworking map again. do you get the debug message?
This happened to me once, but i don't remember what was the problem right now.

I think i had the area disabled. You should check that.
And your script is not long, why don't you just make it again from scratch?
Weird, apparently it breaks if I put "Player" instead "Sledge_1"...

I will have to search a similar item to make the effect Sad