PDA

View Full Version : Scripting Limit Question


EnderWiggin
12-09-2004, 10:53 AM
This is a scripting question thread. My First Question is, Is there a way to Have the same door take you to different modules? Like, Could I have a door that when opened, could say something like "Field" and then have the field have different npcs and quests and things by making Field1.mod, Field2.mod etc, and then have it Take Me to Field One the first time, Field 2 the next etc?

_EW_

tk102
12-09-2004, 10:57 AM
I can think of two ways you can do this...

You could make the door sort of like an elevator where the person could choose their destination (ala Dialog attached to the Conversation tag of the .utd whose different branches have scripts which call separate StartNewModule functions).

Or you could have the OnOpen script of the .utd fire a script which looks up the value of a Global Variable and decide from that which module to launch (user gets no choice).

EnderWiggin
12-09-2004, 11:02 AM
I would need the 2nd one. Thanks! The next question is, how do you get the location, (Whereami Values), For people behind a bar? And how would I do That 2nd option? (What script would I use and how do i do Globals?)

_EW_

Darth333
12-09-2004, 11:04 AM
Originally posted by tk102

You could make the door sort of like an elevator where the person could choose their destination (ala Dialog attached to the Conversation tag of the .utd whose different branches have scripts which call separate StartNewModule functions).

A talking door? Wouldn't that be a little weird? You could also plant a computer beside the door that would ask you where to go or why not a desk with a receptionnist?


You can have a look at the dlg in my warping armband mod: door, placeable, npc dialogue, it's all the same ;)

tk102
12-09-2004, 11:09 AM
For the XYZO values, take a look at the .git file for that module -- they should be in there for that .utc.

For the script it would something like this:

void main() {
int nGoWhere = GetGlobalNumber("your_globalvar");
switch (nGoWhere)
{
case 1:
StartNewModule("modulename1");
break;
case 2:
StartNewModule("modulename2");
break;
//etc...
}
}

tk102
12-09-2004, 11:15 AM
A talking door? Wouldn't that be a little weird? You could also plant a computer beside the door that would ask you where to go or why not a desk with a receptionnist?
Just set the ComputerType flag to 1 and make the conversation a computer interface.

Doom_Dealer
12-09-2004, 11:29 AM
Originally posted by Darth333
A talking door? Wouldn't that be a little weird? You could also plant a computer beside the door that would ask you where to go or why not a desk with a receptionnist?


You can have a look at the dlg in my warping armband mod: door, placeable, npc dialogue, it's all the same ;)


lol, good point, But ive used it before, if you just pretend its an elevator its quite effective :)