Frictional Games Forum (read-only)
Something weird is happening with 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: Something weird is happening with my script. (/thread-21999.html)



Something weird is happening with my script. - The chaser - 07-02-2013

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?


RE: Something weird is happening with my script. - Adrianis - 07-02-2013

So does nothing at all from that function work, as in, there's no sound playing & no particles showing? And there is no error?


RE: Something weird is happening with my script. - Wapez - 07-02-2013

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




RE: Something weird is happening with my script. - The chaser - 07-02-2013

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.


RE: Something weird is happening with my script. - 7heDubz - 07-03-2013

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


RE: Something weird is happening with my script. - Daemian - 07-03-2013

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?


RE: Something weird is happening with my script. - The chaser - 07-03-2013

Weird, apparently it breaks if I put "Player" instead "Sledge_1"...

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