Jump to content

Recommended Posts

Posted

Hi guys! We have a "small amateur squadron" and we have been messing with the CSAR Script making it suitable for our wishes. Including adding sounds, changing some objects, translating messages to our mother tongue and etc.

I would like to spawn soldiers in front of the chopper on the FARP or base when the soldiers are rescued. I tried reusing some code parts (functions) that are already in the code and are supposed to spawn things, but I can't get the code to work. I don't have a lot of knowledge about coding, so if any of you script/code masters could help me to make to make this work, it would be very appreciated! I've spent hours trying to make this work but my knowledge is really limited.

I would really appreciate if you guys could help me with this code. Thanks a lot. 

Posted
5 hours ago, Fabiano-VIKING said:

Hi guys! We have a "small amateur squadron" and we have been messing with the CSAR Script making it suitable for our wishes. Including adding sounds, changing some objects, translating messages to our mother tongue and etc.

I would like to spawn soldiers in front of the chopper on the FARP or base when the soldiers are rescued. I tried reusing some code parts (functions) that are already in the code and are supposed to spawn things, but I can't get the code to work. I don't have a lot of knowledge about coding, so if any of you script/code masters could help me to make to make this work, it would be very appreciated! I've spent hours trying to make this work but my knowledge is really limited.

I would really appreciate if you guys could help me with this code. Thanks a lot. 

May I suggest posting the snippet of code you're using here. I dare say there's more people that are willing to have a quick look if it's posted.

  • Like 1
Posted

I've been trying to reuse some code parts that are already in the script, just literally copying and pasting some parts.😅 Not sure what I am doing. Example:

In the script there is already this function:

function csar.spawnGroup( _coalition, _country, _point, _typeName )

    local _id = mist.getNextGroupId()

    local _groupName = "Piloto abatido #" .. _id

   local _side = _coalition

     local _pos = _point

    local _group = {
        ["visible"] = false,
        ["groupId"] = _id,
        ["hidden"] = false,
        ["units"] = {},
        ["name"] = _groupName,
        ["task"] = {},
    }

    if _side == 2 then
        _group.units[1] = csar.createUnit(_pos.x + 50, _pos.z + 50, 120, "Soldier M4 GRG")
    else
        _group.units[1] = csar.createUnit(_pos.x + 50, _pos.z + 50, 120, "Infantry AK")
    end

    _group.category = Group.Category.GROUND;
    _group.country = _country;

    local _spawnedGroup = Group.getByName(mist.dynAdd(_group).name)

    -- Turn off AI
    if csar.allowDownedPilotCAcontrol == false then
      trigger.action.setGroupAIOff(_spawnedGroup)
    end
    return _spawnedGroup
end

 

So I just tried to paste right below the message that says the pilots were rescued, this:   

 function csar.spawnGroup( _coalition, _country, _point, _typeName )

I don't know if what I am doing makes sense. The thing is that I don't really know how to code. I've been trying to study the basics, but it's still not enough to understand.

  • Recently Browsing   0 members

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