Jump to content
Mr. Davy Jones

Altis Life Shops Interaction Range

Recommended Posts

Hi there!

 

I´m a new coder in need of assistance on a little problem I´ve got on my server, for some reason you can interact with the store NPC´s from a distance of 30m simply by looking in their direction. I´ve done my best to find out the cause of this but from what I´ve seen so far no one else has or have had this problem there for I can´t find a fix. I´m really in need of help to reduce the interaction range to roughly 1-4m distance instead of the current 30. Thank you!

 

This is what I´ve got typed in on the NPC store Init --->

this allowDamage false; this enableSimulation false;

this addAction[localize"STR_Shops_Market",life_fnc_virt_menu,"market"];

 

Share this post


Link to post
Share on other sites

Thats great I appriciate the help, I´ve actually managed to work my way around the problem by copying my code for the atm and reworking it to fit markets and such. :D

Share this post


Link to post
Share on other sites
8 hours ago, Mr. Davy Jones said:

Thats great I appriciate the help, I´ve actually managed to work my way around the problem by copying my code for the atm and reworking it to fit markets and such. :D

heres an example of both of what HazJ mentioned, "_this distance _target < 2.6" is the condition that only lets the action show up if the player is within 2.6 meters of the atm(2.6 is a perfect distance imo). the 3 is the radius condition so if the player is further than 3 meters then it will not do the addaction.

this addAction ["Access ATM",
{
	//do your crap
}, [], 0, false, true, "", "_this distance _target < 2.6", 3];

 

Share this post


Link to post
Share on other sites

So lets say I´ve got this Code for my carshop: this enableSimulation false; this allowDamage false; this addAction[localize "STR_MAR_Car_shop",life_fnc_vehicleShopMenu,["civ_car",civilian,["civ_car_1","civ_car_1_1"],"civ","Bruce's New & Used Auto's"]]; this setVariable ["realname", "Car Shop"];

Where would I write in the code you´ve just given me for it to work?

Share this post


Link to post
Share on other sites

So lets say I´ve got this code for my Carshop: this enableSimulation false; this allowDamage false; this addAction[localize "STR_MAR_Car_shop",life_fnc_vehicleShopMenu,["civ_car",civilian,["civ_car_1","civ_car_1_1"],"civ","Bruce's New & Used Auto's"]]; this setVariable ["realname", "Car Shop"];

Where would I type in the code you´ve just given me for it to work? 

Share this post


Link to post
Share on other sites
3 hours ago, Mr. Davy Jones said:

So lets say I´ve got this Code for my carshop: this enableSimulation false; this allowDamage false; this addAction[localize "STR_MAR_Car_shop",life_fnc_vehicleShopMenu,["civ_car",civilian,["civ_car_1","civ_car_1_1"],"civ","Bruce's New & Used Auto's"]]; this setVariable ["realname", "Car Shop"];

Where would I write in the code you´ve just given me for it to work?

read the addaction page https://community.bistudio.com/wiki/addAction . you want to modify the condidion and the radius. from a quick skim of what you posted it looks like yours goes to arguments and stops(someone correct me if im wrong), just continue on until you get to radius.

object addAction ["title", {script}, [arguments], priority, showWindow, hideOnUse, "shortcut", "condition", radius, unconscious, "selection", "memoryPoint"];

 

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

×