|
This script was not for this site, but for Skyalmian for his project "Lunar Outpost MN0012" when he needed a cloaking device for the ship just like the one in the novel Descent (although, the DALLAS screenshots are from his script for his level Space Station Kreathlan, where he employed the use of the Cloaking Device when it didn't make it into Lunar Outpost MN0019). This script is extremely advanced and not for beginners in the slightest, so everything will not be explained (it is assumed you know how to fully operate DALLAS). Skyalmian had a difficult time trying to duplicate this in DALLAS when it was given to him. This so-called tutorial will show you what should be done to create a Cloaking Device powerup that can be used by any ship and will explain in general what each script does. Overall, it should take between 30 minutes to 1 hour, depending on how well you can operate DALLAS. 01 - The very first thing you should do once in the Dallas Graphical Script Editor is open the "User Types Workshop" and create the following user types: The Cloaked_Handle is the identification of the player ship holding the device, the Cloak_Energy_Drain is for the timer used to drain the ship of energy using the Cloaking Device, the Cloaked_Flag_# are critically important for states of cloaking, and Useless is only necessary to fill in a blank space for the first script. 02 - Create these messages in the Message List (name -> text string): 03 - Create a powerup in the level with the name Cloaking_Device and put it close to if not on the first player start. Pick a good, suitable object, as people will see the model when the player holding the Cloaking Device dies. Skyalmian for his version chose the model Data Cartridge. 04 - Create a level start script that is executed upon level start. In it, "Set user flag Cloaked_Flag_1 to FALSE". 05 - Create the first script; duplicate the expanded script selected. This script automatically gives the object Cloaking Device to the nearest player's inventory at level start with the name "Cloaking Device" and with the object spewable at player death, lest the object be lost forever when the player dies. Note: if you wish, you can skip this script to have the Cloaking Device be found in the level by the player instead (in which case, delete the UserVar Useless, as it will not be needed). 06 - Create the second script; duplicate the expanded script selected. This script adds the Cloaking Device powerup to the inventory of whatever ship touches it, with the attribute of being spewable upon player death. 07 - Create the third script; duplicate the expanded script selected. This script is for when the player activates the Cloaking Device. When activated, it re-adds the device back to the inventory, lest it be lost, gives the player ship the Cloaked_Handle identification, starts the energy drain timer since the device is now On, and sets the Cloaked_Flag_#s necessary for the device's operation. 08 - The fourth script is the most difficult of them all, as this operates the Cloaking Device. This is divided into multiple pictures, as it was not possible to create a snapshot of the entire script. In the first image the title of the script is highlighted. In the subsequent images, the last line of script shown in the previous image is highlighted so as to keep track of where you left off. For example, in Stage 2, the line "True/False: True" is highlighted because that was the very last line in Stage 1. Also, in Stage 2, the windows was scrolled to the right a bit to show what one of the more lengthier lines of script does, the one that subtracts 0.10 energy from the player's ship. Even though the first main line of text is cut off (the top expandable tree line), it is still possible to know what the line would say after analyzing the script lines below it. 09 - With the most difficult script hopefully finished, there is one left. Duplicate the expanded script selected. This script turns the Cloaking Device Off when the player dies. 10 - You're finished; 6 scripts total, counting the Level Start script that sets the important flag "Cloaked_Flag_1" to FALSE. One thing you can do to tweak the script is change the "Float: 0.10" value in Stage 2 of Step #08 to a higher or lower number. The higher the number, the faster your ship's energy will drain. If you set it to 0, no energy will be lost, but that would make the timer pointless. If you know how, you can strip the timer from this script so that the Cloaking Device simply enables/disables the cloak without any loss of energy or unnecessary script code. Although, heh, no one would ever turn the silly thing off...
|