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
Script Help Script help needed
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#21
RE: Script help needed

Like that. Unless I am wrong, which is unlikely.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
10-06-2012, 08:02 PM
Website Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#22
RE: Script help needed

(10-06-2012, 08:02 PM)Steve Wrote:
(10-05-2012, 08:33 PM)The chaser Wrote: Whoa, I just can't read the script that way. Put it in code, remember. I'm practising with these, maybe I can solve your problem.
you mean like this?
const string[] oven_sticky_areas = {"OvenArea_1", "OvenArea_2", "OvenArea_3", "OvenArea_4"};
const string oven_object_name = "object";
const string oven_door_name = "extaction_oven_6";
const string oven_lever_name = "Lever_1";
void OnStart()
{
SetEntityConnectionStateChangeCallback(oven_lever_name, "CheckIngredients");
}
////////////LEVER CHECK/////////////////
void CheckIngredients(string &in asEntity, int alState)
{
if(alState == 1)
{
if (GetLocalVarInt(oven_sticky_areas[0]) == 1
&& GetLocalVarInt(oven_sticky_areas[1]) == 1
&& GetLocalVarInt(oven_sticky_areas[2]) == 1
&& GetLocalVarInt(oven_sticky_areas[3]) == 1)
{
AddDebugMessage("OvenPuzzle: Correct!", false);
AddTimer("CompleteOvenPuzzle", 1, "CompleteOvenPuzzle");
}
else
{
AddDebugMessage("OvenPuzzle: Wrong!", false);
SetMessage("Messages", "IncorrectCombination", 0);
}
}
}
void AttachObjectOven(string &in asStickyArea, string &in asBodyName)
{
if (StringContains(asBodyName, oven_object_name))
SetAllowStickyAreaAttachment(true);
else
{
SetAllowStickyAreaAttachment(false);
return;
}
AddDebugMessage(asStickyArea + " " + asBodyName, true);
asBodyName = StringSub(asBodyName, 0, oven_object_name.length() + 2);
AddDebugMessage(asBodyName, false);
if (StringContains(asStickyArea, "1") && StringContains(asBodyName, "1"))
SetLocalVarInt(asStickyArea, 1);
else if (StringContains(asStickyArea, "2") && StringContains(asBodyName, "2"))
SetLocalVarInt(asStickyArea, 1);
else if (StringContains(asStickyArea, "3") && StringContains(asBodyName, "3"))
SetLocalVarInt(asStickyArea, 1);
else if (StringContains(asStickyArea, "4") && StringContains(asBodyName, "4"))
SetLocalVarInt(asStickyArea, 1);
}
void DetachObjectOven(string &in asStickyArea, string &in asBodyName)
{
SetLocalVarInt(asStickyArea, 0);
}
void CompleteOvenPuzzle(string &in asTimer)
{
SetSwingDoorLocked(oven_door_name, false, true);
SetMessage("Messages", "correctcombinationchemicals", 0);
}
Directly from your script, please. There is a lot of missing things, and I'm very sure that isn't your real problem.
Sorry, but could you post your .hps file in [/code]? If I'm not wrong, the code function allows to copy/paste a code well, instead a normal post.

It's just that with that mess I cannot understand a single thing.

(doesn't mean you are a bad scripter Wink )

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
10-06-2012, 08:32 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#23
RE: Script help needed

The only thing that could possibly be wrong with the way Steve attempted to make it work, is either through bad entity name referencing or bad function name reference for the sticky areas.

(10-06-2012, 08:02 PM)Nemet Robert (Robby) Wrote: Like that. Unless I am wrong, which is unlikely.

What's the difference between the content found in the code box and the content found in the spoiler box? A white background.

Tutorials: From Noob to Pro
(This post was last modified: 10-06-2012, 08:39 PM by Your Computer.)
10-06-2012, 08:37 PM
Website Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#24
RE: Script help needed

Answer's directly above your post.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
(This post was last modified: 10-06-2012, 08:46 PM by Robby.)
10-06-2012, 08:45 PM
Website Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#25
RE: Script help needed

(10-06-2012, 08:32 PM)The chaser Wrote:
(10-06-2012, 08:02 PM)Steve Wrote:
(10-05-2012, 08:33 PM)The chaser Wrote: Whoa, I just can't read the script that way. Put it in code, remember. I'm practising with these, maybe I can solve your problem.
you mean like this?
const string[] oven_sticky_areas = {"OvenArea_1", "OvenArea_2", "OvenArea_3", "OvenArea_4"};
const string oven_object_name = "object";
const string oven_door_name = "extaction_oven_6";
const string oven_lever_name = "Lever_1";
void OnStart()
{
SetEntityConnectionStateChangeCallback(oven_lever_name, "CheckIngredients");
}
////////////LEVER CHECK/////////////////
void CheckIngredients(string &in asEntity, int alState)
{
if(alState == 1)
{
if (GetLocalVarInt(oven_sticky_areas[0]) == 1
&& GetLocalVarInt(oven_sticky_areas[1]) == 1
&& GetLocalVarInt(oven_sticky_areas[2]) == 1
&& GetLocalVarInt(oven_sticky_areas[3]) == 1)
{
AddDebugMessage("OvenPuzzle: Correct!", false);
AddTimer("CompleteOvenPuzzle", 1, "CompleteOvenPuzzle");
}
else
{
AddDebugMessage("OvenPuzzle: Wrong!", false);
SetMessage("Messages", "IncorrectCombination", 0);
}
}
}
void AttachObjectOven(string &in asStickyArea, string &in asBodyName)
{
if (StringContains(asBodyName, oven_object_name))
SetAllowStickyAreaAttachment(true);
else
{
SetAllowStickyAreaAttachment(false);
return;
}
AddDebugMessage(asStickyArea + " " + asBodyName, true);
asBodyName = StringSub(asBodyName, 0, oven_object_name.length() + 2);
AddDebugMessage(asBodyName, false);
if (StringContains(asStickyArea, "1") && StringContains(asBodyName, "1"))
SetLocalVarInt(asStickyArea, 1);
else if (StringContains(asStickyArea, "2") && StringContains(asBodyName, "2"))
SetLocalVarInt(asStickyArea, 1);
else if (StringContains(asStickyArea, "3") && StringContains(asBodyName, "3"))
SetLocalVarInt(asStickyArea, 1);
else if (StringContains(asStickyArea, "4") && StringContains(asBodyName, "4"))
SetLocalVarInt(asStickyArea, 1);
}
void DetachObjectOven(string &in asStickyArea, string &in asBodyName)
{
SetLocalVarInt(asStickyArea, 0);
}
void CompleteOvenPuzzle(string &in asTimer)
{
SetSwingDoorLocked(oven_door_name, false, true);
SetMessage("Messages", "correctcombinationchemicals", 0);
}
Directly from your script, please. There is a lot of missing things, and I'm very sure that isn't your real problem.
Sorry, but could you post your .hps file in [/code]? If I'm not wrong, the code function allows to copy/paste a code well, instead a normal post.

It's just that with that mess I cannot understand a single thing.

(doesn't mean you are a bad scripter Wink )

Well this is the entire script, I got it from YC if you go a bit back and I have it in [/code]

And also I have no idea actually what I am missing, If somebody might have an idea I could upload the map itself if you PM me because I'd rather not post it here wide and open Tongue

CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
10-06-2012, 09:37 PM
Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#26
RE: Script help needed

still nothing...

CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
10-08-2012, 03:23 PM
Find




Users browsing this thread: 2 Guest(s)