Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Please Help me!
Sanyam Offline
Junior Member

Posts: 7
Threads: 1
Joined: Dec 2012
Reputation: 0
#1
Please Help me!

Hi all, I am beginner in scripting and have some questions.

How to open the door with script? Not unlock, but open.

How to fix the position of the character's head on that door?

Thanks previously.
12-10-2012, 04:08 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#2
RE: Please Help me!

open automaticly?
Well that goos like this
---
Make an ScriptArea in the editor. { when the player walks over, you can make stuff happen "scripted" }
---
This below must put in the .hps file.

AddEntityCollideCallback("Player", "YOURSCRIPTNAMEINEDITOR", "TYPEWHATEVERYOUWANT", false, 1);
---->
Player = This is whenever the player\enemy\or whatever touches the ScriptArea will activate stuff... THIS time is the PLAYER i asume...
YOURSCRIPTNAMEINEDITOR = This is the name of the ScriptArea in the editor { you may change it offcourse }
TYPEWHATEVERYOUWANT = Here you may type whatever you want for example dooropenplease
false = one time of more times .. so false = Unlimited TIMES , true = only one time.
1 = while entering or leaving an script area... I never use this stuff.. always on 1 with all my scripts.

------------

void TYPEWHATEVERYOUWANT(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorDisableAutoClose("NAMEOFTHEDOORYOUWANTTOOPEN", true);
SetSwingDoorClosed("NAMEOFTHEDOORYOUWANTTOOPEN", false, true);
AddPropForce("NAMEOFTHEDOORYOUWANTTOOPEN", 0, 0, 5600, "world");
}
PS... this AddPropForce above you might need to change the values..
Cause i dont know witch way it need to open.....
So try change those 0, 0,5600 if its not working to
0,5600,0 or
5600,0,0
--> The 5600 is the FORCE to open it with... with some doors i think might be diffferent so ALSO may change it to lower or higher values, Just try some out! ps don't go over 50000... The door will fly into heavon.. ehhehee.
Or so on... you have to look for yourself how you want this to to be opend..
Hopefully it helps you a bit.
Btw here is a link for some good help for beginners and sometimes even for me :
http://frictionalgames.com/forum/thread-7085.html
PRESS ON THE SPOILER BELOW click to show
(This post was last modified: 12-10-2012, 04:38 PM by DnALANGE.)
12-10-2012, 04:32 PM
Find
Sanyam Offline
Junior Member

Posts: 7
Threads: 1
Joined: Dec 2012
Reputation: 0
#3
RE: Please Help me!

dnalange, Thanks, but another questions: How to fix character's head on that door?


1) The door Opens
2) GiveSanityDamage
3) Camera fixing on that door

And the second: Grunt is walking, but can't see and attack player even if he saw him. How to realise that idea?
(This post was last modified: 12-10-2012, 05:25 PM by Sanyam.)
12-10-2012, 05:21 PM
Find
str4wberrypanic Offline
Member

Posts: 241
Threads: 24
Joined: Jul 2012
Reputation: 8
#4
RE: Please Help me!

To make the player look at the door, use this script: ( i will use the functions of dnalange)

AddEntityCollideCallback("Player", "YOURSCRIPTNAMEINEDITOR", "TYPEWHATEVERYOUWANT", false, 1);



-------------


void TYPEWHATEVERYOUWANT(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorDisableAutoClose("NAMEOFTHEDOORYOUWANTTOOPEN", true);
SetSwingDoorClosed("NAMEOFTHEDOORYOUWANTTOOPEN", false, true);
AddPropForce("NAMEOFTHEDOORYOUWANTTOOPEN", 0, 0, 5600, "world");



StartPlayerLookAt("NAME OF THE DOOR", 6, 6, "");

AddTimer("", "PUT HERE THE TIME IN SECONDS THAT THE PLAYER WILL STAY LOOKING TO THE DOOR", "TimerStopLooking");





}




void TimerStopLooking(string&in asTimer)
{
StopPlayerLookAt();
}

12-10-2012, 05:34 PM
Find
Sanyam Offline
Junior Member

Posts: 7
Threads: 1
Joined: Dec 2012
Reputation: 0
#5
RE: Please Help me!

str4wberrypanic, No Matching signatures to AddTimer
(This post was last modified: 12-10-2012, 05:55 PM by Sanyam.)
12-10-2012, 05:55 PM
Find
str4wberrypanic Offline
Member

Posts: 241
Threads: 24
Joined: Jul 2012
Reputation: 8
#6
RE: Please Help me!

Oh, did you put quotes in the " time in seconds that the player wil stay looking to the door " ?
If you did, remove it and try again. It should work.

12-10-2012, 06:13 PM
Find
Sanyam Offline
Junior Member

Posts: 7
Threads: 1
Joined: Dec 2012
Reputation: 0
#7
RE: Please Help me!

Grunt is walking, but can't see and attack player even if he saw him. How to realise that idea?
12-10-2012, 06:51 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#8
RE: Please Help me!

(12-10-2012, 06:51 PM)Sanyam Wrote: Grunt is walking, but can't see and attack player even if he saw him. How to realise that idea?
SetEnemyDisableTriggers(string& asName, bool abX);

Put this in your function. Like:

void Function (parameters)
{
SetEnemyDisableTriggers("Grunt", true);
}

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
12-10-2012, 07:55 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#9
RE: Please Help me!

Ok here is your script... Just COPY PASTE :
THIS AT Void OnONTER() --->
{
AddEntityCollideCallback("Player", "YOURSCRIPTNAMEINEDITOR", "TYPEWHATEVERYOUWANT", false, 1);
}
This below In your scipt
--->

void TYPEWHATEVERYOUWANT(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorDisableAutoClose("NAMEOFTHEDOORYOUWANTTOOPEN", true);
SetSwingDoorClosed("NAMEOFTHEDOORYOUWANTTOOPEN", false, true);
AddPropForce("NAMEOFTHEDOORYOUWANTTOOPEN", 0, 0, 5600, "world");

SetEnemyDisableTriggers("YOURENEMYNAME", true);

StartPlayerLookAt("NAME OF THE DOOR", 6, 6, "");

AddTimer("", "5.0f", "TimerStopLooking");

GiveSanityDamage(10.0f, true);
}

void TimerStopLooking(string&in asTimer)
{
StopPlayerLookAt();
FadeEnemyToSmoke("YOURENEMYNAME", true);
}
----------------------------------------------------------------
REPLACE THE ITEMS\ENEYMY names to your things in the editor!
FadeEnemyToSmoke = will DEACTIVATE your enemy, this time in 5 seconds ---> { like it fades into smoke } Or just deactivate by this script:
SetEntityActive("NAME OF THE ENEMY", false); --> false means it will be DE-activated
,
AddTimer("", "5.0f", "TimerStopLooking"); ---> Means after 5 seconds "TimerStopLooking" will be activated.
The 5.0f = 5 seconds ,
The "TimerStopLooking" is the scripted timername, you may name whatever you want to.

Grunt is walking, but can't see and attack player even if he saw him. How to realise that idea?
--? What do you mean here???
I think i fixed that in the script above.. let us know here if it worked.
(This post was last modified: 12-10-2012, 09:05 PM by DnALANGE.)
12-10-2012, 08:51 PM
Find
Sanyam Offline
Junior Member

Posts: 7
Threads: 1
Joined: Dec 2012
Reputation: 0
#10
RE: Please Help me!

Thanks very much to all! I will + your reputation. =)
12-11-2012, 07:16 PM
Find




Users browsing this thread: 2 Guest(s)