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
How to script the guardian effect?
Shives Offline
Member

Posts: 154
Threads: 41
Joined: Jan 2012
Reputation: 1
#1
How to script the guardian effect?

Hi
I want to script the guardian effect,this means
How to script it that an Object fades in. If I use Set Entity Active it looks awful.

My Custom Story
http://www.frictionalgames.com/forum/thread-12587.html

Sorry for bad English


02-24-2012, 07:41 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#2
RE: How to script the guardian effect?

SetPropActiveAndFade is probably what you're looking for.


02-24-2012, 07:54 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#3
RE: How to script the guardian effect?

and do some particles and it should look nice Wink

02-24-2012, 10:43 PM
Find
Shives Offline
Member

Posts: 154
Threads: 41
Joined: Jan 2012
Reputation: 1
#4
RE: How to script the guardian effect?

The result
main(27,3):ERR :No matching signatures to 'SetPropActiveAndFade(string@&, const bool)'

My Script




////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Slime", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Roar", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "S", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "Scare", true, 1);
}
void Slime(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_loon.snt", "Player", 0, false);
AddTimer("", 4, "Wispher");
}
void Wispher(string &in asTimer)
{
PlaySoundAtEntity("", "insanity_imageflash01.snt", "Player", 0, false);
AddTimer("", 7, "Help");
}
void Help(string &in asTimer)
{
PlaySoundAtEntity("", "guardian_distant1.snt", "Player", 0, false);
}
void S(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetPropActiveAndFade("S_1", true);
SetPropActiveAndFade("S_2", true);
SetPropActiveAndFade("S_3", true);
SetPropActiveAndFade("S_4", true);
SetPropActiveAndFade("S_4", true);
StartScreenShake(0.9f, 1, 0.9f, 1.0f);
}
void Scare(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetPropActiveAndFade("P_1", true);
SetPropActiveAndFade("P_2", true);
SetPropActiveAndFade("P_3", true);
SetPropActiveAndFade("P_4", true);
SetPropActiveAndFade("P_5", true);
SetPropActiveAndFade("P_6", true);
StartScreenShake(0.9f, 1, 0.9f, 1.0f);
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}





My Custom Story
http://www.frictionalgames.com/forum/thread-12587.html

Sorry for bad English


02-25-2012, 09:52 AM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#5
RE: How to script the guardian effect?

(02-25-2012, 09:52 AM)Shives Wrote: The result
main(27,3):ERR :No matching signatures to 'SetPropActiveAndFade(string@&, const bool)'

My Script




////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Slime", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Roar", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "S", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "Scare", true, 1);
}
void Slime(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_loon.snt", "Player", 0, false);
AddTimer("", 4, "Wispher");
}
void Wispher(string &in asTimer)
{
PlaySoundAtEntity("", "insanity_imageflash01.snt", "Player", 0, false);
AddTimer("", 7, "Help");
}
void Help(string &in asTimer)
{
PlaySoundAtEntity("", "guardian_distant1.snt", "Player", 0, false);
}
void S(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetPropActiveAndFade("S_1", true);
SetPropActiveAndFade("S_2", true);
SetPropActiveAndFade("S_3", true);
SetPropActiveAndFade("S_4", true);
SetPropActiveAndFade("S_4", true);
StartScreenShake(0.9f, 1, 0.9f, 1.0f);
}
void Scare(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetPropActiveAndFade("P_1", true);
SetPropActiveAndFade("P_2", true);
SetPropActiveAndFade("P_3", true);
SetPropActiveAndFade("P_4", true);
SetPropActiveAndFade("P_5", true);
SetPropActiveAndFade("P_6", true);
StartScreenShake(0.9f, 1, 0.9f, 1.0f);
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
You forgot the last part of the SetPropActiveAndFade

SetPropActiveAndFade(string& asName, bool abActive, float afFadeTime);

asName - internal name


abActive - nothing to add


afFadeTime - time in seconds until prop fully fades




02-25-2012, 11:55 AM
Find
Shives Offline
Member

Posts: 154
Threads: 41
Joined: Jan 2012
Reputation: 1
#6
RE: How to script the guardian effect?

New Problem
main(27,22):ERR : 'S_1' is not declared
The same with the other Objects i want to fade -.-


////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Slime", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Roar", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "S", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "Scare", true, 1);
}
void Slime(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_loon.snt", "Player", 0, false);
AddTimer("", 4, "Wispher");
}
void Wispher(string &in asTimer)
{
PlaySoundAtEntity("", "insanity_imageflash01.snt", "Player", 0, false);
AddTimer("", 7, "Help");
}
void Help(string &in asTimer)
{
PlaySoundAtEntity("", "guardian_distant1.snt", "Player", 0, false);
}
void S(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetPropActiveAndFade(S_1, true, 0,9);
SetPropActiveAndFade(S_2, true, 0,9);
SetPropActiveAndFade(S_3, true, 0,9);
SetPropActiveAndFade(S_4, true, 0,9);
SetPropActiveAndFade(S_5, true, 0,9);
StartScreenShake(0.9f, 1, 0.9f, 1.0f);
}
void Scare(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetPropActiveAndFade(P_1, true, 0,9);
SetPropActiveAndFade(P_2, true, 0,9);
SetPropActiveAndFade(P_3, true, 0,9);
SetPropActiveAndFade(P_4, true, 0,9);
SetPropActiveAndFade(P_5, true, 0,9);
SetPropActiveAndFade(P_6, true, 0,9);
StartScreenShake(0.9f, 1, 0.9f, 1.0f);
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}


My Custom Story
http://www.frictionalgames.com/forum/thread-12587.html

Sorry for bad English


02-25-2012, 12:22 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#7
RE: How to script the guardian effect?

S_1 is not declared because all the S_ and p_ should be inside "" for example "S_1"

because they are Strings

(This post was last modified: 02-25-2012, 12:35 PM by SilentStriker.)
02-25-2012, 12:34 PM
Find
Shives Offline
Member

Posts: 154
Threads: 41
Joined: Jan 2012
Reputation: 1
#8
RE: How to script the guardian effect?

The result

main(27,3):ERR :No matching signatures to 'SetPropActiveAndFade(string@&, const bool, const uint, const uint'


My Custom Story
http://www.frictionalgames.com/forum/thread-12587.html

Sorry for bad English


02-25-2012, 12:42 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#9
RE: How to script the guardian effect?

SetPropActiveAndFade("S_5", true, 0.9f);

is how it should look like

02-25-2012, 12:51 PM
Find
Shives Offline
Member

Posts: 154
Threads: 41
Joined: Jan 2012
Reputation: 1
#10
RE: How to script the guardian effect?

Sad

main (27,38) : ERR : Expected ')'or','

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Slime", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Roar", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "S", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "Scare", true, 1);
}
void Slime(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_loon.snt", "Player", 0, false);
AddTimer("", 4, "Wispher");
}
void Wispher(string &in asTimer)
{
PlaySoundAtEntity("", "insanity_imageflash01.snt", "Player", 0, false);
AddTimer("", 7, "Help");
}
void Help(string &in asTimer)
{
PlaySoundAtEntity("", "guardian_distant1.snt", "Player", 0, false);
}
void S(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetPropActiveAndFade("S_1", true, 0,9f);
SetPropActiveAndFade("S_2", true, 0,9f);
SetPropActiveAndFade("S_3", true, 0,9f);
SetPropActiveAndFade("S_4", true, 0,9f);
SetPropActiveAndFade("S_5", true, 0,9f);
StartScreenShake(0.9f, 1, 0.9f, 1.0f);
}
void Scare(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardian_activated.snt", "Player", 0, false);
SetPropActiveAndFade("P_1", true, 0,9f);
SetPropActiveAndFade("P_2", true, 0,9f);
SetPropActiveAndFade("P_3", true, 0,9f);
SetPropActiveAndFade("P_4", true, 0,9f);
SetPropActiveAndFade("P_5", true, 0,9f);
SetPropActiveAndFade("P_6", true, 0,9f);
StartScreenShake(0.9f, 1, 0.9f, 1.0f);
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}





My Custom Story
http://www.frictionalgames.com/forum/thread-12587.html

Sorry for bad English


(This post was last modified: 02-25-2012, 01:08 PM by Shives.)
02-25-2012, 01:07 PM
Find




Users browsing this thread: 1 Guest(s)