ofpchaos 0 Posted May 30, 2006 Here is my newest script - CHSVOS. This script will help you to rafter the performance in your missions when the tanks/vehicles arent needed. It will create and delete the crews when the variable is setted to "true" or the distance to the player is smaller than yours setting. You can use it for MGs,Cars,Tanks and other vehicles. What does the script do ? This script allows the mission makers to save ressources in an effective way without developing any great scipts. Furthermore it allows you to place a vehicle on the exact location (narrow streets). A vehicle created by script could not be postioned in the same exact way. TO the DOWNLOAD Share this post Link to post Share on other sites
ColonelSandersLite 0 Posted June 2, 2006 I'll have to take a good look at this. Question: Does it preserve group names, unit names etc, or will it only work for a clean unit? Share this post Link to post Share on other sites
ofpchaos 0 Posted June 2, 2006 Hi ! Bottom you can find all informations from the attached readme.txt Execution line: [_s,"_n",_b,_v,"_d",_u,_p,_u1,_u2,_u3,_u4] exec "chsvos.sqs" EXAMPLE: [this,"Shilka1",BasisgroupEast,1,300,3,1,"SoldierEcrew","SoldierE Crew"<span style='color:red'>*</span>,"SoldierECrew"<span style='color:red'>*</span>,"SoldierE"<span style='color:red'>*</span>] exec "chsvos.sqs" <span style='color:red'>*optionally</span> You can execute the script with following options: _s = unit (empty vehicle) _n = global name of the unit (in "") _b = basisgroup (side) _v = version trigger (1 oder 2) 1 for the distance, 2 for the variables _d = Distance from the player on which the script activates or variable name (trigger _v is responsible). This have to be written in "". _u = unit number (1,2,3 or 4 crew members) _p = position of the unit (gunner,driver,commander - when given) -> see Appendix _u1 = unitname 1 _u2 = unitname 2 (optional) _u3 = unitname 3 (optional) _u4 = unitname 4 (optional) Appendix trigger for the order of the group if _u = 1 -> the group has only one soldier _p = 1 -> mans the gunner _p = 2 -> mans the driver _p = 3 -> mans the commander if _u = 2 -> the group has two soldiers _p = 1 -> mans the driver after that the gunner _p = 2 -> mans the commander after that the gunner _p = 3 -> mans the gunner after that the driver _p = 4 -> mans the driver after that the cargo if _u = 3 -> the group has three soldiers _p = 1 -> mans the commander, gunner, driver _p = 2 -> mans the gunner, driver, cargo _p = 3 -> mans the comander, driver, guner _p = 4 -> mans the driver, cargo, cargo if _u = 4 -> the group has three soldiers _p = 1 -> mans the driver,Cargo,Cargo,Cargo So you can set: - kind of the execution (variable/distance) - groupname - count of the crew/cargo Members (maximal 4 men) - kind of vehicle (car,tank,jet,mg etc.) - addon (soldier) names - basisgroup name (needed for creation of the units) Share this post Link to post Share on other sites
mandoble 1 Posted June 2, 2006 Nice idea chaos, finally I got the purpose of that Perhaps you can make your script simpler to call (less arguments) so you only need the side (group), the vehicle and the crew units types. Using a single gamelogic you can check the availability of any position in a given vehicle. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _vehicle = _this select 0 _count = 0 _crewmembers = 0 _maxcrew = 3 _logcrew = "logic" camCreate [0,0,0] #spawncrew ?_count == 0:_logcrew moveInCommander _vehicle ?_count == 1:_logcrew moveInGunner _vehicle ?_count == 2:_logcrew moveInDriver _vehicle _slotfilled = false ;Is the logic in the vehicle? ?vehicle _logcrew != _vehicle: goto "continue" ?_count == 0:_rank = "Corporal";hint "Insert code to create and mount the commander" ?_count == 1:_rank = "Private";hint "Insert code to create and mount the gunner" ?_count == 2:_rank = "Private";hint "Insert code to create and mount the driver" _crewmembers = _crewmembers + 1 ~5 #continue _count = _count + 1 ?_count < _maxcrew: goto "spawncrew" deleteVehicle _logcrew #end hint format["crew of %1 members", _crewmembers] exit Share this post Link to post Share on other sites
MrZig 0 Posted June 3, 2006 Careful. Logics have to be (as with any unit I think) setpossed outside of the vehicle prior to every movein command, or nothing will happen. And if it will stay inside the vehicle, no unit will be able to go inside that specific slot. IE: _logic moveindriver _veh; _logic moveincargo _veh; _man moveindriver _veh What will happen? _logic will stay in as driver of _veh, and _man will still be outside. Share this post Link to post Share on other sites
mandoble 1 Posted June 3, 2006 You are right, that should be part of the code to create and mount units. But certainly that may be confusing, creating and deleting the logic crew per vehicle pos would make things simpler: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _vehicle = _this select 0 _count = 0 _crewmembers = 0 _maxcrew = 3 #spawncrew _logcrew = "logic" camCreate [0,0,0] ?_count == 0:_logcrew moveInCommander _vehicle ?_count == 1:_logcrew moveInGunner _vehicle ?_count == 2:_logcrew moveInDriver _vehicle _slotfilled = false ;Is the logic in the vehicle? ?vehicle _logcrew != _vehicle: goto "continue" deleteVehicle _logcrew ?_count == 0:_rank = "Corporal";hint "Insert code to create and mount the commander" ?_count == 1:_rank = "Private";hint "Insert code to create and mount the gunner" ?_count == 2:_rank = "Private";hint "Insert code to create and mount the driver" _crewmembers = _crewmembers + 1 _slotfilled = true ~5 #continue ?!_slotfilled:deleteVehicle _logcrew _count = _count + 1 ?_count < _maxcrew: goto "spawncrew" #end hint format["crew of %1 members", _crewmembers] exit Share this post Link to post Share on other sites
ofpchaos 0 Posted June 8, 2006 @ Mandoble If you don´t like my work - you don´t need to use it. Share this post Link to post Share on other sites
mandoble 1 Posted June 8, 2006 Quite the opposite, I like it, it was just a suggestion so you dont need to indicate which positions to occupy for each vehicle. Share this post Link to post Share on other sites
ofpchaos 0 Posted June 8, 2006 I am not very good in scripts. But i has the idea and i think i realised it good and simple enough. In many Addons you have not ever the same Unit for all crew members - for example the INV1944 Tiger tank crew. So you can define even unit extra with my script. Share this post Link to post Share on other sites