Frictional Games Forum (read-only)

Full Version: Scripting simple button
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(I'm asking for a lot)
If I push a "simple button" called "simplebutton1" I want to have a secret movable bookself to move called "smb1" and have a sript area spawn for a teleporting naked guy to fly at you from the script area that just spawned called "ScriptArea_4". The teleporting naked guy is called "tng1" I know the basics of scripting but i'm really bad at scripting events, hints, prop force, ect.
~Thank you for any help
Use the wiki. It's your greatest friend, and you should have it open at all times while scripting.
(03-04-2012, 06:57 AM)Strembitsky Wrote: [ -> ]Use the wiki. It's your greatest friend, and you should have it open at all times while scripting.
At the end of my post what i ment to say is that I have the scripts from Engine Scripts website BUT I dont know where to put them in my script in order to work:/
void OnStart()
{
//callback goes here
}

//function here
That means you don't know how to script. Look up Elven's youtube video tutorials. At first, I was frustrated with the community not being able to give me a simple answer, but trust me, it's better if you learn than just asking everybody everything.

EDIT: Or, you could do the above. >.>
For a simple task like telling them where things go there isn't any point to make him go through a video.
Fair point, but if it's something as basic as that, it means they have no idea how to script. I thought I would send them in the right direction Smile
(03-04-2012, 03:53 PM)Strembitsky Wrote: [ -> ]Fair point, but if it's something as basic as that, it means they have no idea how to script. I thought I would send them in the right direction Smile
void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_4" , "HallwayScare" , true , 1);
}

void HallwayScare(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "27_jam.snt", "Player", 0.5f, false);
SetEntityActive("corpse_male_1", true);
AddPropImpulse("corpse_male_1", 0, 0, 250, "world");
AddTimer("look03", 2.0f, "Timer_1");
PlaySoundAtEntity("", "24_iron_maiden.snt", "Player", 0.5f, false);
}
void Timer_1(string &in asParent, string &in asChild, int alState)
{

}
How do I know when to put the extra timer at the end when there is no callback
(03-04-2012, 04:57 PM)Froggit Wrote: [ -> ]
(03-04-2012, 03:53 PM)Strembitsky Wrote: [ -> ]Fair point, but if it's something as basic as that, it means they have no idea how to script. I thought I would send them in the right direction Smile
void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_4" , "HallwayScare" , true , 1);
}

void HallwayScare(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "27_jam.snt", "Player", 0.5f, false);
SetEntityActive("corpse_male_1", true);
AddPropImpulse("corpse_male_1", 0, 0, 250, "world");
AddTimer("look03", 2.0f, "Timer_1");
PlaySoundAtEntity("", "24_iron_maiden.snt", "Player", 0.5f, false);
}
void Timer_1(string &in asParent, string &in asChild, int alState)
{

}
How do I know when to put the extra timer at the end when there is no callback
The AddTimer("look03", 2.0f, "Timer_1"); does that.

Also you have the wrong syntax. Change
(string &in asParent, string &in asChild, int alState) to

(string &in asTimer)



(03-05-2012, 04:18 AM)flamez3 Wrote: [ -> ]
(03-04-2012, 04:57 PM)Froggit Wrote: [ -> ]
(03-04-2012, 03:53 PM)Strembitsky Wrote: [ -> ]Fair point, but if it's something as basic as that, it means they have no idea how to script. I thought I would send them in the right direction Smile
void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_4" , "HallwayScare" , true , 1);
}

void HallwayScare(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "27_jam.snt", "Player", 0.5f, false);
SetEntityActive("corpse_male_1", true);
AddPropImpulse("corpse_male_1", 0, 0, 250, "world");
AddTimer("look03", 2.0f, "Timer_1");
PlaySoundAtEntity("", "24_iron_maiden.snt", "Player", 0.5f, false);
}
void Timer_1(string &in asParent, string &in asChild, int alState)
{

}
How do I know when to put the extra timer at the end when there is no callback
The AddTimer("look03", 2.0f, "Timer_1"); does that.

Also you have the wrong syntax. Change
(string &in asParent, string &in asChild, int alState) to

(string &in asTimer)
Damn your good lol. I put the wrong syntax there o npurpouse cause I couldnt find the corrct onexD
Pages: 1 2