Jump to content

YO

Member
  • Content Count

    51
  • Joined

  • Last visited

  • Medals

Everything posted by YO

  1. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(p1 distance Camp) <= 20should be enought
  2. YO

    respawnVehicle problem

    hi, shoudn't<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_veh respawnVehicle [];be<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_veh respawnVehicle [-1, 0];? anyway, may it crashes because u're deleting a non-local vehicle? Try with: ptr_destroy_vehicle<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_veh = _this select 0; if (local _veh) then { sleep DESTROY_VEHICLE_DELAY; if (!isNull _veh) then { deleteVehicle _veh; }; }; ohh... shoudn't it be a "killed" EH instead of "dammaged"? I'm sorry I'm posting more questions that u did but I don't have the certainty you're probably searching for, but worth a try, doesn't?
  3. My suggestion: add the action to the leader (p1) on init: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">CampCA = p1 addAction ["Make Camp","campcreate.sqf"]; then, on the script that creates the camp add the action to remove it and remove the old one (the action, I mean): <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Camp="ACamp" createVehicle position p1; CampDA = p1 addAction ["Remove Camp","campremove.sqf"]; p1 removeAction CampCA; And on the script that removes the camp add again the action to create it: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">deleteVehicle Camp; CampCA = p1 addAction ["Make Camp","campcreate.sqf"]; p1 removeAction CampDA; now the script that checks the position of the marker should be: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#start ?(!isNull Camp): "Respawn_Camp" setMarkerPos getpos Camp else "Respawn_Camp" setMarkerPos markerPos "respawn_west" ~5 goto "start"; so this way you avoid the marker to appear on the corner of the map (pos [0,0,0,]). Now the only thing you have to do is for example to add an action somewhere in base to teleport to that position, and it'll do the trick. Of course you can also create and delete that marker on the scripts, so if camp is not created it doesn't appear on map, but that's up to you. hope this helps
  4. hi again, I've been playing for a few days with this and now I think I can share my results as it seems I've find an enough reliable and cpu affordable way to check when a player is hit by an explosion. I've to admit that at first I was scared of the massive code calling in Odin's script, but in my tests it seems to perform ok, and it is effective in its proposal, so I only adapted it a little bit for my purposes. Thank you Odin!! here's the code, it only need a calling from init, no arguments nedeed: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _hit_list = { private["_shell", "_d", "_dam"]; // needed? _shell = _this select 0; _d = _this select 1; _dam = damage player; _projectile = nearestObject [player, _shell]; while {(_projectile distance player) < _d} do { sleep 0.15; if (isnull _projectile) then { //sleep 0.1; if (alive player) then { //playSound "wheeze"; //player sideChat format ["Wounded by a %1",_shell]; [_dam, _shell] spawn Hit_effect; } else { //player sideChat format ["Killed by a %1",_shell]; }; }; _dam = damage player; }; }; Hit_effect = { private ["_dam", "_shell", "_imp"]; _dam = _this select 0; _shell = _this select 1; _imp = (damage player) - _dam; //titleText [format ["Impact: %1", _imp], "plain"]; if (_imp > 0.02) then // we have been damaged by the explosion { //player sideChat format ["Wounded by a %1",_shell]; playSound "wheeze"; // + desired effects }; }; while {true} do { sleep 0.5; while {alive player AND !(vehicle player isKindOf "Tank")} do { sleep 0.01; ["ShellCore", 20] call _hit_list; ["RocketCore", 20] call _hit_list; ["MissileCore", 20] call _hit_list; ["G_40mm_HE", 16] call _hit_list; ["G_30mm_HE", 16] call _hit_list; ["G_40mm_HE_6G30", 16] call _hit_list; ["MineCore", 16] call _hit_list; ["TimeBombCore",30] call _hit_list; ["Grenade", 20] call _hit_list; }; }; exit; Now it also checks if the explosion has damaged us wich was basicly what I was looking for, although sometimes it fails and consider an impact of 0, but it's not really often that it happens, and 0.15 sec seems enought in most of cases for the explosion to occur and the shell to disapear. So by now it's done with this script, having to test performance in long games, anyway any suggestion and improvement provided is more than welcome.
  5. Is there any way I can check if a player has been damage by an explosion?, let's say by grenades or bombs... I tried hit EH but it only returns the owner of the object that caused the damage, maybe a quick search for nearestObjects triggered by that EH? Any help is much appreciated
  6. hi fellas, that's a simple question: when declaring a sound in the description.ext, can I use a sound from an addon without having to copy the sound file into my mission folder? This doesn't work:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgSounds { sounds[] = {}; class hitSound1 { sound[] = {\ca\Characters\Data\Sound\Hit11,db-25,1}; name = ""; titles[] = {}; }; };because the game take this path relative to the mission folder and not from the main Arma folder. Any way to get it? thx
  7. that would be great but I didn't find any classname for that sounds, even there's a few files that seems aren't used by Arma. Here's where it get the references: http://pastebin.com/m1686112a. Maybe they're declared elsewhere, dunno.
  8. yeah, the same logic brings me to think that it must be possible, but I'm not able to make it working, that's why I'm requesting a practical example... cause I feel I'm probably missing some stupid detail
  9. hi again, I've been trying this for a few days without success, and I think I've tested it in all possible manners, but as I'm not really very methodic I need someone please confirm if is it possible, and if he/she could provide a working sample mission using a sound wich is not stored into the mission folder I'd really appreciate that so much. As far as I've seen in my tests it doesn't matter if you quote the path to the sound file or not, neither if you type the default extension .wss, neither if use X (from 0 to 1) or db+-X as the second value, AS LONG AS the file is inside the mission folder. I've tested all this separately and both on mission editor and non-dedicated server, and the result was the same: sound only was played when the file was loaded into the mission. Note: I'm using Arma v1.14, hope it has nothing to do with that.
  10. thx for your answer, I'll try it again... I'm having strange experiences with sounds when testing from the mission editor, it seems the game stores the sounds into memory and sometimes it plays sounds that were in the mission folder but that has been deleted from there, and also the wiki gives really little info on that, specially the quotation and the last two parameters after the path (0 to 1 or db+-x?). And also the game reports an error when the class is not found, but says nothing when the class exists but refers to a non-existing sound file, so it makes testing more difficult. Does anyone know for sure if game checks that paths first in mission folder and then in main Arma folder, or campaign dir or elsewhere, and what's the order? thx for your help
  11. lol .... thx guy, haven't tested it yet but I belive you if you say this works, although it seems it really abuses from cpu as it's calling 26 scripts every 0.01 seconds! I'm not sure how it will perform in a long term game. Anyway, I think I can extract some good stuff from here. I'm gonna try to build up something better optimised from that and I'll post my results. Note: to keep that script effect constantly simply nest the "while alive player" loop inside another "while true" loop, like this:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">while {true} do { waitUntil {alive player}; while {alive player} do { sleep 0.01; //call the function ones for each type of ammo ["RocketCore"] call Hit_list; ["MissileCore"] call Hit_list; ["ShellCore"] call Hit_list; ["MineCore"] call Hit_list; ["TimeBombCore"] call Hit_list; ["G_40mm_HE"] call Hit_list; ["G_30mm_HE"] call Hit_list; // etc. }; }; and also, don't call that script from init, better spawn it, as the call command will wait until that script has ended, wich will never happen.
  12. try with <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">playSound ""
  13. afaik it's not possible to aks last know position, but an approach coud be done asking for the knowsAbout, and if greater or equal than 1 then place a marker with some randomness proportional to the level of knowsAbout, being 1 the less they can know and 4 reporting the exact position. I know that's not what u're asking for but is the only way I know to do something similar. PD: I just remembered someone suggested that the command 'getHideFrom' could return the suspected enemy position. Haven't tested it myself, but u could try to order your informers to getHideFrom the enemy and contrast the returning value with the real position.
  14. hi, u may want to try adding a hit EventHandler to your AI or creating a loop that tracks if someone of them are injured, like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_dontFire = true; while {_dontFire} do { { if (damage _x >= 0.1) then {_dontFire = false}; } forEach (units group player); sleep 1; }; (units group player) setCombatMode "Yellow"; Another way, if you don't set the AI behaviour, woud be to wait until it turns to "combat", wich means they've detected an enemy.
  15. Link the group leader to the 'detected by' trigger with F2 (groups) and select 'any member' or something similar yep, try using an empty vehicle or turning truck captive also.
  16. I can't make this working so I'd really appreciate any clues you can provide. Here my results till now: First, dammaged EH only triggers when a section has been damaged (damage texture displayed) so sometimes soldier is hit by grenade, wich triggers hit EH, but as none of the sections are dammaged enough, dammaged EH doesn't activate. Also, as Q1184 said, big impacts may cause damage to more than one section, and also things like jumping out from a moving vehicle, so it's definitively not a reliable way to check that matter. Also my search for nearestObjects with types "HandGrenade" or "HandGrenadeMuzzle" (or timed version) returns no object. That's the code I'm trying: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">while {true} do { while {alive player} do { sleep 0.25; _n = nearestObjects [player, ["HandGrenade", "HandGrenadeTimed"], 25]; if (count _n > 0) then { _g = _n select 0; waitUntil {!alive _g}; // assuming we're hit by a grenade }; }; while {!alive player} do { sleep 1; }; }; And for what Q1184 said, tracking explosives via firedEH, I'm not sure how shoud be done, I imagine that I shoud assign that EH to every unit in mission and on script checking distance to player, make a little maths to calculate if it aims to the player... but I get lost here. Anyway, I think I get stucked cause of missunderstanding of the fired EH... does any of the parameters refers to the bullet itself and not the classname? I wonder how XAM or ACE mods do to play that wheezing sound when you're hit by a grenade, I imagine it's some addon feature. Does XEH handle such stuff? Anyway, I wanted it for an addon-free mission. Ok, I stop writing, I'll still trying to figure out a way to detect explosion impacts, maybe as the guy above suggested, tracking craters near to the player. Thanks for your time. PD: why the hell hit EH doesn't return the bullet that caused the damage!?
  17. YO

    Triggers and more

    It shudn't be too dificult. First create your full briefing file. On the objective that shoud appear after the bad guy is dead, write the link to the "intel" section you create in the briefing.html. On mission init write "X" objStatus "HIDDEN", where X is the objective number, so it doesn't appear from the beggining. Then name your target (bad_guy, here) and create a trigger. Condition should look like: not alive bad_guy. And on Activation field run a script that creates any empty object or gamelogic, place it under the dead officer and then addAction to that object. This action, once activated, should run another script that turns the objective visible, by "X" objStatus "ACTIVE", and voila, your intel section appears on briefing via a link from that 'new' assigned objective. Here's a section sample (write it just under the "plan" section"): <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"><a href="#section1">SECTION NAME</a> -- links to -- <h4 align="center"><a name="section1">SECTION NAME</a></h4>
  18. thx for you answer, I'll try that dammaged EH, seems the most reasonable to me. I'd thought about tracking constanlty nearest objects to player until a grenade or schatel is found but this seems even more cpu unfriendly than tracking thrown grenades via fired EH plus the effect i'm searching really doesn't deserve it, and should be present all game long. I'll take a look at this, thx mate.
  19. I think it's due to 'true' is always validated, so script exits current scope and never reaches 'exitWith'. Try this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> sleep 0.5; if (isEngineOn dc) then { player assignAsCargo dc; player moveInCargo dc; } else { hint "Starting on beach"; }; if (true) exitWith {};
  20. I think there's no way to check out the markers on map unless you track them while being created or you know it's name. If all of them are placed in the editor, then make a list of them and get its position with markerPos. Kinda of: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _markers = ["marker1", "marker2", "marker3"]; _positions = []; { _positions = _positions + [markerPos _x]; } forEach _markers; hope it helps
  21. check Team Switch. Create the civilian units, make players switch to that units locally with selectPlayer and remove older units. Not sure how it will work with respawnable units.
  22. You might want to create a trigger in the 'inffluence area', set activation to east, set some conditions that fits your purpouses, and on act. field write down: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x doMove POSITION} forEach thislist; where POSITION is a position array, (position player, markerPos "marker", etc...). This should made every opfor unit moving to that point. Triggers can also be created via createTrigger command. hope it helps
  23. Well, i think topic title says all about it, I would like to know, first, where is declared that screen that shows velocity, fuel, etc when in a vehicle, and how can it be modified for certain vehicles to add some extra info, if possible. thx in advance.
  24. don't get what u mean. Do u say I should modify RscUnitInfo class (before declaring RscUnitInfo_WI by inheritance), or should I add a unit using that default unitInfoType? Sorry I'm asking too much but neither my comprehension of english nor such config stuff is very good. Btw, I've tried both with null results. I'd really appreciate if someone could provide a working example. thx
  25. thanks for your answers, really value comments came here. @ Q: using #define is a way to write with synonymous words, like 0 intead of true, etc. That's ok. So I assume IDC_IGUI_TIME, IDC_IGUI_DATE, IDC_IGUI_NAME, etc are internal variables the game has, and that they have a value, so where it says: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class Weapon: RscIGText { idc=118; x=0.005000; y=0.185000; w=0.250000; text="$STR_DISP_ERROR"; }; one could replace idc=118; for: idc=(score player); or the way it has to be written here, but in any case, any other variable you want to be shown. Or is not? Assuming that, I've tried -unsuccesfuly- to build a new unitInfoType. First case I've tried to inherit the most I could and simply adding a new unitInfoType, wich results in my helo showing the green background af an empty hint. here's the config: http://pastebin.com/m6a4e02eb Second case I've declared whole class RscInGameUI, wich made standard unit screen to show the info in green instead of white (like if they were vehicles instead of soldiers) and making my helos screen to be shown empty again but with grey background like normal hints, and reporting some error when entering default choppers. config: http://pastebin.com/m3dc0e508 It seems to me I miss some property to be inherited or something like this but really can't see what it's. Thanks for your help. PS: wich syntax highlighting do u use for configs and SQF scripts in pastebin?
×