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
Multiple Issues Help Script collapse.
ExpectedIdentifier Offline
Member

Posts: 234
Threads: 10
Joined: Sep 2012
Reputation: 11
#2
RE: Script collapse.

(07-21-2013, 05:09 PM)Icaab2608 Wrote: At me a problem with a script:
PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player""Collapse""Collapse"true1)
}
void Collapse(string &in asParentstring &in asChildint alState)
{
SetEntityActive("servant_nyan_2"false);
SetEntityActive("thin_straight_long_1"false);
SetEntityActive("drag_brown_rock_1"false);
SetEntityActive("block_box_nonchar_1"false);

SetEntityActive("thin_straight_long_2"true);
SetEntityActive("drag_brown_rock_1"true);
SetEntityActive("drag_brown_rock_2"true);
SetEntityActive("drag_brown_rock_3"true);
SetEntityActive("drag_brown_rock_4"true);
SetEntityActive("drag_brown_rock_5"true);
SetEntityActive("drag_brown_rock_6"true);
SetEntityActive("drag_brown_rock_7"true);
SetEntityActive("drag_brown_rock_8"true);
SetEntityActive("drag_brown_rock_9"true);
SetEntityActive("drag_brown_rock_10"true);
SetEntityActive("drag_brown_rock_11"true);
SetEntityActive("drag_brown_rock_12"true);
SetEntityActive("drag_brown_rock_13"true);
SetEntityActive("drag_brown_rock_14"true);
SetEntityActive("drag_brown_rock_15"true);
SetEntityActive("drag_brown_rock_16"true);
SetEntityActive("drag_brown_rock_17"true);
SetEntityActive("drag_brown_rock_18"true);
SetEntityActive("drag_brown_rock_19"true);
SetEntityActive("drag_brown_rock_20"true);
SetEntityActive("drag_brown_rock_21"true);
SetEntityActive("drag_brown_rock_22"true);
SetEntityActive("drag_brown_rock_23"true);
SetEntityActive("drag_brown_rock_24"true);
SetEntityActive("drag_brown_rock_25"true);
SetEntityActive("drag_brown_rock_26"true);
SetEntityActive("drag_brown_rock_27"true);
SetEntityActive("drag_brown_rock_28"true);
SetEntityActive("drag_brown_rock_29"true);
SetEntityActive("brown_cave_in_1"true);
SetEntityActive("brown_cave_in_2"true);
SetEntityActive("stone_small01_brown_1"true);
SetEntityActive("stone_small01_brown_2"true);
SetEntityActive("stone_small01_brown_3"true);
SetEntityActive("stone_small01_brown_4"true);
SetEntityActive("stone_med01_brown_1"true);
StopMusic(3.00);
DestroyParticleSystem("ParticleSystem_1");
DestroyParticleSystem("ParticleSystem_2");
DestroyParticleSystem("ParticleSystem_5");
DestroyParticleSystem("ParticleSystem_6");
DestroyParticleSystem("ParticleSystem_14");
DestroyParticleSystem("ParticleSystem_19");
DestroyParticleSystem("ParticleSystem_15");
DestroyParticleSystem("ParticleSystem_62");
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_1"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_2"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_3"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_4"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_5"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_6"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_7"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_8"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_9"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_10"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_11"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_12"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_13"true);
CreateParticleSystemAtEntity("""ps_childsnake_water_stream.ps""PS1_14"true);
CreateParticleSystemAtEntity("""ps_steam.ps""PS1_15"true);
CreateParticleSystemAtEntity("""ps_steam.ps""PS1_16"true);
CreateParticleSystemAtEntity("""ps_steam.ps""PS1_17"true);
CreateParticleSystemAtEntity("""ps_steam.ps""PS2_1"true);
CreateParticleSystemAtEntity("""ps_steam.ps""PS2_2"true);
CreateParticleSystemAtEntity("""ps_steam.ps""PS2_3"true);
PreloadParticleSystem("ps_dust_whirl");

Huh
[img][Image: bandicam20_4872334_8520422.jpg][/img]



The error is,that not all objects become active.

Some entities can't be set active/unactive. These are StaticProp entities. Also static objects can't be set active/unactive. I'm assuming this is your problem.

Also a little tip, when doing something to multiple objects, it is better and less time consuming to use a for loop, like this:

PHP Code: (Select All)
for(int i 0<31i++)
SetEntityActive("rock_"+itrue); 

This would set all entity rocks named rock_1 to rock_30 active.

Closure ModDB page:

[Image: 16LO8Sx]
07-21-2013, 05:38 PM
Find


Messages In This Thread
Script collapse. - by Icaab2608 - 07-21-2013, 05:09 PM
RE: Script collapse. - by ExpectedIdentifier - 07-21-2013, 05:38 PM
RE: Script collapse. - by ClayPigeon - 07-21-2013, 05:42 PM



Users browsing this thread: 1 Guest(s)