Ravenfield

Ravenfield

87 个评价
Flying spawnpoint example
   
奖励
收藏
已收藏
取消收藏
Content Type: Vehicles
标签: Modded Content
文件大小
发表于
3.312 MB
2022 年 5 月 31 日 上午 5:43
1 项改动说明 ( 查看 )

订阅以下载
Flying spawnpoint example

描述
This is a lazy proof-of-concept vehicle that turns airplane into a moving spawnpoint.

select TRANSPORT PLANE in the vehicle slot and start the game.

when you or the bot is driving TRANSPORT PLANE, some soldiers will be spawned from the plane as Airborne Troopers.

You are also spawned from the plane, if you don't want that, simply add 'actor.isBot' if statement at line 19.


behaviour("vehiclespawnpoint")
function vehiclespawnpoint:Start()
self.vehicle = self.gameObject.GetComponent(Vehicle)
GameEvents.onActorSpawn.AddListener(self, "OnActorSpawn")
self.spawn=0
self.maxspawn=8
end

function vehiclespawnpoint:Update()
if self.spawn>0 then
self.spawn=self.spawn-Time.deltaTime*2
if self.spawn<0 then
self.spawn=0
end
end
end

function vehiclespawnpoint:OnActorSpawn(actor)
if not self.vehicle.isDead and not self.vehicle.isBurning and self.vehicle.altitude>15 and self.vehicle.hasDriver and actor.team==self.vehicle.driver.team and self.spawn<self.maxspawn then
local nodes=false

for i=1,#ActorManager.capturePoints do
if nodes==false and Vector3.distance(Vector3(self.vehicle.transform.position.x,0,self.vehicle.transform.position.z),Vector3(ActorManager.capturePoints.transform.position.x,0,ActorManager.capturePoints.transform.position.z))<300 then
nodes=true
end
end

if nodes==true then
self.spawn=self.spawn+1
actor.TeleportTo(self.targets.spawnpoint.transform.position,self.targets.spawnpoint.transform.rotation)

if actor.isBot then
local sqds={actor}
Squad.Create(sqds)
local atkpoint=1
for i = 2, #ActorManager.capturePoints do
if Vector3.Distance(self.vehicle.transform.position,ActorManager.capturePoints.transform.position) < Vector3.Distance(self.vehicle.transform.position,ActorManager.capturePoints[atkpoint].transform.position) then
atkpoint = i
end
end
actor.squad.AssignOrder(Order.Create(OrderType.Attack, ActorManager.capturePoints[atkpoint], ActorManager.capturePoints[atkpoint]))
end

end
end
end
33 条留言
Capt Wavey 2023 年 10 月 6 日 下午 8:05 
Excellent work. Cheers
Hijong park  [作者] 2023 年 2 月 16 日 下午 11:22 
I have experimented such feature but scrapped as it created many AI issues.
usaMi 2023 年 2 月 16 日 下午 10:42 
is it possible to make it into a mutator that reads and uses vehicle slots?
Real 2022 年 8 月 30 日 下午 1:55 
Clever
Jima 2022 年 8 月 27 日 下午 3:06 
really nice mod but would it be possible to also do it for the transport heli ? it would be more effective since it hover over capture points
kakaponya 2022 年 6 月 18 日 下午 12:19 
i dont understand how is it works. When i choose a spawnpoint and see that plane i can choose him and spawn, but bots can. how is it works??
Stockphot 2022 年 6 月 5 日 上午 3:27 
@Gazzer I'm not sure about the disabling of the kill vehicle hud, but i think this ( https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2790584747 ) works for your second question
Hijong park  [作者] 2022 年 6 月 5 日 上午 3:21 
not possible too
Gazzer 2022 年 6 月 5 日 上午 3:14 
would it be possible to make a mutator that makes bots unable to eject from a burning vehicle?
Hijong park  [作者] 2022 年 6 月 4 日 下午 7:44 
not possible because vehicle burning API is not available