Frictional Games Forum (read-only)
[SCRIPT] Scripting simple button - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Scripting simple button (/thread-13741.html)

Pages: 1 2


Scripting simple button - Froggit - 03-04-2012

(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



RE: Scripting simple button - Strembitsky - 03-04-2012

Use the wiki. It's your greatest friend, and you should have it open at all times while scripting.


RE: Scripting simple button - Froggit - 03-04-2012

(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:/



RE: Scripting simple button - flamez3 - 03-04-2012

void OnStart()
{
//callback goes here
}

//function here


RE: Scripting simple button - Strembitsky - 03-04-2012

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. >.>


RE: Scripting simple button - flamez3 - 03-04-2012

For a simple task like telling them where things go there isn't any point to make him go through a video.


RE: Scripting simple button - Strembitsky - 03-04-2012

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


RE: Scripting simple button - Froggit - 03-04-2012

(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



RE: Scripting simple button - flamez3 - 03-05-2012

(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)






RE: Scripting simple button - Froggit - 03-05-2012

(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