LoneWolf
Senior Member
Posts: 308
Threads: 43
Joined: Sep 2010
Reputation:
0
|
RE: Small Help needed
Is your script laid out the same way as mine? maybe ive did somehting wrong? and it wont update my hps?
|
|
11-29-2010, 05:07 PM |
|
Chilton
Member
Posts: 138
Threads: 9
Joined: Sep 2010
Reputation:
0
|
RE: Small Help needed
*Sigh* Ok, gimme a second. Ill open it up in Notepad ++, rewrite it the way i make scripts, and we can try that. If it fails, ill want my 10 minutes back! If it works, idk."
BRB
EDIT: What the HELL did you do with this?! Wow. Ok, 5-10 minutes.
void OnStart()
{
AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1)
AddEntityCollideCallback("Player", "RoomThreeArea", "CollideRoomThree", true, 1);)
AddEntityCollideCallback("Player", "playsound", "playsound", true, 1);
AddEntityCollideCallback("Player", "abc", "abc", true, 1);
AddEntityCollideCallback("Player", "def", "def", true, 1);
AddEntityCollideCallback("Player", "ghi", "ghi", true, 1);
AddEntityCollideCallback("Player", "jkl", "jkl", true, 1);
AddEntityCollideCallback("Player", "mno", "mno", true, 1);
}
void OnEnter()
{
}
void OnLeave()
{
}
void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 10.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 10.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_19", 1000000000000.0f, "");
}
void CollideRoomThree(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("1", true);
SetEntityActive("2", true);
SetEntityActive("3", true);
SetEntityActive("4", true);
SetEntityActive("5", true);
SetEntityActive("6", true);
SetEntityActive("7", true);
SetEntityActive("8", true);
SetEntityActive("9", true);
SetEntityActive("10", true);
SetEntityActive("11", true);
SetEntityActive("12", true);
SetEntityActive("13", true);
SetEntityActive("14", true);
SetEntityActive("15", true);
SetEntityActive("16", true);
SetEntityActive("17", true);
SetEntityActive("18", true);
SetEntityActive("19", true);
SetEntityActive("20", true);
GiveSanityDamage(25, true);
StartScreenShake(0.1, 4.0, 0.1, 0.5);
CreateParticleSystemAtEntity("", "ps_guardian_appear_explosion.ps", "mp", false);
}
void playsound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("guardian_distant2.snt", "guardian_distant2.snt", "player", 0, false);
}
void abc(string &in asParent, string &in asChild, int alState)
{
GivePlayerDamage(500, "BloodSplat", true, false);
}
void def(string &in asParent, string &in asChild, int alState)
{
CreateParticleSystemAtEntity("", "ps_break_cavein.ps", "111", false);
CreateParticleSystemAtEntity("", "ps_break_cavein.ps", "222", false);
CreateParticleSystemAtEntity("", "ps_break_cavein.ps", "333", false);
CreateParticleSystemAtEntity("", "ps_water_dump.ps", "444", false);
CreateParticleSystemAtEntity("", "ps_water_dump.ps", "555", false);
CreateParticleSystemAtEntity("", "ps_water_dump.ps", "666", false);
CreateParticleSystemAtEntity("", "ps_water_dump.ps", "777", false);
CreateParticleSystemAtEntity("", "ps_water_dump.ps", "888", false);
CreateParticleSystemAtEntity("", "ps_water_dump.ps", "999", false);
PlaySoundAtEntity("05_rock_fall_2.snt", "05_rock_fall_2.snt", "player", 0, false);
PlaySoundAtEntity("guardian_ontop.snt", "guardian_ontop.snt", "player", 0, false);
StartScreenShake(0.1, 4.0, 0.1, 0.5);
}
void ghi(string &in asParent, string &in asChild, int alState)
{
GivePlayerDamage(500, "BloodSplat2", true, false);
}
void jkl(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("amb_alert.snt", "amb_alert.snt", "player", 0, false);
GiveSanityDamage(25, true);
}
void mno(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_20", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_21", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_22", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_23", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_24", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_25", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_26", 3.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_27", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_28", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_29", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_30", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_31", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_32", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_33", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_34", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_35", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_36", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_37", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_38", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_39", 5.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_40", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_41", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_42", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_43", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_44", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_45", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_46", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_47", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_48", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_49", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_50", 3.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_51", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_52", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_53", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_54", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_55", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_56", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_57", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_58", 1.0f, "");
}
Try this
Some of your organisation was a bit strange, but for all intents and purposes this should work, provided the ID's in the editor are all identical and the particles/sounds are not active
(This post was last modified: 11-29-2010, 05:26 PM by Chilton.)
|
|
11-29-2010, 05:16 PM |
|
LoneWolf
Senior Member
Posts: 308
Threads: 43
Joined: Sep 2010
Reputation:
0
|
RE: Small Help needed
Now my whole map doesnt work, says alot of convention of double float.
And
tons of compilings..... eg. compiling void on start () ......... thanks.
(This post was last modified: 11-29-2010, 05:48 PM by LoneWolf.)
|
|
11-29-2010, 05:46 PM |
|
jens
Frictional Games
Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation:
202
|
RE: Small Help needed
It's probably the typos:
AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1)
AddEntityCollideCallback("Player", "RoomThreeArea", "CollideRoomThree", true, 1);)
it should be
AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1);
AddEntityCollideCallback("Player", "RoomThreeArea", "CollideRoomThree", true, 1);
(This post was last modified: 11-29-2010, 05:50 PM by jens.)
|
|
11-29-2010, 05:49 PM |
|
LoneWolf
Senior Member
Posts: 308
Threads: 43
Joined: Sep 2010
Reputation:
0
|
RE: Small Help needed
Fixed it you missed a ; and you added in an extra bracket ) .
My map turns on now but liek before the sounds and particles turn on at start and dont turn on when i walk into scripted area.... really annoyed now.
EDIT: yeah few typo's . So i guess it doesnt really matter how you lay the script out as its changed nothing thanks for trying anyway.
I also don't understand how particles and sounds can become active when not activated. Makes no sense at all. As their turned off but only turn on when i walk into the scripted area like i've said before.
(This post was last modified: 11-29-2010, 06:02 PM by LoneWolf.)
|
|
11-29-2010, 05:53 PM |
|
jens
Frictional Games
Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation:
202
|
RE: Small Help needed
Have you used sound entities and particle entities in the level for these sounds? I mean are there speaker and PS icons? If so then that is why they activate directly, they are not meant to be used as you want them.
You place regular script areas instead and then you use the PlaySoundAtEntity and CreateParticleSystemAtEntity to play sounds and start particles at those areas.
|
|
11-29-2010, 06:06 PM |
|
LoneWolf
Senior Member
Posts: 308
Threads: 43
Joined: Sep 2010
Reputation:
0
|
RE: Small Help needed
(11-29-2010, 06:06 PM)jens Wrote: Have you used sound entities and particle entities in the level for these sounds? I mean are there speaker and PS icons? If so then that is why they activate directly, they are not meant to be used as you want them.
You place regular script areas instead and then you use the PlaySoundAtEntity and CreateParticleSystemAtEntity to play sounds and start particles at those areas.
The icons appear in the level editor, btu when i untick the activate box for the particles the icon (PS) turns black. I'm not quite sure what you mean by placing sccript areas instead, as i've got the sounds to work plenty of times in my levels using the same technique i'm using. I've just never used the particle script before.
|
|
11-29-2010, 06:11 PM |
|
jens
Frictional Games
Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation:
202
|
RE: Small Help needed
You do not place sound and particles entities to turn them on/off, you only place them to have them enabled from the start of a level and if wanted turning them off while playing the level.
If you want to play a sound or start a particle while playing a level, that is not active when starting the level, you create areas and use the PlaySoundAtEntity/CreateParticleSystemAtEntity functions.
So for example create a script area called AreaMyEffects, then in script type:
PlaySoundAtEntity("monster_alert_sound", "amb_alert.snt", "AreaMyEffects", 0, false);
CreateParticleSystemAtEntity("monster_alert_particle", "ps_water_dump.ps", "AreaMyEffects", false);
This will make the sound play and the particle to appear at the center of the AreaMyEffects area.
You can also use entities for this, for example if you have a Lamp entity named MyBigBrightCandle, then:
PlaySoundAtEntity("monster_alert_sound", "amb_alert.snt", "MyBigBrightCandle", 0, false);
CreateParticleSystemAtEntity("monster_alert_particle", "ps_water_dump.ps", "MyBigBrightCandle", false);
Would do the same and play/create stuff at the candle entity.
|
|
11-29-2010, 06:41 PM |
|
Frontcannon
Senior Member
Posts: 538
Threads: 10
Joined: Jul 2010
Reputation:
2
|
RE: Small Help needed
(11-29-2010, 06:41 PM)jens Wrote: You can also use entities for this,
I tried that with a fire PS and the orchid entity, and at the start of the level (right after the player spawns) it is played once and then triggered correctly with sound and all when the player goes into the ScriptArea.
╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
|
|
11-29-2010, 06:52 PM |
|
LoneWolf
Senior Member
Posts: 308
Threads: 43
Joined: Sep 2010
Reputation:
0
|
RE: Small Help needed
Well my particle and sound problems have all been solved thanks to Jens
|
|
11-29-2010, 07:19 PM |
|
|