Jump to content
Sign in to follow this  
bpurchase

Dedicated Server Mission Help

Recommended Posts

First Time posting here so i hope for some help.....I have been working on this for days and am a bit newbish when it comes to scripting. What i need is for me to be able to run up to a player......scroll wheel.....action "Add Damage" and the player becomes injured to the point that our Medics in Training need to revive them. Now the Current state has this working in everyThing but a dedicated server so i am thinking that there is a small line of code that i am missing or is not right. Any help would be great. I have scoped the MP mission editing threads as well and am still having trouble. Thanks Again!!


[b]init.sqf[/b]
s1 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s2 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s3 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s4 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s5 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s6 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s7 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s8 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s9 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s10 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s11 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s12 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s13 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s14 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s15 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s16 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s17 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s18 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s19 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s20 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s21 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s22 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s23 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];
s24 addaction ["Add damage", "damage.sqf", [], 1, true, true, "", ""];





ace_wounds_prevtime = 300;
ace_sys_wounds_no_rpunish = true;

player setVariable ["BIS_noCoreConversations", true];

[b]Damage.sqf[/b]
if (!isServer) exitWith {

_dummy = _this select 0;
_caller = _this select 1;
_id = _this select 2;
[_dummy, -1] call ace_blackoutall;

//[s1, -1] call ace_blackoutall
//[s2, -1] call ace_blackoutall
//[s3, -1] call ace_blackoutall
//[s4, -1] call ace_blackoutall
//[s5, -1] call ace_blackoutall
//[s6, -1] call ace_blackoutall
//[s7, -1] call ace_blackoutall
//[s8, -1] call ace_blackoutall
//[s9, -1] call ace_blackoutall
//[s10, -1] call ace_blackoutall
//[s11, -1] call ace_blackoutall
//[s12, -1] call ace_blackoutall
//[s13, -1] call ace_blackoutall
//[s14, -1] call ace_blackoutall
//[s15, -1] call ace_blackoutall
//[s16, -1] call ace_blackoutall
//[s17, -1] call ace_blackoutall
//[s18, -1] call ace_blackoutall
//[s19, -1] call ace_blackoutall
//[s20, -1] call ace_blackoutall
//[s21, -1] call ace_blackoutall
//[s22, -1] call ace_blackoutall
//[s23, -1] call ace_blackoutall
//[s24, -1] call ace_blackoutall
};

Thanks Again!

CPT Copper

Cheif of Operations

United States Special Operations Command- Arma2 division

Share this post


Link to post
Share on other sites

Hi and welcome to the forums. First I'd like to point out, your init.sqf can be shortened significantly.

{_x AddAction ["Add damage", "damage.sqf", [], 1, true, true, "", ""]} ForEach PlayableUnits;

Or

{_x AddAction ["Add damage", "damage.sqf", [], 1, true, true, "", ""]} ForEach [s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16,s17,s18,s19,s20,s21,s22,s23,s24];

I see your using ace. What exactly isn't working, or how is it working rather on dedicated? Does the other player not receive damage or not blackout? I'm not sure exactly how this ace_blackoutall is working, so it is impossible for me to help you. Though, it may be a simple fix & someone else may have an quick answer for you.

Share this post


Link to post
Share on other sites

Have you made sure to include the ACE Wounds module in your mission?

*Edit: Sorry, I see that you said it's working on everything BUT dedicated. :o

Share this post


Link to post
Share on other sites

if this is just for playbale units that you are doing - you dont need all that

can just use MPframework

in init.sqf

[nil, player, "per", rADDACTION, "Add damage", "damage.sqf", [], 1, true, true, "", ""]] call RE;

damage.sqf

_dummy = _this select 0;
[_dummy, -1] call ace_blackoutall;

or instead you could addPublicEventHandlers to do the same thing.

Share this post


Link to post
Share on other sites

Thanks for all of the help.....

_Ace wounds module is on the map

What is supposed to happen is you walk up to a non player AI and scroll wheel "add damage" and he is supposed to be wounded. this used to work back in the day but there was an ACE update that broke this. The reason the Add Damage is to allow our medics a chance to train on propper proceedure.

On the Dedicated server when i hit the Add Damage action Nothing happens. When i am on a local hosted MP i hit Add Damage and he goes unconcious and requires Morphine, Epi, and bandages.

Again I am very new to MP scripting but this seems like i am missing something small.

Share this post


Link to post
Share on other sites

So here is the Fix!!

AddDamage.sqf

_victim = _this select 0;
_actionID = _this select 2;
_damage = (ceil(random 9)) / 10;
_bloodDam = (ceil(random 9)) / 10;
_painDam = (ceil(random 9)) / 10;
_epiDam = (ceil(random 9)) / 10;

hintSilent format["Regular Damage: %1\nBlood Damage: %2\nPain Damage: %3\nEpi Damage: %4",_damage,_bloodDam,_painDam,_epiDam];

_victim removeAction _actionID;

[_victim, _damage] call ace_sys_wounds_fnc_addDamage;
_victim setVariable ["ace_w_bleed",_bloodDam,true];
_victim setVariable ["ace_w_pain",_painDam,true];
_victim setVariable ["ace_w_epi",_epiDam,true];

Init Field of unit

_nul = this addAction ["<t color='#ffa500'>Add Damage</t>", "addDamage.sqf", [], 1, false, true, "", ""];

Works like a charm! This is not my coding but this solution was presented to me by one of our members so i will pass it on to be a good sport and be helpfull.

Thanks for the help

CPT Copper

USSOCOM

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×