Jump to content

Recommended Posts

Hello @Vandeanson

 

16 hours ago, Vandeanson said:

Awesome work here, thank you!

 

You're welcome :)

 

16 hours ago, Vandeanson said:

No 1:

I am trying to gain cash after killing Zombies that are spawned in via modules from the Zombies and Demons mod (http://www.armaholic.com/page.php?id=28958). The spawn modules do have an init field and i tried to put in "[_unit] call HG_fnc_aiUnitSetup;" however, this wont work. (I do not get cash after killing a Z)

Any Idea how to fix this?

 

I spawn in AI via AISSP, here there is field for init that is applied to all units, and the kill reward works. (http://kaartomedia.com/ARMA/AISSP.html) (<--- so happy that this works=))

 

I don't know how Zombies & Demons mod handles units... _unit parameter is just a placeholder it can be anything... I would suggest you to check what function is called by the module then you figure out what to do from there.

 

16 hours ago, Vandeanson said:

No: 2

Further, It seems that there is a function that removes all gear at mission start, is it possible to disable this?

 

Yeah there was a problem with gear loading from save, fixed now https://github.com/Ppgtjmad/SimpleShops/commit/5a8c163796740317850c7629de83aa6dbc23136a

Share this post


Link to post
Share on other sites
On 9/18/2017 at 4:32 PM, hoverguy said:

Hello @Vandeanson

 

 

You're welcome :)

 

 

I don't know how Zombies & Demons mod handles units... _unit parameter is just a placeholder it can be anything... I would suggest you to check what function is called by the module then you figure out what to do from there.

 

 

Yeah there was a problem with gear loading from save, fixed now https://github.com/Ppgtjmad/SimpleShops/commit/5a8c163796740317850c7629de83aa6dbc23136a

Thank you very much;) Will figure something out regarding Z&D mod, but the rest works now!

  • Like 1

Share this post


Link to post
Share on other sites

Congratulations on your release HoverGuy
 
I like everything about it! The Gear-GUI is just fantastic!

 

Edited by Cruzader77
  • Like 1

Share this post


Link to post
Share on other sites

@hoverguy I absolutely love the way you pull the information about stats etc - need to learn how to do that!

  • Like 1

Share this post


Link to post
Share on other sites
On 5/25/2016 at 7:10 PM, CptDezusa said:

Thank you for your help!! :D

 

-:Argh, would love to know how you got that EOS system working with the killRewards!


I am trying to get the KillReward systen from [HG]Simple Shops to work with EOS (Enemy Occupation System).

Quote

// _unit is the AI unit

[_unit] call HG_fnc_aiUnitSetup;

 

i tried putting this in init.sqf

Quote

    {
    if (side _x isEqualTo EAST)    then
            {
            _x call HG_fnc_aiUnitSetup;
            };
    
    }foreach allUnits;

  Thought this would work, as this worked when i did my own EventHandler instead of calling the HG_fnc_aiUnitSetup.
(I tested with some spawned AI, to see if i could even get that working. I know this is only runs once.)

 

Well then i wanted to add it to the Script that spawned AI for EOS.
b_core.sqf

Quote

// SPAWN PATROLS        
    _aGroup=[];
    for "_counter" from 1 to _PApatrols do {    
                        _pos = [_mPos, _Placement, random 360] call BIS_fnc_relPos;
                            _grp=[_pos,_PAgroupSize,_faction,_side] call EOS_fnc_spawngroup;    
                            _aGroup set [count _aGroup,_grp];
if (_debug) then {PLAYER SIDECHAT (format ["Spawned Patrol: %1",_counter]);0= [_mkr,_counter,"patrol",getpos (leader _grp)] call EOS_debug};
                                        };    
                                        


This call the function EOS_fnc_spawngroup;
which is complied in spawn_fnc.sqf but is defined here
infantry_fnc.sqf

Quote

if (!isServer) exitWith {};
// SINGLE INFANTRY GROUP
private ["_grp","_unit","_pool","_pos","_faction"];

_pos=(_this select 0);
_grpSize=(_this select 1);
_faction=(_this select 2);
_side=(_this select 3);

_grpMin=_grpSize select 0;
_grpMax=_grpSize select 1;
_d=_grpMax-_grpMin;                
_r=floor(random _d);                            
_grpSize=_r+_grpMin;
                
    if (surfaceiswater _pos) then {_pool=[_faction,1] call eos_fnc_getunitpool;}else{_pool=[_faction,0] call eos_fnc_getunitpool;};
    
    _grp=createGroup _side;
            
for "_x" from 1 to _grpSize do {                    
        _unitType=_pool select (floor(random(count _pool)));
        _unit = _grp createUnit [_unitType, _pos, [], 6, "FORM"];
    };


_grp


thought this was the unit being created therefore i tried adding  "_unit = _grp createUnit [_unitType, _pos, [], 6, "FORM"] call HG_fnc_aiUnitSetup;"
I almost seems like i can't call the fnc_aiUnitSetup, Or i am an idiot at it. 


In advance Thanks to anyone, for any help or advice.
Sincerely a frustrated newbie.
PS. Did not list all of my failures. (That would have been horrible to read)

Share this post


Link to post
Share on other sites
On 10/10/2017 at 5:02 PM, Cruzader77 said:

Congratulations on your release HoverGuy
 
I like everything about it! The Gear-GUI is just fantastic!

 

 

Hi @Cruzader77, thanks for your kind words :)

 

On 10/13/2017 at 10:46 PM, nelo_riot said:

I absolutely love the way you pull the information about stats etc - need to learn how to do that!

 

Hello @nelo_riot, thank you, it really is basic scripting you know...

 

1 hour ago, Nebel345 said:

 

-:Argh, would love to know how you got that EOS system working with the killRewards!


I am trying to get the KillReward systen from [HG]Simple Shops to work with EOS (Enemy Occupation System).

 

i tried putting this in init.sqf

  Thought this would work, as this worked when i did my own EventHandler instead of calling the HG_fnc_aiUnitSetup.
(I tested with some spawned AI, to see if i could even get that working. I know this is only runs once.)

 

Well then i wanted to add it to the Script that spawned AI for EOS.
b_core.sqf


This call the function EOS_fnc_spawngroup;
which is complied in spawn_fnc.sqf but is defined here
infantry_fnc.sqf


thought this was the unit being created therefore i tried adding  "_unit = _grp createUnit [_unitType, _pos, [], 6, "FORM"] call HG_fnc_aiUnitSetup;"
I almost seems like i can't call the fnc_aiUnitSetup, Or i am an idiot at it. 


In advance Thanks to anyone, for any help or advice.
Sincerely a frustrated newbie.
PS. Did not list all of my failures. (That would have been horrible to read)

 

Hello @Nebel345,

 

I don't remember how I did it cause it's been a while now...

But anyways the syntax here is not correct:

_unit = _grp createUnit [_unitType,_pos,[],6,"FORM"] call HG_fnc_aiUnitSetup;

->

for "_x" from 1 to _grpSize do 
{                    
    _unitType = _pool select (floor(random(count _pool)));
    _unit = _grp createUnit [_unitType,_pos,[],6,"FORM"];
    [_unit] call HG_fnc_aiUnitSetup;
};

 

Share this post


Link to post
Share on other sites

Thanks for the fast reply!
I tried the syntax you posted, I did not get any errors or any money, when i shot the AI
I tried commenting out the whole script and got an Error that _grp was not defined, so it was loaded.
 

I cannot think of why that would not work... 
Is it possible that the conversation you had with the other guy, is still in your inbox?

I tried calling the function in the init of the AI that did not work enither, could it be that the function is simply not loading?

(Still Working on it) 
Again, thanks for the reply.

UPDATE 

Quote

_grp=(_this select 0);
_skillArray=(_this select 1);                    
                    
                    _skillset = server getvariable _skillArray;
                        {
                _unit = _x;
                {
            _skillvalue = (_skillset select _forEachIndex) + (random 0.2) - (random 0.2);
            _unit setSkill [_x,_skillvalue];
                } forEach ['aimingAccuracy','aimingShake','aimingSpeed','spotDistance','spotTime','courage','reloadSpeed','commanding','general'];
                
                    if (EOS_DAMAGE_MULTIPLIER != 1) then {_unit removeAllEventHandlers "HandleDamage";_unit addEventHandler ["HandleDamage",{_damage = (_this select 2)*EOS_DAMAGE_MULTIPLIER;_damage}];};
                    if (EOS_KILLCOUNTER) then {_unit addEventHandler ["killed", "null=[] execVM ""eos\functions\EOS_KillCounter.sqf"""]};
                    // ADD CUSTOM SCRIPTS TO UNIT HERE
                    if (EOS_KILLCOUNTER) then {[_unit] call HG_fnc_aiUnitSetup;};
                    
                    } forEach (units _grp); 
                    

Found out where to put the //Custom scripts to Units

Now i've tried to add
 

Quote

 

[_unit] call HG_fnc_aiUnitSetup
_unit call HG_fnc_aiUnitSetup

if (EOS_KILLCOUNTER) then {[_unit] call HG_fnc_aiUnitSetup;};

and 

Quote

_unit addEventHandler [ "Killed", { params["_unit","_killer"]; if(isPlayer _killer) then { [200,0] remoteExecCall ["HG_fnc_addOrSubCash",(owner _killer),false]; }; }; ];



Still, all help is appreciated! 

 


 

Edited by Nebel345
Update on problem/Closer to a solution.

Share this post


Link to post
Share on other sites

Hi if you are going to add the system to the EOS you need to go in to the EOS folder and in function you will see a setskill.sqf and line 12 and 13 have to lok like this.

take the // of the line 12 than you god to go ! 

if !(AIdamMod isEqualTo 100) then {_unit removeAllEventHandlers "HandleDamage";_unit addEventHandler ["HandleDamage",{_damage = (_this select 2)*AIdamMod;_damage}];};
if (EOS_KILLCOUNTER) then {_unit addEventHandler ["killed", "null=[] execVM ""eos\functions\EOS_KillCounter.sqf"""]};
[_unit]call HG_fnc_aiUnitSetup;

 

  • Like 1

Share this post


Link to post
Share on other sites
6 hours ago, CptDezusa said:

Hi if you are going to add the system to the EOS you need to go in to the EOS folder and in function you will see a setskill.sqf and line 12 and 13 have to lok like this.

take the // of the line 12 than you god to go ! 


if !(AIdamMod isEqualTo 100) then {_unit removeAllEventHandlers "HandleDamage";_unit addEventHandler ["HandleDamage",{_damage = (_this select 2)*AIdamMod;_damage}];};
if (EOS_KILLCOUNTER) then {_unit addEventHandler ["killed", "null=[] execVM ""eos\functions\EOS_KillCounter.sqf"""]};
[_unit]call HG_fnc_aiUnitSetup;

 


As I've already tried this, i suspect there is some of my other scripts interrupting. I will try it on a clean mission! Thank you, this was very helpful!

As CptDezusa stated, if you want HG shop Killreward with EOS that is the way to do it.

However you cannot run ACE3 Advanced Medical, Advanced Revive or Ace3 Medical options with it.
 

This was my problem, huge thanks to HoverGuy for this Great script!
And thank you CptDezusa for clearifying with the script!

  • Like 1

Share this post


Link to post
Share on other sites

So im sharing my little function with you guys for Ryan Zombies.

Downside: This has to be client side'd for now, so every player on your server needs the mod with the custom script.

Function: It rewards the "single" players for every kill they make (random money count on each kill) + it counts the kills (if ur using a statusbar, u can add a kill's status)

Ryan zombie: Open up ryan zombie's mod, locate: fn_preInit, Search for line 168:  RZ_fnc_zombie_onDeath_exec = { };

Between those brackets place this:

         params["_unit","_killer"];
    
         if(isPlayer _killer) then
                
            {        
             _arr=[8,9,10,11,12,13,14];                                                         // Money range
             _Func=selectRandom _arr;                                                           // Random Money
             [_Func,0] remoteExecCall ["HG_fnc_addOrSubCash",(owner _killer),false];            // Add money           
             [0,1] remoteExecCall ["HG_fnc_addOrSubKills",(owner _killer),false];               // Add kills
            };

Now u want to reset player kills / money on every death right??

In your mission.pbo create OnPlayerRespawn.sqf and add:

 

// Reset Kills and Money 

player setVariable ["HG_Kills",0];            // Reset Kills
player setVariable ["HG_Cash",0];             // Reset Money

Goodluck! :-)

 

 

  • Like 2

Share this post


Link to post
Share on other sites

NVM, wrong version, lots of versions around.

 

Actually 5th Edit: how can i apply kill reward for editor placed units? it works well with EOS... but not for editor placed units?

also it seems to kit me out in Nato gear at startup, where/how can i 'reset' things for SP.

 

Its throwing me a curve ball as it seems to remember things even when im testing in the editor.. something to do with that stringable.xml??

 

Sorry for dumb questions, im still sifting through everything... It went from this simple shop script from my first download to a full blown shopping mall :D,

 

its pretty awesome though!

 

Cheers
 

Share this post


Link to post
Share on other sites

Hello @katipo66

 

2 hours ago, katipo66 said:

how can i apply kill reward for editor placed units? it works well with EOS... but not for editor placed units?

 

Well the thing is that HG_fnc_aiUnitSetup function is defined when initServer.sqf event script is fired... which is a problem because editor placed unit inits are called way before initServer.sqf... so if you put this in init box 

[this] call HG_fnc_aiUnitSetup;

It won't work simply because on init HG_fnc_aiUnitSetup function doesn't exist.

 

Now you can do it -> https://github.com/Ppgtjmad/SimpleShops/commit/2136244139fffe88fd292561647cafbdb44cb3b0

Also read this -> https://github.com/Ppgtjmad/SimpleShops/wiki/How-to-setup-kill-rewards

 

2 hours ago, katipo66 said:

also it seems to kit me out in Nato gear at startup, where/how can i 'reset' things for SP.

 

When you spawn in game for the first time you have the same gear as the playable unit you just chose. Then when you buy stuff it gets saved in profile or database (depends on savingMethod token value in HG_Config.h).

 

2 hours ago, katipo66 said:

Its throwing me a curve ball as it seems to remember things even when im testing in the editor.. something to do with that stringable.xml??

 

And yeah by default everything is saved in profile so when you try it in editor it will remember your cash amount, bought gear, vehicles etc... for next time you spawn in.

 

2 hours ago, katipo66 said:

Sorry for dumb questions, im still sifting through everything... It went from this simple shop script from my first download to a full blown shopping mall :D,

 

Where is the dumb question? Can't find it...

 

2 hours ago, katipo66 said:

its pretty awesome though!

 

Thanks man :)

Share this post


Link to post
Share on other sites

@hoverguy

 

Thanks for the reply, its 1:45am and i been playing around with this all night, really cool stuff!!

 

[this] call HG_fnc_aiUnitSetup; <-- thats what i was look for! 

 

ill check out the rest in the morning.

 

Cheers :)

Share this post


Link to post
Share on other sites

Just following up, with the new version I have kill reward working on EOS, Upsmon and standard editor placed units in a single mission, very happy!

 

Just a query while I'm here and haven't tried yet, is it possible to use this as a hiring/recruit system using the example: [500,1] call HG_fnc_addOrSubCash; function, e.g. include that in a addaction on a unit that includes a joinplayers group, maybe out of scope when I think about it and writing this?

 

I managed to get a recruit addaction working,  a unit joins my group and money is taken with this in a script:

[500,1] call HG_fnc_addOrSubCash;
[Medic] join group player,
medic removeAction medicjoin;

Is it possible to add this check as a condition somehow? if _hasEnough = [500] call HG_fnc_hasEnoughMoney;

 

Currently if i dont have enough the player still joins me and takes whatever i do have and leaves me at 0, much like real life!

 

Thinking about that it would be cool if it could go in the red with a defined threshold amount, much like debt, once passed the threshold badthingshappen.sqf lol

 

 

Quote

When you spawn in game for the first time you have the same gear as the playable unit you just chose. Then when you buy stuff it gets saved in profile or database (depends on savingMethod token value in HG_Config.h).

 

Is there another saving method that can be used instead of savingMethod = "Profile"; if the mission is SP only?

 

Cheers!

 

 

Share this post


Link to post
Share on other sites

Spent several nights sifting through your code and trying to understand it, thanks to you I now have a understanding of the necessity of functions! 

You were right about the Displayname and Picture after some help from some veteran guys on the discord and forums I have got there. I really liked the fact you pulled the weapon stats from the VA, is that a generic picture in each weapons cfg? I couldn't find anything to point me in that direction, my biggest fear is that it is pulled as individual lines.

Share this post


Link to post
Share on other sites

Does anyone know how to set this up for SP only?

 

Is there more to it than..

 

/* SYSTEMS */
enableSave = false;

Share this post


Link to post
Share on other sites

Hello, this script is awesome and I have been using it for quite some time. I was wondering if it was possible to modify this script so that I can sell vehicles at the garage and if it is possible to make it so that vehicles not bought from the store such as editor placed or script spawned vehicles can be stored in the garage.

 

Cheers.

Share this post


Link to post
Share on other sites
On 10/22/2017 at 9:35 AM, katipo66 said:

Is it possible to add this check as a condition somehow? if _hasEnough = [500] call HG_fnc_hasEnoughMoney;

 

Hello @katipo66

 

In scripts

// First method
private _hasEnough = [500] call HG_fnc_hasEnoughMoney;

if(_hasEnough) then
{
    // Do shit
} else {
    // Am so broke...
};

// Second method
if([500] call HG_fnc_hasEnoughMoney) then
{
    // Do shit
} else {
    // Am so broke...
};

In addAction condition you just use the function without assigning a variable to it.

 

On 10/22/2017 at 9:35 AM, katipo66 said:

Thinking about that it would be cool if it could go in the red with a defined threshold amount, much like debt, once passed the threshold badthingshappen.sqf lol

 

Yeah I can add something like this, nobody ever asked for it tho... maybe later :)

 

On 10/22/2017 at 9:35 AM, katipo66 said:

Is there another saving method that can be used instead of savingMethod = "Profile"; if the mission is SP only?

 

Yes database extension (check HG_Config.h header):

savingMethod = "extDB";

Don't know if it makes sense to use DB for singleplayer mission to you, it does to me (local database).

 

On 10/24/2017 at 4:03 AM, nelo_riot said:

Spent several nights sifting through your code and trying to understand it, thanks to you I now have a understanding of the necessity of functions! 

You were right about the Displayname and Picture after some help from some veteran guys on the discord and forums I have got there. I really liked the fact you pulled the weapon stats from the VA, is that a generic picture in each weapons cfg? I couldn't find anything to point me in that direction, my biggest fear is that it is pulled as individual lines.

 

Hello @nelo_riot

 

It's pulled from the game configs automagically :)

There's one function that retrieves right config based on passed classname (HG_fnc_getConfig) and then in the script I use the returned config to gather display name from the said config with the given classname.

 

On 11/13/2017 at 2:04 PM, Azola21 said:

Hello, this script is awesome and I have been using it for quite some time. I was wondering if it was possible to modify this script so that I can sell vehicles at the garage and if it is possible to make it so that vehicles not bought from the store such as editor placed or script spawned vehicles can be stored in the garage.

 

Cheers.

 

Hello @Azola21

 

Of course you can modify the script to sell vehicles in garage, but you must follow license terms and share your work.

And yes it's possible to take ownership of editor placed vehicles with an addAction (https://github.com/Ppgtjmad/SimpleShops/wiki/Useful-Functions - Set vehicle ownership part)

 

Simple example:

this addAction ["I WANT this vehicle",{[(_this select 0)] call HG_fnc_setOwner},"",0,false,false,"",'(alive player) AND (alive _target) AND ((player distance _target) < 5.5)'];

 

Share this post


Link to post
Share on other sites
On 10/20/2017 at 6:12 PM, Cruzader77 said:

So im sharing my little function with you guys for Ryan Zombies.

Downside: This has to be client side'd for now, so every player on your server needs the mod with the custom script.

Function: It rewards the "single" players for every kill they make (random money count on each kill) + it counts the kills (if ur using a statusbar, u can add a kill's status)

Ryan zombie: Open up ryan zombie's mod, locate: fn_preInit, Search for line 168:  RZ_fnc_zombie_onDeath_exec = { };

Between those brackets place this:


         params["_unit","_killer"];
    
         if(isPlayer _killer) then
                
            {        
             _arr=[8,9,10,11,12,13,14];                                                         // Money range
             _Func=selectRandom _arr;                                                           // Random Money
             [_Func,0] remoteExecCall ["HG_fnc_addOrSubCash",(owner _killer),false];            // Add money           
             [0,1] remoteExecCall ["HG_fnc_addOrSubKills",(owner _killer),false];               // Add kills
            };

Now u want to reset player kills / money on every death right??

In your mission.pbo create OnPlayerRespawn.sqf and add:

 


// Reset Kills and Money 

player setVariable ["HG_Kills",0];            // Reset Kills
player setVariable ["HG_Cash",0];             // Reset Money

Goodluck! :-)

 

 

Hi man, thank you, I was looking for this;)

Unfortunately i get the following error when changing this in Z&D, any idea why?

 

Data file too short 'E:\Steam\steamapps\common\Arma3\!Workshop\@Zombies and Demons\addons\ryanzombies.pbo'. expected 1496017635 B, got 46424687 B

 

Thanks and BR

 

Share this post


Link to post
Share on other sites

hey man i need some help with player inventory and i remembered your script does exactly what i want.

 

Im setting up a mission where when you get to a certain point you are asked to complete a task and you are offed a few load outs to choose from. 

 

What i am after is when you select your new loadout or old one goes into a container. the same way your script does it when you purchase a new weapon or uniform.

 

Thank you and your script is awesome i use it in every mission   

Share this post


Link to post
Share on other sites

Few ideas:

* It would be nice if you could enable the kill-reward without the need for calling the script on each individual AI. This way it would work with the ALIVE and other scripts that dynamically spawn AI. It would be better if the kill-reward was tied to the player.
* Another nice thing would be a reward for completed tasks that would be compatible with any task without the need of editing said task. Just some script that adds money if player completes any task.
* A unit shop/recruitment would be a great addition. The higher your rank, the more specialized units and bigger is your total squad size, ie. the limit of how many units you can have under your command before you are told you can't buy any more units.

Share this post


Link to post
Share on other sites

@taro8 your number 2 is quite easy to set up. On your task complete trigger just add a cash reward in the "On Activation" part. 

 

"On Activation"

[10000,0] call HG_fnc_addOrSubCash;

 

or something like that

Share this post


Link to post
Share on other sites
Just now, Chuc said:

@taro8 your number 2 is quite easy to set up. On your task complete trigger just add a cash reward in the "On Activation" part. 

 

"On Activation"

[10000,0] call HG_fnc_addOrSubCash;

 

or something like that

The thing is I don't want to edit existing tasks like the ones you get in ALIVE or MCC, as it would require editing the mod itself to add the reward. I think, I'm not good at scripting at all.

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

×