Contents
English (United Kingdom)French (Fr)Deutsch (DE-CH-AT)
Random Thumbnail
alrf_01.jpg
Search
Login
Who Is Online?
We have 66 guests and 7 members online
Navigation
Home Descent 3 Descent 3 construction Take a key, activate a switch, and exit.
Most Recent
Featured Articles
Joomla 1.5 Featured Articles
Navigation
Home Descent 3 Descent 3 construction Take a key, activate a switch, and exit.
English (United Kingdom)French (Fr)Deutsch (DE-CH-AT)
Take a key, activate a switch, and exit. E-mail
User Rating: / 3
PoorBest 
Descent 3 - Descent 3 construction
Written by Mzero   
Wednesday, 07 March 2012 16:12

Take a key, activate a switch, and exit the mine.

 

We assume we own a door in our level which should be unlocked with a key.

Here is your door. It needs a name in order to be scripted.

Just press the door button and enter a name for your door. Mine is "BlueDoor" :

d3editSwitchKey02

You will unlock the door by taking a key.

Now you can lock the door BlueDoor at level start in the Dallas graphical script editor :

d3editSwitchKey01

With the Object bar, choose and insert a key.

Ctrl+leftClick in 2D views to set the place where the key will be inserted.

Your key needs a name too. Mine is "BlueKey" :

d3editSwitchKey06

d3editSwitchKey05

With the script below, the player will take the key. In singleplayer, the key will disappear. In coop, it will respawn, but the key wont react when a player collide it a second time.

The door will be unlocked.

In this script, taking the key also completes a level goal :

d3editSwitchKey09

The goal is set with the Goal window :

d3editSwitchKey07

Dont forget to save your level after you set a goal when you intend to use the goal in scripts.

Enable your goals in the scripts :

d3editSwitchKey08

Now your door is unlocked and you have access to a switch that will unlock your exit door.

This switch needs a name too. Mine is "ExitSwitch" :

d3editSwitchKey03

d3editSwitchKey04

In the Object bar, press the "info" button to see the number of animated frames for your switch.

Mine has 6 animated frames. Using this number, the switch will go back to initial position after its animation.

With the script below, the switch will be activated (only once) by the player and exit door will be unlocked :

d3editSwitchKey09b

But then? Maybe play an alarm siren and start a countdown?

You need a timer for this. Press the "User Types Workshop" button in the Dallas graphical script editor :

d3editSwitchKey10

Selet "TimerID" and create a timer. Mine is "ExitTimer" :

d3editSwitchKey11

With the script below, the count down will start (only once) when the player unlocks the exit door by hitting the switch :

d3editSwitchKey12

Note : a timer needs and object. It can be any non-destroyable object. Here it is the switch itself, but it is not required.

The player has to exit the mine before the countdown is over :

d3editSwitchKey13

Lets say exit the mine is a goal. A portal trigger may be used to see if the player reached the exit or not.

Select a  portal face, on the way to outside :

d3editSwitchKey14

With the "Triggers" window, add a trigger to that portal and name it.

Mine is "ExitTrigger" :

d3editSwitchKey15

With the script below, the goal "Exit the mine" will be completed when a player goes through the portal :

d3editSwitchKey16

During the game, Shift+Tab will show the objectives you set in the goal window :

d3editSwitchKey17

The guidebot will lead you to the objects you chose in the goal window for your goals :

d3editSwitchKey18

Note : the guidebot wont be able to lead you as long as doors are still locked.

Last Updated on Wednesday, 07 March 2012 18:14
 
You need to login or register to post comments.
Discuss this item on the forums. (18 posts)
Discuss (18 posts)
Re: Take a key, activate a switch, and exit.
Mar 16 2012 19:18:52
Charly01 wrote:
Can you make the alarm say, "system overload" when you set it off for the place to blow up?
I guess he's not that far yet.
#1283
Re: Take a key, activate a switch, and exit.
Mar 16 2012 19:17:50
Atan wrote:
@Thomas
D3Edit, a quick look and here is what I found:
//add quotes around the strings
sprintf(Source_filename,"\"%s\"",temp_sourcefilename);
sprintf(Output_filename,"\"%s\"",temp_outputfilename);
sprintf(DLLInit_filename,"\"%s\"",temp_dllinitfilename);

I just had a look at virtualgcc. D3Edit already invokes it with no spaces around the directory name. It's not possible to fix this within virtualgcc.

-dir C:\Program files...

Your snippet doesn't show how this parameter is generated in D3Edit. It only shows the files.
#1282
Re: Take a key, activate a switch, and exit.
Mar 16 2012 17:41:22
@Fox1
you are welcome!
#1281
Take a key, activate a switch, and exit.
Mar 16 2012 17:14:12
Atan,

Thank you for your patience.

I did notice the files before and I did use them but I installed into a folder with a space in the name.

I have now completely uninstalled Descent and D3Edit and reinstalled them exactly as per instructions.

I have just built a two room level with a key and cobbled together a script which worked and I was able to pick up the key...so I am very happy that I now have an environment which works and I just need to concentrate on the scripting tutorials rather than my dodgy installation.

I will now use Mzero's excellent article to try and do a bit more.

Kind Regards

Fox1
#1280
Re: Take a key, activate a switch, and exit.
Mar 16 2012 15:18:07
@Thomas
What's the best approach now?
To tell the users via tutorial not to use spaces in Filenames.

Then, if time, I could give it a try next update-time.

@Fox1
gcc.exe not found in your path, please verify that your PATH environment variable is setup correctly
Did you noticed these infos below and did you use them?
Having a look would be useful and using the D3Edit- installer should configure all well for you. USe the D3Edit-Installer again to correct faults

www.dateiliste.com/de/descent-3/72-desce...stalling-d3edit.html

www.dateiliste.com/de/descent-3/72-desce...nd-gcc-compiler.html ?

@Charly01
what's the meaning of your post, if any?
#1279
Take a key, activate a switch, and exit.
Mar 16 2012 14:32:40
Not sure if this is what Atan and Thomas are talking about but having changed my editor paths I now get the following:

Virtual GCC Compiler layer for Descent 3
Copyright 1999 Outrage Entertainment
Source: "c:\games\descent3\editor\sdk\osiris\ludo.cpp"
Output: "c:\games\descent3\editor\sdk\osiris\ludo.dll"
DLLinit: "C:\GAMES\Descent3\Editor\SDK\osiris\dllinit.c"
Debug Info: C7
Warning Level: 3
DLL Type: Level Script
gcc.exe not found in your path, please verify that your PATH environment variable is setup correctly, and it includes your bin directory of your gcc installation
example:
set PATH=C:\Windows;C:\Windows\Command;C:\EGCS-1.1.2\bin

Not sure what to do with this message...any advice?

Regards

Fox1
#1278
Take a key, activate a switch, and exit.
Mar 16 2012 00:08:51
Can you make the alarm say, "system overload" when you set it off for the place to blow up?
#1277
Re: Take a key, activate a switch, and exit.
Mar 15 2012 20:11:47
Thanks, Atan.

Ah, well, there we go (excerpt from VirtualGCC):

sprintf(command_line,"gcc.exe -I. -I%s -mwindows -o %s -c %s %s %s %s",Working_directory,output_object, Source_filename,WarningLevelString, ChecksumString,DebugLevelString);




So, I reckon we found the culprit. It's not GCC and not D3Edit but VirtualGCC instead.

What's the best approach now? Fix VirtualGCC or work around it in D3Edit with the GetShortPathName () function?

If we fix it in VirtualGCC it probably won't be long and the next one encounters the same problem because they're still using the version that can be downloaded from every second D3 page.
#1276
Re: Take a key, activate a switch, and exit.
Mar 15 2012 17:25:46
@Thomas
D3Edit, a quick look and here is what I found:
//add quotes around the strings
sprintf(Source_filename,"\"%s\"",temp_sourcefilename);
sprintf(Output_filename,"\"%s\"",temp_outputfilename);
sprintf(DLLInit_filename,"\"%s\"",temp_dllinitfilename);
#1275
Re: Take a key, activate a switch, and exit.
Mar 14 2012 23:02:15
Dadas had the same error and found the fix. Thanks Dadas
It was because of the space between "Program" and "Files". You may copy your SDK folder and paste it in an other place, for instance in "documents", but not in "documents and settings" because of the space, or in any place with no space in the name.
Then you open the editor settings and you browse for the new paths :
"Virtul compiler path" to "YourPlace\SDK\bin\virtualgcc.exe" and "Script directory" to "YourPlace\SDK\osiris".
It should work for the GCC to compile now.
#1274
Re: Take a key, activate a switch, and exit.
Mar 14 2012 22:16:34
As Thomas said, there are missing quotation marks in gcc command line
(gcc.exe: c:\program\!ludo.cpp: No such file or directory
gcc.exe: No input files
Error compiling "c:\program\!ludo.cpp"
)

It was looking for your .cpp file in C:\Program instead of program files because Program Files has space in it's name, you can fix it by moving your scripts directory to a directory without spaces (for example C:\scripts)
#1273
Re: Take a key, activate a switch, and exit.
Mar 14 2012 22:12:40
Fox1 wrote:
DLL Type: Level Script
Using gcc.exe found in C:\Program Files (x86)\Descent3\Editor\EGCS\bin
Warning: C7/COFF Debug information not supported, using gcc default debug info
gcc.exe: c:\program\!ludo.cpp: No such file or directory
gcc.exe: No input files
Error compiling "c:\program\!ludo.cpp"

Atan, I guess that's either a bug in D3Edit or in VirtualGCC. They should enclose the path including the filename in double quotation marks before it is passed on to GCC.

Is the editor using double quotation marks?
#1272
Re: Take a key, activate a switch, and exit.
Mar 14 2012 21:42:35
I dont know, by maybe a problem with the paths and the spaces.
The error message says :
gcc.exe: c:\program\!ludo.cpp: No such file or directory
And it should say :
gcc.exe: c:\program files(x86)\Descent3\Editor\SDK\Osiris\!ludo.cpp
Your cpp files exists, and the D3Edit knows its path because it can open it!
It seems that the space between the word "program" and the word "files" makes an error for The GCC compiler.
Can it be?

The site prepare4descent seems off line now. I thought the pages would be moved to planetdescent.net, but I cant find them there. I cant find that "script a switch" article no more.
#1271
Take a key, activate a switch, and exit.
Mar 14 2012 21:37:12
Atan,

Thanks.

I will have another try tomorrow after the football.

Regards

Fox1
#1270
Re: Take a key, activate a switch, and exit.
Mar 14 2012 19:38:55
@Fox1

One Problem I remember with the GCC was the Slash:

GCC_EXEC_PREFIX: C:\EGCS112\lib\gcc-lib\ (Slash ON)

PATH: C:\EGCS112\bin (Slash OFF)

(D3Edit) Script Directory: D:\D3SDK\osiris\ (Slash ON)

And maybe you should remove the '!' from "!LUDO" and try it again but I'm not sure with this.

Other info:
This is your first script?
If so, please have a look here first: www.descentforum.de/forum/viewtopic.php?t=1814&start=0
WillyP put all that info I placed over there into one tutorial but I can't find the site to download it again. (www.prepare4descent.net/)
This Script was called Script a switch. You may contact him to get this one because it's very helpful for the start with DALLAS.
#1269
Re: Take a key, activate a switch, and exit.
Mar 14 2012 15:51:39
Thomas,

Thanks for your advice, I am a beginner so please excuse any dumb questions.

I used Quicktest and ensured that the cpp and msg files in OSIRIS were inserted before saving the MN3, but I cannot see any dll files? My level is called !LUDO and is a product of me using the basic 10 tutorials for a previous incarnation of D3Edit.

I tried to save the script but it comes back with the following error.

DLL Type: Level Script
Using gcc.exe found in C:\Program Files (x86)\Descent3\Editor\EGCS\bin
Warning: C7/COFF Debug information not supported, using gcc default debug info
gcc.exe: c:\program\!ludo.cpp: No such file or directory
gcc.exe: No input files
Error compiling "c:\program\!ludo.cpp"

But.. !ludo.cpp does exist in
C:\Program Files (x86)\Descent3\Editor\SDK\Osiris so is there something wrong with the way I have installed gcc.exe or how it is set up?

How do I fix it?

Regards

Fox1
#1267
Re: Take a key, activate a switch, and exit.
Mar 13 2012 22:29:01
Hello Fox,

Fox1 wrote:
Does it matter what type of door I use? Does it matter what object I use as a key?
Any door should be just fine.

Currently I see the blue key but cannot pick it up and I cannot open the locked door to see if the trigger I have created on the exit enables me to escape from the mine.
I believe you didn't inlude your script in the final mission file (mn3).

Make sure Quicktest is visible by clicking on the Q button. Inside Quicktest panel is a button "Insert >>". Click on it and select "File(s)...". Then navigate to your Osiris folder which is in a subfolder of where you installed the editor to, if you have used the installer.
Examples:
C:\Games\Descent3\Editor\SDK\osiris
C:\Program files\Descent3\Editor\SDK\osiris

You need to include all files that have the name of your mission, at least the .dll and the .msg file. It is an act of courtesy to others if you include the .cpp file too. GCC produces an additional .o file which is not required but of course it doesn't hurt either if you include it.

Could this be done without scripting?
No.

The Dallas editor is working and I have been picking my way through the syntax building but I cannot seem to compile anything.
The "Dallas Graphical Script Editor" compiles when you click on the Save button.
#1264
Take a key, activate a switch, and exit.
Mar 13 2012 15:51:05
Mzero,
Thanks for this but I am struggling a bit never having used Dallas before or D3Edit until recently so all your help is appreciated.

I will try again to make this work with the 20 room level that I have now built but before I do are Scripts 003 and 005 missing?

Does it matter what type of door I use? Does it matter what object I use as a key?

Currently I see the blue key but cannot pick it up and I cannot open the locked door to see if the trigger I have created on the exit enables me to escape from the mine.

Could this be done without scripting?

The Dallas editor is working and I have been picking my way through the syntax building but I cannot seem to compile anything.

I could spend hours going around in circles but having invested this much time I guess I would like to succeed.So this is a cry for any help you can offer.

Thanks.
#1262