Froggit
Junior Member
Posts: 20
Threads: 4
Joined: Feb 2012
Reputation:
0
|
[Solved] Scripting in need of help:/
When I walk into "ScriptArea_3" I want all of the lights to fade to "pointlight_25". I made a physical feature called "ParticleSystem_3" which I want to activate when I enter "ScriptArea_3" (ps_dust_whirl.ps) and the lights are "light1" and "light2". Plus I want a sound of dust whirl when enter "ScriptArea_3" but I dont know the file for that.I'm wondering if someone could post a script for It because I have no idea how to:/ . I'm really sorry if this is too much but i'm trying to perfect this mod for PewDiePie.
Thank you for any help
(This post was last modified: 03-04-2012, 02:51 AM by Froggit.)
|
|
03-02-2012, 03:16 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: Scripting in need of help:/
inb4flaming.
void OnStart()
{
AddEntityCollideCalbback("Player", "ScriptArea_3", "LightFade", true, 1);
}
void LightFade(string &in asParent, string &in asChild, int alState)
{
SetLightVisible("pointlight_0", false);
SetLightVisible("pointlight_1", false);
SetLightVisible("pointlight_2", false);
CreateParticleSystemAtEntity("ps", "ps_dust_whirl.ps", "ScriptAreaParticle", true);
SetLightVisible("light1", true);
SetLightVisible("light2", true);
PlaySoundAtEntity("", "nameofsound, "ScriptAreaParticle", 0, true);
}
Now repeat the lightvisible event until pointlight_25. There are easier ways of doing this but for your sake just do it this way.
For the createpartclesystematentity, delete the particlesystem in the level editor and make a ScriptArea in the exact place you want it to go. And rename it to ScriptAreaParticle
Any other questions just ask.
(This post was last modified: 03-02-2012, 03:53 AM by flamez3.)
|
|
03-02-2012, 03:53 AM |
|
Froggit
Junior Member
Posts: 20
Threads: 4
Joined: Feb 2012
Reputation:
0
|
RE: flamez3
@flamez3 It says error(102, 2) //Its probably obvious but i'm not good at this. P.S: If your the flamez3 that made/makes maps for PewdiePie your frickin' beast.
////////////////////////////
// Run when entering map
void OnEnter()
{
}
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "dust", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "LightFade", true, 1);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_13", 0, "");
}
void dust(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ParticleSystem_2", true);
}
void LightFade(string &in asParent, string &in asChild, int alState)
{
SetLightVisible("pointlight_0", false);
SetLightVisible("pointlight_1", false);
SetLightVisible("pointlight_2", false);
SetLightVisible("pointlight_3", false);
SetLightVisible("pointlight_4", false);
SetLightVisible("pointlight_5", false);
SetLightVisible("pointlight_6", false);
SetLightVisible("pointlight_7", false);
SetLightVisible("pointlight_8", false);
SetLightVisible("pointlight_9", false);
SetLightVisible("pointlight_10", false);
SetLightVisible("pointlight_11", false);
SetLightVisible("pointlight_12", false);
SetLightVisible("pointlight_13", false);
SetLightVisible("pointlight_14", false);
SetLightVisible("pointlight_15", false);
SetLightVisible("pointlight_16", false);
SetLightVisible("pointlight_17", false);
SetLightVisible("pointlight_18", false);
SetLightVisible("pointlight_19", false);
SetLightVisible("pointlight_20", false);
SetLightVisible("pointlight_21", false);
SetLightVisible("pointlight_22", false);
SetLightVisible("pointlight_23", false);
SetLightVisible("pointlight_24", false);
SetLightVisible("pointlight_25", false);
CreateParticleSystemAtEntity("ps", "ps_dust_whirl.ps", "ScriptAreaParticle", true);
SetLightVisible("torch_static01_1", true);
SetLightVisible("torch_static01_2", true);
SetLightVisible("torch_static01_3", true);
SetLightVisible("torch_static01_4", true);
SetLightVisible("torch_static01_5", true);
SetLightVisible("torch_static01_6", true);
SetLightVisible("torch_static01_7", true);
SetLightVisible("torch_static01_8", true);
SetLightVisible("torch_static01_9", true);
SetLightVisible("torch_static01_10", true);
SetLightVisible("torch_static01_11", true);
SetLightVisible("torch_static01_12", true);
SetLightVisible("torch_static01_13", true);
SetLightVisible("torch_static01_14", true);
SetLightVisible("torch_static01_15", true);
SetLightVisible("torch_static01_16", true);
SetLightVisible("torch_static01_17", true);
SetLightVisible("torch_static01_18", true);
SetLightVisible("torch_static01_19", true);
SetLightVisible("torch_static01_20", true);
SetLightVisible("torch_static01_21", true);
SetLightVisible("torch_static01_22", true);
SetLightVisible("torch_static01_23", true);
PlaySoundAtEntity("", "sound3, "ScriptAreaParticle", 0, true);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
(This post was last modified: 03-02-2012, 04:48 AM by Froggit.)
|
|
03-02-2012, 04:40 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: Scripting in need of help:/
Use this:
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "dust", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "LightFade", true, 1);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_13", 0, "");
}
void dust(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ParticleSystem_2", true);
}
void LightFade(string &in asParent, string &in asChild, int alState)
{
SetLightVisible("pointlight_0", false);
SetLightVisible("pointlight_1", false);
SetLightVisible("pointlight_2", false);
SetLightVisible("pointlight_3", false);
SetLightVisible("pointlight_4", false);
SetLightVisible("pointlight_5", false);
SetLightVisible("pointlight_6", false);
SetLightVisible("pointlight_7", false);
SetLightVisible("pointlight_8", false);
SetLightVisible("pointlight_9", false);
SetLightVisible("pointlight_10", false);
SetLightVisible("pointlight_11", false);
SetLightVisible("pointlight_12", false);
SetLightVisible("pointlight_13", false);
SetLightVisible("pointlight_14", false);
SetLightVisible("pointlight_15", false);
SetLightVisible("pointlight_16", false);
SetLightVisible("pointlight_17", false);
SetLightVisible("pointlight_18", false);
SetLightVisible("pointlight_19", false);
SetLightVisible("pointlight_20", false);
SetLightVisible("pointlight_21", false);
SetLightVisible("pointlight_22", false);
SetLightVisible("pointlight_23", false);
SetLightVisible("pointlight_24", false);
SetLightVisible("pointlight_25", false);
CreateParticleSystemAtEntity("ps", "ps_dust_whirl.ps", "ScriptAreaParticle", true);
SetLightVisible("torch_static01_1", true);
SetLightVisible("torch_static01_2", true);
SetLightVisible("torch_static01_3", true);
SetLightVisible("torch_static01_4", true);
SetLightVisible("torch_static01_5", true);
SetLightVisible("torch_static01_6", true);
SetLightVisible("torch_static01_7", true);
SetLightVisible("torch_static01_8", true);
SetLightVisible("torch_static01_9", true);
SetLightVisible("torch_static01_10", true);
SetLightVisible("torch_static01_11", true);
SetLightVisible("torch_static01_12", true);
SetLightVisible("torch_static01_13", true);
SetLightVisible("torch_static01_14", true);
SetLightVisible("torch_static01_15", true);
SetLightVisible("torch_static01_16", true);
SetLightVisible("torch_static01_17", true);
SetLightVisible("torch_static01_18", true);
SetLightVisible("torch_static01_19", true);
SetLightVisible("torch_static01_20", true);
SetLightVisible("torch_static01_21", true);
SetLightVisible("torch_static01_22", true);
SetLightVisible("torch_static01_23", true);
PlaySoundAtEntity("", "sound3", "ScriptAreaParticle", 0, true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
On PlaySoundAtEntity in the last function you didn't use the " on the end of sound3.
(This post was last modified: 03-02-2012, 05:44 AM by flamez3.)
|
|
03-02-2012, 05:41 AM |
|
Froggit
Junior Member
Posts: 20
Threads: 4
Joined: Feb 2012
Reputation:
0
|
RE: flamez3
(03-02-2012, 05:41 AM)flamez3 Wrote: Use this:
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "dust", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "LightFade", true, 1);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_13", 0, "");
}
void dust(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ParticleSystem_2", true);
}
void LightFade(string &in asParent, string &in asChild, int alState)
{
SetLightVisible("pointlight_0", false);
SetLightVisible("pointlight_1", false);
SetLightVisible("pointlight_2", false);
SetLightVisible("pointlight_3", false);
SetLightVisible("pointlight_4", false);
SetLightVisible("pointlight_5", false);
SetLightVisible("pointlight_6", false);
SetLightVisible("pointlight_7", false);
SetLightVisible("pointlight_8", false);
SetLightVisible("pointlight_9", false);
SetLightVisible("pointlight_10", false);
SetLightVisible("pointlight_11", false);
SetLightVisible("pointlight_12", false);
SetLightVisible("pointlight_13", false);
SetLightVisible("pointlight_14", false);
SetLightVisible("pointlight_15", false);
SetLightVisible("pointlight_16", false);
SetLightVisible("pointlight_17", false);
SetLightVisible("pointlight_18", false);
SetLightVisible("pointlight_19", false);
SetLightVisible("pointlight_20", false);
SetLightVisible("pointlight_21", false);
SetLightVisible("pointlight_22", false);
SetLightVisible("pointlight_23", false);
SetLightVisible("pointlight_24", false);
SetLightVisible("pointlight_25", false);
CreateParticleSystemAtEntity("ps", "ps_dust_whirl.ps", "ScriptAreaParticle", true);
SetLightVisible("torch_static01_1", true);
SetLightVisible("torch_static01_2", true);
SetLightVisible("torch_static01_3", true);
SetLightVisible("torch_static01_4", true);
SetLightVisible("torch_static01_5", true);
SetLightVisible("torch_static01_6", true);
SetLightVisible("torch_static01_7", true);
SetLightVisible("torch_static01_8", true);
SetLightVisible("torch_static01_9", true);
SetLightVisible("torch_static01_10", true);
SetLightVisible("torch_static01_11", true);
SetLightVisible("torch_static01_12", true);
SetLightVisible("torch_static01_13", true);
SetLightVisible("torch_static01_14", true);
SetLightVisible("torch_static01_15", true);
SetLightVisible("torch_static01_16", true);
SetLightVisible("torch_static01_17", true);
SetLightVisible("torch_static01_18", true);
SetLightVisible("torch_static01_19", true);
SetLightVisible("torch_static01_20", true);
SetLightVisible("torch_static01_21", true);
SetLightVisible("torch_static01_22", true);
SetLightVisible("torch_static01_23", true);
PlaySoundAtEntity("", "sound3", "ScriptAreaParticle", 0, true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
On PlaySoundAtEntity in the last function you didn't use the " on the end of sound3.
My map worked but the flamez3 didn't fade. Should I fit the script area to the size of the room maby? I dont know but thank you tons for helping me bro.
|
|
03-02-2012, 02:25 PM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: Scripting in need of help:/
What exactly do you mean fade? Setting it invisible will fade it (although not very good)
|
|
03-02-2012, 03:10 PM |
|
Froggit
Junior Member
Posts: 20
Threads: 4
Joined: Feb 2012
Reputation:
0
|
RE: flamez3
(03-02-2012, 03:10 PM)flamez3 Wrote: What exactly do you mean fade? Setting it invisible will fade it (although not very good) Like in the first map of amnesia when you walk in one of the rooms at the end and all of the lights go out. So when I walk into a room filled with lights(torches) I want all of them to go out. With the particle gust of wind and sound gust of wind when I walk into the room on the same scrip area if thats posible.
|
|
03-02-2012, 11:08 PM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: Scripting in need of help:/
Ah sorry, wrong event. c:
Replace the SetLightVisible("torch_static_01, true); with
SetLampLit("torch_static01_1", false, true);
All the way down to torch_static_23
|
|
03-03-2012, 03:13 AM |
|
Froggit
Junior Member
Posts: 20
Threads: 4
Joined: Feb 2012
Reputation:
0
|
RE: flamez3
(03-03-2012, 03:13 AM)flamez3 Wrote: Ah sorry, wrong event. c:
Replace the SetLightVisible("torch_static_01, true); with
SetLampLit("torch_static01_1", false, true);
All the way down to torch_static_23 Wooohhh!!! It worked . But the sound and the particle system didnt work. Did I have to change that stuff also? And I dont have a particle system in level editor just the 2 script areas, one for lights and a small box for particle i think. Here is my script updated. And im really sorry if this is stressing you out because I dont know scripting for sh*t
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "dust", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "LightFade", true, 1);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_13", 0, "");
}
void dust(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ParticleSystem_2", true);
}
void LightFade(string &in asParent, string &in asChild, int alState)
{
SetLightVisible("pointlight_0", false);
SetLightVisible("pointlight_1", false);
SetLightVisible("pointlight_2", false);
SetLightVisible("pointlight_3", false);
SetLightVisible("pointlight_4", false);
SetLightVisible("pointlight_5", false);
SetLightVisible("pointlight_6", false);
SetLightVisible("pointlight_7", false);
SetLightVisible("pointlight_8", false);
SetLightVisible("pointlight_9", false);
SetLightVisible("pointlight_10", false);
SetLightVisible("pointlight_11", false);
SetLightVisible("pointlight_12", false);
SetLightVisible("pointlight_13", false);
SetLightVisible("pointlight_14", false);
SetLightVisible("pointlight_15", false);
SetLightVisible("pointlight_16", false);
SetLightVisible("pointlight_17", false);
SetLightVisible("pointlight_18", false);
SetLightVisible("pointlight_19", false);
SetLightVisible("pointlight_20", false);
SetLightVisible("pointlight_21", false);
SetLightVisible("pointlight_22", false);
SetLightVisible("pointlight_23", false);
SetLightVisible("pointlight_24", false);
SetLightVisible("pointlight_25", false);
CreateParticleSystemAtEntity("ps", "ps_dust_whirl.ps", "ScriptAreaParticle", true);
SetLampLit("torch_static01_1", false, true);
SetLampLit("torch_static01_2", false, true);
SetLampLit("torch_static01_3", false, true);
SetLampLit("torch_static01_4", false, true);
SetLampLit("torch_static01_5", false, true);
SetLampLit("torch_static01_6", false, true);
SetLampLit("torch_static01_7", false, true);
SetLampLit("torch_static01_8", false, true);
SetLampLit("torch_static01_9", false, true);
SetLampLit("torch_static01_10", false, true);
SetLampLit("torch_static01_11", false, true);
SetLampLit("torch_static01_12", false, true);
SetLampLit("torch_static01_13", false, true);
SetLampLit("torch_static01_14", false, true);
SetLampLit("torch_static01_15", false, true);
SetLampLit("torch_static01_16", false, true);
SetLampLit("torch_static01_17", false, true);
SetLampLit("torch_static01_18", false, true);
SetLampLit("torch_static01_19", false, true);
SetLampLit("torch_static01_20", false, true);
SetLampLit("torch_static01_21", false, true);
SetLampLit("torch_static01_22", false, true);
SetLampLit("torch_static01_23", false, true);
PlaySoundAtEntity("", "sound3", "ScriptAreaParticle", 0, true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
|
|
03-03-2012, 03:39 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: Scripting in need of help:/
Have you got an area called ScriptAreaParticle?
|
|
03-03-2012, 05:01 AM |
|
|