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
Scripting Problem?
TheNextLevelz Offline
Junior Member

Posts: 9
Threads: 4
Joined: Sep 2013
Reputation: 0
#1
Scripting Problem?

I dont know what to do but what I wan't is that I move into an area and that things are appearing... I dont get any "FATAL ERROR" but it just won't work..
this is my script:

void OnStart()
{
PlayMusic("01_amb_darkness.ogg", true, 1, 1, 1, false);
AddEntityCollideCallback("Player", "Jumpscare_1", "Jump1", true, 1);
AddEntityCollideCallback("Player", "lols", "Jump2", true, 1);
}

void Jump1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "24_iron_maiden.ogg", "Player", 0, false);
SetEntityActive("bro_1", true);
AddTimer("", 0.7f, "scared");
}

void Jump2(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "01_tiny1.ogg", "Player", 0, false);
SetEntityActive("deformed_man_1", true);
SetEntityActive("deformed_man_2", true);
SetEntityActive("deformed_man_3", true);
SetEntityActive("deformed_man_4", true);
SetEntityActive("deformed_man_5", true);
SetEntityActive("deformed_man_6", true);
SetEntityActive("deformed_man_7", true);
SetEntityActive("deformed_man_8", true);
SetEntityActive("deformed_man_9", true);
SetEntityActive("deformed_man_10", true);
SetEntityActive("deformed_man_11", true);
SetEntityActive("deformed_man_12", true);
SetEntityActive("deformed_man_13", true);
SetEntityActive("deformed_man_14", true);
SetEntityActive("deformed_man_15", true);
SetEntityActive("deformed_man_16", true);
SetEntityActive("deformed_man_17", true);
SetEntityActive("deformed_man_18", true);
SetEntityActive("deformed_man_19", true);
SetEntityActive("deformed_man_20", true);
SetEntityActive("deformed_man_21", true);
SetEntityActive("deformed_man_22", true);
SetEntityActive("deformed_man_23", true);
SetEntityActive("deformed_man_24", true);
SetEntityActive("deformed_man_25", true);
SetEntityActive("deformed_man_26", true);
SetEntityActive("deformed_man_27", true);
SetEntityActive("deformed_man_28", true);
SetEntityActive("deformed_man_29", true);
SetEntityActive("deformed_man_30", true);
SetEntityActive("deformed_man_31", true);
SetEntityActive("deformed_man_32", true);
SetEntityActive("deformed_man_34", true);
SetEntityActive("deformed_man_35", true);
SetEntityActive("deformed_man_36", true);
SetEntityActive("deformed_man_37", true);
SetEntityActive("deformed_man_38", true);
SetEntityActive("deformed_man_39", true);
SetEntityActive("deformed_man_40", true);
SetEntityActive("deformed_man_41", true);
SetEntityActive("deformed_man_42", true);
SetEntityActive("deformed_man_43", true);
SetEntityActive("deformed_man_44", true);
SetEntityActive("deformed_man_45", true);
SetEntityActive("deformed_man_46", true);
SetEntityActive("deformed_man_47", true);
SetEntityActive("deformed_man_48", true);
SetEntityActive("deformed_man_49", true);
SetEntityActive("deformed_man_50", true);
SetEntityActive("deformed_man_51", true);
SetEntityActive("deformed_man_52", true);
SetEntityActive("deformed_man_53", true);
SetEntityActive("deformed_man_54", true);
SetEntityActive("deformed_man_55", true);
AddTimer("", 50.0f, "scared2");
}

void scared(string &in asTimer)
{
SetEntityActive("bro_1", false);
}

void scared2(string &in asTimer)
{
SetEntityActive("deformed_man_1", false);
SetEntityActive("deformed_man_2", false);
SetEntityActive("deformed_man_3", false);
SetEntityActive("deformed_man_4", false);
SetEntityActive("deformed_man_5", false);
SetEntityActive("deformed_man_6", false);
SetEntityActive("deformed_man_7", false);
SetEntityActive("deformed_man_8", false);
SetEntityActive("deformed_man_9", false);
SetEntityActive("deformed_man_10", false);
SetEntityActive("deformed_man_11", false);
SetEntityActive("deformed_man_12", false);
SetEntityActive("deformed_man_13", false);
SetEntityActive("deformed_man_14", false);
SetEntityActive("deformed_man_15", false);
SetEntityActive("deformed_man_16", false);
SetEntityActive("deformed_man_17", false);
SetEntityActive("deformed_man_18", false);
SetEntityActive("deformed_man_19", false);
SetEntityActive("deformed_man_20", false);
SetEntityActive("deformed_man_21", false);
SetEntityActive("deformed_man_22", false);
SetEntityActive("deformed_man_23", false);
SetEntityActive("deformed_man_24", false);
SetEntityActive("deformed_man_25", false);
SetEntityActive("deformed_man_26", false);
SetEntityActive("deformed_man_27", false);
SetEntityActive("deformed_man_28", false);
SetEntityActive("deformed_man_29", false);
SetEntityActive("deformed_man_30", false);
SetEntityActive("deformed_man_31", false);
SetEntityActive("deformed_man_32", false);
SetEntityActive("deformed_man_34", false);
SetEntityActive("deformed_man_35", false);
SetEntityActive("deformed_man_36", false);
SetEntityActive("deformed_man_37", false);
SetEntityActive("deformed_man_38", false);
SetEntityActive("deformed_man_39", false);
SetEntityActive("deformed_man_40", false);
SetEntityActive("deformed_man_41", false);
SetEntityActive("deformed_man_42", false);
SetEntityActive("deformed_man_43", false);
SetEntityActive("deformed_man_44", false);
SetEntityActive("deformed_man_45", false);
SetEntityActive("deformed_man_46", false);
SetEntityActive("deformed_man_47", false);
SetEntityActive("deformed_man_48", false);
SetEntityActive("deformed_man_49", false);
SetEntityActive("deformed_man_50", false);
SetEntityActive("deformed_man_51", false);
SetEntityActive("deformed_man_52", false);
SetEntityActive("deformed_man_53", false);
SetEntityActive("deformed_man_54", false);
SetEntityActive("deformed_man_55", false);
}


void scared is working but
void scared2 isn't working....
as i said before i dont get any FATAL ERROR it already shows up when i'am NOT in the area and if i stand in the area nothing happends

any help would be appreciated!! Smile

(sorry for bad english i'm from Holland)
(This post was last modified: 01-30-2014, 08:23 PM by TheNextLevelz.)
01-30-2014, 07:36 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#2
RE: Scripting Problem?

scared2(string &in asTimer)

The timer is 50 seconds.
50.0f,
Maybe wait and try if it works after 50 seconds.
(This post was last modified: 01-30-2014, 08:36 PM by DnALANGE.)
01-30-2014, 08:34 PM
Find
TheNextLevelz Offline
Junior Member

Posts: 9
Threads: 4
Joined: Sep 2013
Reputation: 0
#3
RE: Scripting Problem?

(01-30-2014, 08:34 PM)DnALANGE Wrote: scared2(string &in asTimer)

The timer is 50 seconds.
50.0f,
Maybe wait and try if it works after 50 seconds.
nope that isn't working either i waited and they don't dissapear
the statues are there already but that is not what it is supposed to be
i must walk in a area and then they are active but they are already active.
01-30-2014, 09:18 PM
Find
Radical Batz Offline
Posting Freak

Posts: 953
Threads: 145
Joined: Dec 2013
Reputation: 25
#4
RE: Scripting Problem?

nope that isn't working either i waited and they don't dissapear
the statues are there already but that is not what it is supposed to be
i must walk in a area and then they are active but they are already active.
[/quote]

They should be inactive then, uncheck Active on them
(This post was last modified: 01-30-2014, 09:21 PM by Radical Batz.)
01-30-2014, 09:20 PM
Find
daortir Offline
Senior Member

Posts: 422
Threads: 9
Joined: Sep 2013
Reputation: 18
#5
RE: Scripting Problem?

No. The statues you are using cannot be active/inactive. They are considered as static props.
You can't set those active/inactive unless you edit the files of the model ^^.

The statues in ptest can be deactivated though.

01-30-2014, 09:29 PM
Find
ingedoom Offline
Member

Posts: 120
Threads: 12
Joined: Feb 2012
Reputation: 0
#6
RE: Scripting Problem?

This hurts my eyes. Please use for loops.

for(int i = 1; i <= 55; i++)
SetEntityActive("deformed_man_" + i, true);

[Image: 23778.png]
01-30-2014, 10:52 PM
Website Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#7
RE: Scripting Problem?

void OnStart()
{
PlayMusic("01_amb_darkness.ogg", true, 1, 1, 1, false);
AddEntityCollideCallback("Player", "Jumpscare_1", "Jump1", true, 1);
AddEntityCollideCallback("Player", "lols", "Jump2", true, 1);
}

void Jump1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "24_iron_maiden.ogg", "Player", 0, false);
SetEntityActive("bro_1", true);
AddTimer("", 0.7f, "scared");
}

void Jump2(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "01_tiny1.ogg", "Player", 0, false);
SetEntityActive("deformed_man_*", true);
AddTimer("", 50.0f, "scared2");
}

void scared(string &in asTimer)
{
SetEntityActive("bro_1", false);
}

void scared2(string &in asTimer)
{
SetEntityActive("deformed_man_*", false);
}

I think the deformed man entity cannot be activated/deactivated.

"Veni, vidi, vici."
"I came, I saw, I conquered."
01-31-2014, 03:40 AM
Find
TheNextLevelz Offline
Junior Member

Posts: 9
Threads: 4
Joined: Sep 2013
Reputation: 0
#8
RE: Scripting Problem?

Okay i removed the statues with something else and it woorked perfectly
01-31-2014, 07:46 AM
Find




Users browsing this thread: 4 Guest(s)