Jump to content

YO

Member
  • Content Count

    51
  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About YO

  • Rank
    Lance Corporal
  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. 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.
  6. 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
  7. 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.
  8. 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
  9. 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.
  10. 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
  11. try with <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">playSound ""
  12. 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.
  13. 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.
  14. 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.
  15. 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!?
×