Jump to content

Spkka

Member
  • Content Count

    14
  • Joined

  • Last visited

  • Medals

Posts posted by Spkka


  1. Hey, this part opens up a build menu on which players can choose whatever structure they want to build ingame from a listbox in crcti warfare.07

    I have a feeling loading the whole list at once is a bit heavy so i thought to seperate Primary, defense, rural and sign structures. I have no idea how to show only Primary structures when the button primary is being pressed. Guess i need to hold what button got pressed last and display these. Do i need to set types or something for each structure then?

    ; args: [object, type, si, distance]

    _object = _this select 0

    _unit = player

    _si = playerSideIndex

    _distMax = _this select 3

    _isMHQ = (_object == mhqWest || _object == mhqEast)

    buttonPressedBuild = false

    buttonPressedPlaceBuild = false

    buttonPressedBuy = false

    buttonPressedPrimary = false

    buttonPressedDefense = false

    buttonPressedRural = false

    buttonPressedSigns = false

    _delay = 0.2

    #Init

    openBuildMenu = false

    _menuOpen = true

    ;Create the build menu.

    _buildMenu = CreateDialog "BuildMenu"

    [iDD_BuildMenu]call funcFixDialogTitleColor

    ctrlSetText [iDC_TEXT_MENU_NAME, "Build Structures"]

    ctrlShow [iDC_BTN_ALIGN, false]

    ctrlShow [iDC_BTN_FLOAT, false]

    ? !(_isMHQ): ctrlShow [iDC_BTN_BUY_BG, false]; ctrlShow [iDC_BTN_BUY, false]

    _index = 0

    _count = count structDefs

    _money = (groupMoneyMatrix select _si) select playerGroupIndex

    ;Add an entry onto the structure selection combobox.

    #AddStructures

    _desc = structDefs select _index

    _name = _desc select sdName

    _cost = _desc select sdCost

    _sides = _desc select sdSides

    _onlyCO = _desc select sdOnlyCO

    _onlyMHQ = _desc select sdOnlyMHQ

    ?(playerSideIndex == siwest):_model = sdObjectsWest

    ?(playerSideIndex == sieast):_model = sdObjectsEast

    _spacer = ""

    ? (_cost < 10): _spacer = " "

    ? (_cost < 100): _spacer = " "

    ? (_cost < 1000): _spacer = " "

    ? (_cost < 10000): _spacer = " "

    _text = Format["$%1 %2%3", _cost, _spacer, _name]

    ? (_si != _sides && _sides != siBoth): goto "Skip"

    ? (_onlyMHQ && !_isMHQ): goto "Skip"

    ? (_onlyCO && playerGroup != (groupCommander select _si)): goto "Skip"

    ? (_type == 1 ): goto "Skip"

    _id = lbAdd[iDC_LB_LIST1, _text]

    lbSetValue [iDC_LB_LIST1, _id, _index]

    ? (_id > 8): lbSetColor [iDC_LB_LIST1, _id, [0,0,.3,1]]

    ? (_cost > _money): lbSetColor [iDC_LB_LIST1, _id, [.5,0,0,1]]

    ? (lastSelectedStructType == _index): lbSetCurSel [iDC_LB_LIST1, _id]

    #Skip

    _index = _index + 1

    ? (_index < _count):goto "AddStructures"

    _type = -1

    #Update

    ? !(alive _object): goto "CloseDialog"

    ? !(alive _unit): goto "CloseDialog"

    ? (_unit distance _object > _distMax): goto "CloseDialog"

    ? (_isMHQ && playerGroup != (groupCommander select _si)): goto "CloseDialog"

    ;If the value is not 1 then the menu was closed with the ESC key.

    ? !(dialog): goto "CloseDialog"

    _selected = lbCurSel IDC_LB_LIST1

    ? (_selected == -1): _type == -1; goto "NoStructSelected"

    _type = lbValue[iDC_LB_LIST1, _selected]

    _image = getText (configFile >> "CfgVehicles" >> ((((structDefs select _type) select _model)select 0) select 0) >> "picture")

    ?(_image == "PICTURESTATICOBJECT"): _image = "\CA\UI\DATA\marker_x_ca.paa"

    ?(_image == "\CA\UI\DATA\ICON_WF_BUILDING_REPAIR_CA.PAA"):_image = "\CA\UI\DATA\iconship_ca.paa"

    ctrlSetText [iDC_Build_Picture, _image]

    lastSelectedStructType = _type

    _cost = (structDefs select _type) select sdCost

    if (_type in alignTypes) then { ctrlShow [iDC_BTN_ALIGN, true] } else { ctrlShow [iDC_BTN_ALIGN, false] }

    if (_type in structsFloat) then { ctrlShow [iDC_BTN_FLOAT, true] } else { ctrlShow [iDC_BTN_FLOAT, false] }

    #NoStructSelected

    _money = (groupMoneyMatrix select _si) select playerGroupIndex

    _text = format ["$%1", _money]

    ctrlSetText [iDC_TEXT_PLAYER_MONEY, _text]

    ? (_si == siWest): _text = format ["Buy Worker $%1 (%2/%3)", costWorker, pvWorkersWest, maxWorkers]

    ? (_si == siEast): _text = format ["Buy Worker $%1 (%2/%3)", costWorker, pvWorkersEast, maxWorkers]

    ctrlSetText[iDC_BTN_BUY, _text]

    if (alignWalls) then { ctrlSetText [iDC_BTN_ALIGN, "Align Walls: ON"] } else { ctrlSetText [iDC_BTN_ALIGN, "Align Walls: OFF"] }

    if (SQU_FloatObj) then { ctrlSetText [iDC_BTN_FLOAT, "Float Object: ON"] } else { ctrlSetText [iDC_BTN_FLOAT, "Float Object: OFF"] }

    ctrlShow [iDC_BTN_PRI, true]

    ctrlShow [iDC_BTN_DEF, true]

    ctrlShow [iDC_BTN_RUR, true]

    ctrlShow [iDC_BTN_SIG, true]

    ? (buttonPressedBuild):goto "BuildStructure"

    ? (buttonPressedPlaceBuild):goto "PlaceBuildStructure"

    ? (buttonPressedBuy):goto "BuyWorker"

    ? (buttonPressedPrimary):goto "UpdatePrimary"

    ? (buttonPressedDefense):goto "UpdateDefense"

    ? (buttonPressedRural):goto "UpdateRural"

    ? (buttonPressedSigns):goto "UpdateSigns"

    ~_delay

    goto "Update"

    #UpdatePrimary

    buttonPressedPrimary = false

    lastSelectedStructType = 1;

    goto "Update"

    #UpdateDefense

    buttonPressedDefense = false

    lastSelectedStructType = 2;

    goto "Update"

    #UpdateRural

    buttonPressedRural = false

    goto "Update"

    #UpdateSigns

    buttonPressedSigns = false

    goto "Update"

    #BuyWorker

    buttonPressedBuy = false

    ? (_money < costWorker): hint "Not enough Money"; goto "Update"

    [_unit] exec "Player\AddWorker.sqs"

    goto "Update"

    #BuildStructure

    buttonPressedBuild = false

    ? (_type == -1): hint "No structure selected"; goto "Update"

    ? (_money < _cost): hint "Not enough Money"; goto "Update"

    [_unit, _type, [], 0, alignWalls && ctrlVisible IDC_BTN_ALIGN, SQU_FloatObj && ctrlVisible IDC_BTN_FLOAT] exec "Player\BuildStructure.sqs"

    goto "CloseDialog"

    #PlaceBuildStructure

    buttonPressedPlaceBuild = false

    ? (_type == -1): hint "No structure selected"; goto "Update"

    ? (_money < _cost): hint "Not enough Money"; goto "Update"

    [_object, _unit, _type, alignWalls && ctrlVisible IDC_BTN_ALIGN, SQU_FloatObj && ctrlVisible IDC_BTN_FLOAT, _distMax] exec "Player\PlaceAndBuildStructure.sqs"

    goto "CloseDialog"

    #CloseDialog

    buttonPressedBuild = false

    buttonPressedPlaceBuild = false

    buttonPressedBuy = false

    buttonPressedPrimary = false

    buttonPressedDefense = false

    buttonPressedRural = false

    buttonPressedSigns = false

    ? (dialog): closeDialog 0

    Exit


  2. I got this for updating the player actions he can perform. It only adds things multiple times into the list which it shouldn't. Like if there are 2 support trucks it will display "Vehicle support menu" twice.

    I got no idea how to loop trough all the action and how to get rid off actions that already exist.

    { _id = _unit AddAction [_x, "Player\ActionStructure.sqs"]; _actionIDs = _actionIDs + [_id] } foreach _actionNames


  3. Hey I am changing the crcti warfare.07 to fit to my own needs. I added all possible objects in arma to build in your base etc.

    Now I want make a power generator which is needed before the other buildings will function. Maybe some meter that keeps track of the current power and the power that is needed in total. I don't really have an idea how to start on this.

    I added a power generator to build and I got the option to turn toggle the power on/off near the generator. I need to create a variable so that I know if the generator is on or off and play a sound if its on, and stop the sound if its off. How does this work?

    ---------- Post added at 08:23 PM ---------- Previous post was at 06:47 PM ----------

    I want to test if toggle works and I added this, I bet i do something wrong but I have no idea really. Turning it on/off should go for each Power Generator and not as 1 variable i guess.

    ; args: [object, type, si]
    
    
    ? (power): power = false; 
    PublicVariable "power";
    power = true;
    
    ? !(power): power = true; 
    PublicVariable "power";
    power = false;
    
    if ( power == true ) then { playsound "track1"; }


  4. Hey all, I am changing the crcti Warfare.07 to fit to my own likings. Just fun purposes. Maybe I'll put a download link later if someone want to host it though.

    My main idea is to have a more base building based mode. Pretty much the same as the original but with less players and on Utes instead of Chernarus.

    Things i changed so far:

    - Removed the sound when trying to build something in your base.

    - Added more models for base defense structures. Most objects that are available in the arma database.

    - Added more enemies and towns to capture.

    I am still pretty new to the scripting in Arma2 but I am sure i can manage my ideas. I still want to add much more weapons/structures to buy and make the popup screens more organised then they are now. Maybe I am going to increase the squad sizes as well. Its just for fun but if someone got suggestions feel free to add them! Look for the server crcti_Spkka in Capture The Island. I host it if I am playing myself.


  5. When its available... im actual testing the version. Think we will upload it to our server today.

    @ Spkka:

    Its normal that only the mission.sqm is in folder. You have extracted the original pbo file? Then copy all other files, except the mission.sqm, in your missionfolder and it works.

    Yes i got it all working. I succesfully added all other models to build as base defense. There are quite a lot of things to build right now. Some models don't show up when i try to place them yet though. Also adding more weapons to buy and such.


  6. mt79er: I did that, I have the folder from warfare in my mpmission folder. Anyways I made something with the editor before and I checked that pbo. Only the mission.sqm is there and after i extracted and packed it again I cannot edit it in the editor anymore?

    Figured they go into documents and settings/user/arma2/mpmissions instead of the valve folder where it saves them when clicking extract to multiplayer missions in the editor.


  7. Hey, if you decide not allow us to change the mission, could you please make a small explanation of what you did change? I really want some base building, coop defense mission with a smaller group of players that can build, recruit etc like in warfare. Maybe even on a smaller map then Utes. If someone got the same idea pm me. Maybe we can work something out!


  8. Can we extract the pbo's and edit them ourselves? Just wondering. I might could help a bit and/or suit them to my needs. I kinda prefer a smaller map and less players that's why.

    2 smaller groups fighting each other where base building is more important is what i need.

×