Jump to content

Spawn a player-controllable aircraft, when mission is on the fly?


Yukari

Recommended Posts

Good day everyone. I have had some difficulties figuring this out:cry:, so I'd appreciate any suggestion or help. Thanks in advance!

 

Basically what I would like to achieve is to spawn a few aircraft/helicopters which are controllable by players, only after 20 mins into a mission. To put it simple, I have one and only one player slot when the mission starts; after 20 mins I'd like to spawn an aircraft so that another player can join/switch to. Well, this idea might sound weird and stupid but still I want to see it done... so here are what I've tried:

 

I've had a go with some DCS functions:

coalition.addGroup(country.id country, Group.Category groupCategory,  groupData)

 

It works fine with AI controlled group; however if I set skill level to "Client" in the groupData table, I got a scripting error

00121.921 ERROR   DCS: Mission script error: : (null)

 

Lua and .log file can be found here

 

Later I learned according to http://en.wiki.eagle.ru/wiki/Simulator_Scripting_Engine/DCS:_World/Part_1,

Group function coalition.addGroup(enum country.id country, enum Group.Category groupCategory, table groupData)

 

Note:

...

Groups with client aircraft are not allowed.

...

:doh:Ok, so this explains itself.

 

Next I tried some functions in MIST and MOOSE. For MIST, I did

mist.cloneGroup(...)

This function takes a group name as a parameter, so I made a group with one plane in it, with skill level set to "Client", then I passed the group name to it. Got the same scripting error(null).

 

mist.dynAdd(...)

With this one, I made a template in ME, and pass the data table of this template to this function. No luck though.

 

 

It turns out that these two only works with (in group data table) ["skill"] = AI_Skill_Level or ["skill"] = "Player".

 

I have just started to learn MOOSE so I am not sure if this can be solved with MOOSE; I notice that there are some classes related, especially this one:

MISSION.AddClient(CLIENT, self, Client)

but I failed to understand how this work within the mission. I have looked through Gori Valley mission, only to find that this usage seems to have nothing to do with spawning a controllable group or adding a player slot, but is used to register a client into DATABASE(I could possibly be very wrong on this one).

 

There might be other ways to work around these, for example, block a slot until 20 mins has passed; however, I still have lots of idea around being able to dynamically spawn a player controlled aircraft, on the fly, so I'd really really appreciate any :helpsmilie: or advice! Thanks again!

Nooooooooo

Link to comment
Share on other sites

The workaround, which is pretty hard, doesn't get you all the way and I'm still unable to do it, is to slot block until the mission time/trigger is right. I think you are asking for an AI to spawn that can be controllable. It USED to be possible in 1.2, in fact xcom wrote a clever script that made AI work the slots without interuption until you spawned then they would RTB. ALl that code is broken and the functions like client destroy and so on dont work so what you exactly want isnt possible, but there are always workarounds in DCS.

 

Yet


Edited by Pikey
added the Yet part. since this is a moving target.

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...