Space Engineers

Space Engineers

评价数不足
ActionScript (if then else)
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
3.047 KB
2016 年 7 月 18 日 上午 9:06
2017 年 7 月 20 日 下午 11:58
9 项改动说明 ( 查看 )

订阅以下载
ActionScript (if then else)

描述
* ActionScript
* ************
* Version 1.2, July 2017
* Author: Alexander Weber, Switzerland
*
* Description:
* Check if a block has a specific state (trigger). If yes, do something (event), [optional: else do something]
* It's possible to have multiple events for one trigger.
*
* Example:
* Door,2$Light1,1;Light2,1$Light1,0 => if the Door is open, activate Light 1 und Light 2, else Light 1 off
*
* Use
* you only have to run the script once. But be shure, to have the correct parameters. Test the correct parameters directly in the programm block. after that,
* use a timerblock with the tested parameters. u can use the Custom Data too (better way), each line is one command
*
* Trigger Event:
* 0 = off all elements
* 1 = on all elements
* 2 = open doors, Hangar doors, sliding doors
* 3 = closed doors, hangar doors, sliding doors
* 4 = connected connectors, landing gear
* 5 = not connected connectors, landing gear
* 6 = ready to connect connectors, landing gear
* 7 = Cockpit is used cockpit
* 8 = Cocpit is not used
*
* Set Event:
* 0 = off all elements
* 1 = on all elements
* 2 = open doors, Hangar doors, sliding doors
* 3 = closed doors, hangar doors, sliding doors
* 4 = connect connectors, landing gear
* 5 = disconnect connectors, landing gear
* 6 = play Sound SoundBlock
6 条留言
ratheden 2018 年 5 月 21 日 上午 12:16 
Could we get a few more examples of how to use this properly and well?

example:
i have a sensor that opens a door, i would like this script to turn on an LCD, Play a sound, and Lock a 2nd door or sensor. Then when this door closes, unlock sensor/door 2, stop the sound, turn off the lcd and turn On a set of lights (3).

What more difficult things could i do that you have thought of?



also, getting these errors when installing and checking code:

Program(316,25) Warning: "MyDoor.Open" is obsolete: "Use the status Property instead"
Program(326,24) Warning: "MyDoor.Open" is obsolete: "Use the status Property instead"
Warlocc 2018 年 4 月 13 日 上午 12:57 
Some obsolete functions in here.
Lord|Monkey  [作者] 2017 年 7 月 24 日 下午 11:49 
as parameter in the timer block when you add the program block
or
in the custom data in the program block

Command: Control Center Door,2$Soundblock,1;Soundblock,6$Soundblock,0
Boiler 2017 年 7 月 23 日 下午 1:17 
Can someone please explain to me where to add the values in to this script. I have a door that is labeled Control Center Door, I want when it opens to play a sound. Then when it closes to stop the sound. Can any please help.
woostyboy 2017 年 2 月 27 日 上午 5:39 
Great! Exactly what I was after. Limpet mine with landing gear set to 'Autolock'. When it locks on to a passing vessel it can now arm the warheads using this script.
battlestar4312 2016 年 7 月 18 日 下午 3:46 
what is this ?