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
How do I do [X] questions here
Montonago Offline
Junior Member

Posts: 4
Threads: 2
Joined: Feb 2011
Reputation: 0
#1
How do I do [X] questions here

I have a few things I want to try, but I'm not sure how I would script them:

I would like to have a crank or wheel activate some sort of event, for example, have wood_crank_1 unlock castle_door_2 when it reaches it's maximum rotation. Allowing the player into the room to retrieve an item to unstuck another wheel that moves an obstacle in front of a lever to open a secret door, etc. I don't know how to make the wheels/cranks do things when they reach the maximum/minimum rotation, and I don't know how to do the secret door event like in the Old Archives.

I would also like to create a lighting effect like they used in Harry Potter: The Sorcerer's Stone, where when the player is near a light it will self-ignite, and when they get x amount away from the light source, it extinguishes. I'm assuming this has to do with areas, but I'm not sure how that would be set up. Any help would be appreciated. Thanks! Smile

Also, feel free to post any "How do I do [x]" questions here to save thread space. Wink
(This post was last modified: 02-21-2011, 06:33 PM by Montonago.)
02-20-2011, 04:02 PM
Find
LSunday Offline
Junior Member

Posts: 46
Threads: 1
Joined: Feb 2011
Reputation: 0
#2
RE: A few probably simple problems

I'm going to save the world another "how do I do X?" thread and ask here (especially because i'm not even sure it's possible). Is there a way to make a plane active/inactive, or if not, to move it? I'm trying to create a water effect where the water appears in an area you've been in safely. I looked at the way it was done in the archive cellar, and they teleported the player into an area where it was flooded- unfortunately, that wouldn't really work for the sequence i'm putting together. Any guidlines on how to do it?

And, in other news... I've been trying to get a series of timers to work, but they keep giving me a variety of error messages based on what I change. Here's a sample of one of them (they're all almost identical):

AddTimer("Collapse1", 2.0f, "Collapse_1");
Collapse_1(Collapse1);
{
SetEntityActive("dungeon_small01_5", true);
SetEntityActive("dungeonrubble1", true);
}

The above is inside a working entity collide, if that changes anything. The error message is: "Collapse1 is not declared." However, if i put the 'string &in' back into the parenthesis, i get "expected '('" at the same position. I realize I'm probably being really stupid, but I can't find what should go in that spot.

And please no link to the wiki, because that's where I copypasta'd most of this coding from.
(This post was last modified: 02-20-2011, 06:09 PM by LSunday.)
02-20-2011, 04:33 PM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#3
RE: A few probably simple problems

Quote:void justanexample(string &in asParent, string &in asChild, int alState)
{
AddTimer("Collapse1", 2.0f, "Collapse_1");
}
void Collapse_1(Collapse1); never put a semicolon behind a void function.
{
SetEntityActive("dungeon_small01_5", true);
SetEntityActive("dungeonrubble1", true);
}

The correct code:
void OnStart()
{
AddTimer("Collapse1", 2.0f, "Collapse_1"); //you can put this into other functions aswell
}

void Collapse_1(string &in asTimer)
{
SetEntityActive("dungeon_small01_5", true);
SetEntityActive("dungeonrubble1", true);
}

[Image: 18694.png]
(This post was last modified: 02-20-2011, 09:51 PM by Ongka.)
02-20-2011, 09:50 PM
Find
LSunday Offline
Junior Member

Posts: 46
Threads: 1
Joined: Feb 2011
Reputation: 0
#4
RE: A few probably simple problems

Now I keep getting an "expected '('" error, which is what i was originally trying to fix when i started deleting/adding stuff from the code. The area it's giving to me as the 'problem' is the void Collapse_1(string &in asTimer) area, but I don't know what's missing/extra there.

From what I can tell, what you gave me was what I originally had before I started screwing with it, and I can't figure out what's wrong with it.
02-21-2011, 12:21 AM
Find
Selyp Offline
Member

Posts: 210
Threads: 19
Joined: Feb 2011
Reputation: 7
#5
RE: A few probably simple problems

Edit: nevermind I was thinking something different, I'm not sure of the problem. :-(

Atlantia - An Amnesia: The Dark Descent Full Conversion Mod
(This post was last modified: 02-21-2011, 01:10 AM by Selyp.)
02-21-2011, 01:09 AM
Find
LSunday Offline
Junior Member

Posts: 46
Threads: 1
Joined: Feb 2011
Reputation: 0
#6
RE: A few probably simple problems

This is the full code, if anyone can find a problem with it;

void OnStart()
{
AddEntityCollideCallback("Player", "Ceiling_collapse", "Collide_Area", true, 1);
}

void Collide_Area(string &in asParent , string &in asChild , int alState)
{
StartScreenShake(3, 9.0f, 1.0f, 3.0f);
SetEntityActive("dungeon_entrance_flood", true);
AddTimer("Collapse1", 2.0f, "Collapse_1");
AddTimer("Collapse2", 2.8f, "Collapse_2");
AddTimer("Collapse3", 3.4f, "Collapse_3");
AddTimer("Collapse4", 1.4f, "Collapse_4");
AddTimer("Collapse5", 4.6f, "Collapse_5");
AddTimer("Collapse6", 5.2f, "Collapse_6");
AddTimer("Collapse7", 5.9f, "Collapse_7");
AddTimer("Collapse8", 6.5f, "Collapse_8");
AddTimer("Collapse9", 7.0f, "Collapse_9");
AddTimer("Collapse10", 7.8f, "Collapse_10");
AddTimer("Collapse11", 8.7f, "Collapse_11");
void Collapse_1(string &in asTimer)
{
SetEntityActive("dungeon_small01_5", true);
SetEntityActive("dungeonrubble1", true);
}
void Collapse_2(string &in asTimer)
{
SetEntityActive("dungeonrubble2", true);
SetEntityActive("rock_large01_push_8", true);
}
void Collapse_3(string &in asTimer)
{
SetEntityActive("dungeonrubble3", true);
SetEntityActive("dungeonrubble4", true);
}
void Collapse_4(string &in asTimer)
{
SetEntityActive("dungeonrubble5", true);
SetEntityActive("dungeonrubble6", true);
}
void Collapse_5(string &in asTimer)
{
SetEntityActive("dungeonrubble7", true);
SetEntityActive("dungeonrubble8", true);
}
void Collapse_6(string &in asTimer)
{
SetEntityActive("dungeonrubble9", true);
SetEntityActive("dungeonrubble11", true);
}
void Collapse_7(string &in asTimer)
{
SetEntityActive("dungeonrubble12", true);
SetEntityActive("dungeonrubble13", true);
}
void Collapse_8(string &in asTimer)
{
SetEntityActive("dungeonrubble14", true);
SetEntityActive("dungeonrubble15", true);
}
void Collapse_9(string &in asTimer)
{
SetEntityActive("dungeonrubble16", true);
SetEntityActive("dungeonrubble17", true);
}
void Collapse_10(string &in asTimer)
{
SetEntityActive("dungeonrubble18", true);
SetEntityActive("dungeonrubble19", true);
}
void Collapse_11(string &in asTimer)
{
SetEntityActive("dungeonrubble20", true);
SetEntityActive("dungeonrubble10", true);
}
}

I know the CollidePlayer with Area thing works, because I tested that before adding in all the timers to drop the pieces at different intervals.
(This post was last modified: 02-21-2011, 02:10 AM by LSunday.)
02-21-2011, 02:09 AM
Find
Zirg Offline
Junior Member

Posts: 14
Threads: 4
Joined: Feb 2011
Reputation: 0
#7
RE: A few probably simple problems

There's no } after AddTimer("Collapse11", 8.7f, "Collapse_11");
Instead, it's all the way down.
(This post was last modified: 02-21-2011, 02:43 AM by Zirg.)
02-21-2011, 02:41 AM
Find
LSunday Offline
Junior Member

Posts: 46
Threads: 1
Joined: Feb 2011
Reputation: 0
#8
RE: How do I do [X] questions here

Ahhh! Now it works!
02-21-2011, 04:53 AM
Find
Montonago Offline
Junior Member

Posts: 4
Threads: 2
Joined: Feb 2011
Reputation: 0
#9
RE: How do I do [X] questions here

I'm trying to get a lever to unlock a door, and I've tried several things but none of them seem to work... Anyone know how to do this?
02-21-2011, 06:31 PM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#10
RE: How do I do [X] questions here

http://www.frictionalgames.com/forum/thread-5117.html

And look up "Make a lever functional".

[Image: 18694.png]
02-21-2011, 07:17 PM
Find




Users browsing this thread: 2 Guest(s)