Frictional Games Forum (read-only)
still having script problem and a simple question - 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: still having script problem and a simple question (/thread-17228.html)

Pages: 1 2


RE: still having script problem and a simple question - zecuro - 07-25-2012

(07-25-2012, 04:48 AM)Your Computer Wrote:
(07-25-2012, 01:58 AM)zecuro Wrote: man it dosent work it look like i'm flying or something
Well, you did tell the script to move the player's head about 2 meters upward and never made it reset to its normal position.
is that it MovePlayerHeadPos(0, -2, 0, 2, -2);

why i'm flying


RE: still having script problem and a simple question - Your Computer - 07-25-2012

(07-25-2012, 02:10 PM)zecuro Wrote: is that it MovePlayerHeadPos(0, -2, 0, 2, -2);

why i'm flying

No, the one for T3.


RE: still having script problem and a simple question - zecuro - 07-25-2012

so this one (point with arrow)
else if (x == "T3")
{
FadeOut(2);
StopPlayerLookAt();
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
--> MovePlayerHeadPos(0, 2, 0, 2, 2) <--


RE: still having script problem and a simple question - zecuro - 07-26-2012

hey now i change all MovePlayerHeadPos (0, 0, 0, 0, 0);
but now he dosent look like he strugling to stand up he look like he already up.... i want it to do like in the begining of justine or amnesia dark descent this is what i tried to do well here a copy

void OnStart()
{
AddEntityCollideCallback("Player", "explode_scare", "Explode", true, 1);
AddUseItemCallback("", "key_1", "mansion_3", "FUNCTION", true);

FadeOut(0);
FadeIn(7);
SetPlayerActive(false);
SetPlayerCrouching(true);
SetInventoryDisabled(true);
MovePlayerHeadPos(-1, 0, 0, 0, -1);
StartPlayerLookAt("ScriptArea_1", 10, 10, "");
AddTimer("T1", 5.5, "TimerFunc");
AddTimer("T2", 10, "TimerFunc");
AddTimer("T3", 13.5, "TimerFunc");
AddTimer("T4", 16, "TimerFunc");
}

void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
}

void Explode(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("pot_explode", 0);
}

void TimerFunc(string &in asTimer)
{
string x = asTimer;

if (x == "T1")
{
FadeOut(4);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
}

else if (x == "T2")
{
FadeIn(3);
}

else if (x == "T3")
{
FadeOut(2);
StopPlayerLookAt();
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
MovePlayerHeadPos(0, 0, 0, 0, 0);
}

else if (x == "T4")
{
FadeIn(2);
SetPlayerActive(true);
SetPlayerCrouching(false);
SetInventoryDisabled(false);
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
}
}

void OnEnter()
{
AddEntityCollideCallback("Player", "bang", "func_slam", true, 1);
}

void OnLeave()
{
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_2", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}



RE: still having script problem and a simple question - Your Computer - 07-26-2012

Why did you reset your MovePlayerHeadPos? Don't you understand your own code? A fifth timer with a MovePlayerHeadPos that resets head position would have solved your "flying" issue.


RE: still having script problem and a simple question - zecuro - 07-26-2012

(07-26-2012, 03:00 AM)Your Computer Wrote: Why did you reset your MovePlayerHeadPos? Don't you understand your own code? A fifth timer with a MovePlayerHeadPos that resets head position would have solved your "flying" issue.
not really for real im new to this and trying out thing the thing work for now but like i said he dosen'T look like hes strugling to stand up u know and i really want it effect that you see in the begining of amnesia or justine its so nice and look so real