沙盘引擎 (SEngine)

创意诞生沙盘世界,不止如此想象!

用户工具

站点工具


scripting:world:main

📚 差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
scripting:world:main [2024/03/22 22:47] bibiboxsscripting:world:main [2024/03/31 15:55] (当前版本) bibiboxs
行 52: 行 52:
 ```javascript ```javascript
 function OnThrowCastTrigger( tag: string, point: Vector ): bool function OnThrowCastTrigger( tag: string, point: Vector ): bool
 +```
 +
 +```javascript
 +//阻止投掷物引起的爆炸,不会产生爆炸
 +function OnThrowCastTrigger( tag, point )
 +{
 + //Prop grenade [tag] is "Grenade"
 + if(tag == "Grenade")
 + {
 + DLog("An explosion tagged 'Grenad' was stopped!");
 + return false;
 + }
 +}
 ``` ```
  
行 72: 行 85:
 ### OnServerQueryReceive( data, address ) ### OnServerQueryReceive( data, address )
  
-> 当服务器接收到`Query\Gamespy`数据时调用。+> 当服务器接收到`Query\Gamespy`数据时调用(格式必须是`\xxx\`使用反斜杠包围)
 > >
 > **引擎内置数据指令(例如`querystats`等)不会触发此事件。** > **引擎内置数据指令(例如`querystats`等)不会触发此事件。**
行 323: 行 336:
 ```javascript ```javascript
 function GetWorldColor(): Color function GetWorldColor(): Color
 +```
 +
 +
 +### SetWorldFogColor()
 +
 +> 设置游戏世界雾颜色,默认为白色`Color(150, 150, 150)`。
 +
 +> 此方法是`SetGameRule("fogcolor")`的快捷方法。
 +
 +```javascript
 +function SetWorldFogColor( color: Color )
 +```
 +
 +
 +
 +### GetWorldFogColor()
 +
 +> 获取游戏世界雾颜色。
 +
 +```javascript
 +function GetWorldFogColor(): Color
 +```
 +
 +
 +
 +### SetSkybox()
 +
 +> 设置游戏世界天空盒,默认为`0`。
 +
 +```javascript
 +function SetSkybox( skybox: int )
 +```
 +
 +
 +
 +### GetSkybox()
 +
 +> 获取游戏世界天空盒。
 +
 +```javascript
 +function GetSkybox(): int
 ``` ```
  
行 342: 行 396:
  
 ```javascript ```javascript
-function SetSkyboxColor(): Color+function GetSkyboxColor(): Color
 ``` ```
  
行 477: 行 531:
  
 - `ignoreSelf`:是否忽略**发起伤害单位**自身(如`from`为空则没有意义) - `ignoreSelf`:是否忽略**发起伤害单位**自身(如`from`为空则没有意义)
 +
 +
 +
 +### CreateFire()
 +
 +> 在指定位置**生成一团火焰**,火焰将对附近的实体造成燃烧+传播伤害。
 +
 +```javascript
 +function CreateFire( pos: Vector, time: float, radius: float = 1.0 )
 +```
  
  
行 523: 行 587:
  
 ```javascript ```javascript
-function CreateThrowCast( start: Vector, direction: Vector, color: Color, width: float = 0.2, speed: float = 1.0, tag: string = "", action: Action<Vector> = null )+function CreateThrowCast(  
 + start: Vector,  
 +    direction: Vector,  
 +    color: Color,  
 +    width: float = 0.2,  
 +    speed: float = 1.0,  
 +    tag: string = "",  
 +    action: Action<Vector> = null )
 ``` ```
  
行 537: 行 608:
 - **width:**射线宽度 - **width:**射线宽度
 - **speed:**投掷物理速度 - **speed:**投掷物理速度
-- **tag:**标签,仅有识别作用,主要用于`OnThrowCastTrigger() `事件参数+- **tag:**标签,仅有识别作用,主要用于`OnThrowCastTrigger()`事件参数
 - **action:**碰撞时触发方法(参数:`Vector`) - **action:**碰撞时触发方法(参数:`Vector`)
  
行 544: 行 615:
 ### CreateModelThrowCast() ### CreateModelThrowCast()
  
-> 在指定位置生成一条**包含模型的投掷抛物射线(物理)**,与`CreateThrowCast()`功能基本相同,但会额外多出子模型效果(例如射出的子弹、炮弹、弓箭、手榴弹模型等)。+> 在指定位置生成一条**包含模型的投掷抛物射线(物理)**,与`CreateThrowCast()`功能基本相同,但会额外多出**子模型**效果(例如射出的子弹、炮弹、弓箭、手榴弹模型等)。
  
 ```javascript ```javascript
-function CreateModelThrowCast( model: int, localPos: Vector, localAngle: Vector, localScale: Vector, start: Vector, over: Vector, color: Color, width: float = 0.2, time: float = 0.1 )+function CreateModelThrowCast(  
 + model: int,  
 +    localPos: Vector,  
 +    localAngle: Vector,  
 +    localScale: Vector,  
 +    start: Vector,  
 +    direction: Vector,  
 +    color: Color,  
 +    width: float = 0.2,  
 +    speed: float = 1.0,  
 +    tag: string = "",  
 +    action: Action<Vector> = null )
 ``` ```
  
行 872: 行 954:
 SendSocketData("127.0.0.1:8192", "Test"); SendSocketData("127.0.0.1:8192", "Test");
 ``` ```
 +
 +
 +
 +
 +
 +
 +
 +
  
  
scripting/world/main.1711118856.txt.gz · 最后更改: 2024/03/22 22:47 由 bibiboxs