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 A question of variables
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#1
A question of variables

Hi, forum.
Maybe I'm being heavy with all my questions, but it's just that i didn't find what i was searching, and i think that in this forum someone will know it.

How can i make this:
If you carry a hammer, wooden planks appear when crossing a script area.
If you don't (the most interesting for me) there are no wooden planks and a monster chases you.
I think it's something like:

void ASDF
{
if (HasItem)== Hammer)
{
SetEntityActive("wooden", true);
}
else
{
SetEntityActive("servant_2", true);
}
}

it says "expected expression value"
If I knew this my map should be fixed.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
(This post was last modified: 08-31-2012, 04:16 PM by The chaser.)
08-31-2012, 04:16 PM
Find
GoranGaming Offline
Member

Posts: 183
Threads: 30
Joined: Feb 2012
Reputation: 7
#2
RE: A question of variables

if(HasItem("Hammer")){
blablabla
}else{
blablabla
}

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
08-31-2012, 04:22 PM
Website Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#3
RE: A question of variables

Isn't it:

if(HasItem("Hammer") == true)
{

}

Trying is the first step to success.
08-31-2012, 04:44 PM
Find
GoranGaming Offline
Member

Posts: 183
Threads: 30
Joined: Feb 2012
Reputation: 7
#4
RE: A question of variables

Oh, yes I think so

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
08-31-2012, 04:46 PM
Website Find
shadowZgamerZ Offline
Junior Member

Posts: 18
Threads: 3
Joined: Jul 2012
Reputation: 1
#5
RE: A question of variables

The way to do this:

void OnEnter
{
AddEntityCollideCallback("Player", "AREANAME", "FUNCTIONNAME", true, 1);
}

void FUNCTIONNAME(string &in asParent, string &in aChild, int alState)
{
if(HasItem("hammer") == true)
{
SetEntityActive("wooden", true);
}
else
{
SetEntityActive("servant_2, true);
}

NOTE: Function will reactivate itself if Player reenters the map, or put the script under OnStart(). Than, script will be activated when player visits the map for its first time only.

Project: Another Penumbra Story - Chapter 1 - Deep Underground
Level Editor: 18%, Scripting: 8%, Gameplay: 3 hours or more!
(This post was last modified: 08-31-2012, 04:48 PM by shadowZgamerZ.)
08-31-2012, 04:47 PM
Find




Users browsing this thread: 2 Guest(s)