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
Need to fix my script
djwhatkid Offline
Junior Member

Posts: 5
Threads: 3
Joined: Jan 2012
Reputation: 0
#1
Need to fix my script

Hi, so basicly i have tryed for like ever to fix this. so i want 3 corpses to spawn when i hit the scriptArea (Box)



//
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptAreaCorpsespawn", "SpawnCorpse1", false, 1);
AddEntityCollideCallback("Player", "ScriptAreaCorpsespawn", "SpawnCorpse2", false, 1);
AddEntityCollideCallback("Player", "ScriptAreaCorpsespawn", "SpawnCorpse3", false, 1);
AddEntityCollideCallback("Player", "Music", "StartMusic", true, 1);
}


void SpawnCorpse1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("corpse1");
}


void SpawnCorpse2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("corpse2");
}


void SpawnCorpse3(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("corpse3");
}


void StartMusic(string &in asParent, string &in asChild, int alState)
{
PlayMusic("266663_Ambience_Experiment.ogg", true, 0.8, 2, 1, true);
}
01-21-2012, 05:06 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: Need to fix my script

(01-21-2012, 05:06 PM)djwhatkid Wrote: Hi, so basicly i have tryed for like ever to fix this. so i want 3 corpses to spawn when i hit the scriptArea (Box)



//
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptAreaCorpsespawn", "SpawnCorpse1", false, 1);
AddEntityCollideCallback("Player", "ScriptAreaCorpsespawn", "SpawnCorpse2", false, 1);
AddEntityCollideCallback("Player", "ScriptAreaCorpsespawn", "SpawnCorpse3", false, 1);
AddEntityCollideCallback("Player", "Music", "StartMusic", true, 1);
}


void SpawnCorpse1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("corpse1");
}


void SpawnCorpse2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("corpse2");
}


void SpawnCorpse3(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("corpse3");
}


void StartMusic(string &in asParent, string &in asChild, int alState)
{
PlayMusic("266663_Ambience_Experiment.ogg", true, 0.8, 2, 1, true);
}
SetEntityActive("corpse1", true);

Do that for each of your corpse's

01-21-2012, 05:09 PM
Find
Tripication Offline
Member

Posts: 172
Threads: 19
Joined: Dec 2011
Reputation: 6
#3
RE: Need to fix my script

ok, you only need to call 1 Collision area

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptAreaCorpsespawn", "SpawnCorpse1", true, 1);

}

void SpawnCorpse1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("corpse1", true);
SetEntityActive("corpse2", true);
SetEntityActive("corpse3", true);
}




And you probably want the Red text to be true(to remove the function after its been used once)


Im guessing thats also custom music, i dont recognize it, but the body spawns should do the trick now.

[Image: speedart__2___yoshimitsu_by_kamofudge-d4yo6kk.png]
01-21-2012, 05:10 PM
Find
djwhatkid Offline
Junior Member

Posts: 5
Threads: 3
Joined: Jan 2012
Reputation: 0
#4
RE: Need to fix my script

Thx i will test this
Thank you all you saved me alot of time
(This post was last modified: 01-21-2012, 05:29 PM by djwhatkid.)
01-21-2012, 05:25 PM
Find
Tripication Offline
Member

Posts: 172
Threads: 19
Joined: Dec 2011
Reputation: 6
#5
RE: Need to fix my script

no probs, time for sleep

[Image: speedart__2___yoshimitsu_by_kamofudge-d4yo6kk.png]
01-21-2012, 05:33 PM
Find




Users browsing this thread: 1 Guest(s)