MrRightclick
Member-
Content Count
21 -
Joined
-
Last visited
-
Medals
Community Reputation
10 GoodAbout MrRightclick
-
Rank
Private First Class
-
Talk to NPC - send global message to calling player (dedicated server)
MrRightclick replied to MrRightclick's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Bumping this -- basically I'm looking for a way to send a global message to a player calling a script through an addaction in a Dedicated server... -
How Do I Edit A MP Mission That Can ONLY Be Edited In Arma 2 CO/DayZ?
MrRightclick replied to unkinhead's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You need to have your mission file unpbo'd in your Arma 2 Profiles / mpmissions folder under your documents folder. Can't say for sure where you find this, since I've got mine under Arma 2 Other Profiles, whereas my buddies have theirs under Arma 2 Profiles. When you have the mission under the MPMissions folder in the profiles folder, the mission should show up in your multiplayer editor. It won't show up in the 3D editor, because 2D and 3D mission files are different. -
How to start 10 meters from a box?
MrRightclick replied to Joe98's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
//Get a random area near the box _target = box1; _dist = 10; // 10 meters from the box _dir = random 360; // random direction around the box _pos = getpos _target; _position = [(_pos select 0) + (sin _dir) * _dist, (_pos select 1) + (cos _dir) * _dist, 0]; blue1 setPos _position I use this script for pretty much the same effect on my randomized ammobox. :) -
Talk to NPC - send global message to calling player (dedicated server)
MrRightclick posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hello, I posted a thread earlier about creating an ammo box and making an NPC give you the closest town through chat or a screen text. The spawning is working all fine and dandy, but the dude saying stuff in global chat doesn't send a message to anyone. Do I need to make player checks somewhere or something? The addAction script called on the AI unit init field (everyone in the dedi server gets the action, but it doesn't do anything): _dude = _this select 0; _dude addAction ["Talk to friendly unit", "tell_stuff.sqf"]; The chat script: _host = _this select 0; _caller = _this select 1; _id = _this select 2; //get the placed ammobox _ammobox = ammo1; //check if host is alive if (alive _host) then { _host globalChat "Hello!"; //get closest town to ammobox _closesttown = (nearestLocations [_ammobox,["NameCityCapital","NameCity","NameVillage"],10000]) select 0; _town_name = text _closesttown; _town_pos = position _closesttown; Sleep 2.5; _host globalChat ("We were patrolling the area and saw a broken down enemy weapon shipment."); Sleep 2.5; _host globalChat ("It was located near " + str(_town_name)); }; This works in a listen server, but not in a dedicated one. In a listen server only the calling player gets the globalchat, which is awesome. In a dedi server, nobody gets any messages at all. Help? Thanks! :D -
Spawning an ammo box in to a random town
MrRightclick replied to MrRightclick's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I actually tried the getPosATL with all of the commands, but it made no difference. Only the normal setPos command in the end made the crate appear above ground. Forgot to change them back to ATL after testing with the ASL, so that's why it's ASL in the script.. :) -
Spawning an ammo box in to a random town
MrRightclick replied to MrRightclick's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Double posting is cancer, but anyway: The above script worked in multiplayer just fine. Now all that's left is to get the box out of a house if it spawns inside one.. Is there a way to check if a house is on top of it? :O -
Spawning an ammo box in to a random town
MrRightclick replied to MrRightclick's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks for the reply! I tried that out, but the box is still nowhere to be seen when I teleport to the position it's supposed to be in. EDIT: Well the box spawns on the ground level with this code: if (isServer) then { _box = _this select 0; //Get the position of the box _pos = getPosATL _box; //Get an array of all the towns and select one at random _townlist = nearestLocations [getpos _box, ["NameCityCapital","NameCity","NameVillage"],10000]; //Get town from array _rnd = floor random (count _townlist); _town = _townlist select _rnd; _town_name = text (_town); //Get town location _locationPos = locationPosition (_town); //Move ammobox to town location _box setPosASL [_locationPos select 0, _locationPos select 1, 0]; //Fix ammo box to ground level _newpos = getPosASL _box; _box setPos [_newpos select 0, _newpos select 1, 0]; }; Still need to test that in multiplayer, because here http://community.bistudio.com/wiki/setPos it says in a comment that -
Spawning an ammo box in to a random town
MrRightclick replied to MrRightclick's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I actually got this working once I figured out getNearestLocations just returns an array. if (isServer) then { _box = _this select 0; //Get an array of all the towns _townlist = nearestLocations [getpos _box, ["NameCityCapital","NameCity","NameVillage"],10000]; //Get random town from array _rnd = floor random (count _townlist); _town = _townlist select _rnd; _town_name = text (_town); //Get town location _locationPos = locationPosition (_town); //Move ammobox to town location _box setPosATL _locationPos; }; The problem I'm having now is making the box stay on ground level, since it seems to get teleported underground every time I spawn it in.. :( Is there a command to make it appear on ground level? :butbut: -
Give items to a unit if it is not controlled by player.
MrRightclick replied to insumsnoy's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Create a script called add_weapons.sqf that checks if the unit is a player, place it in the mission folder, then call that script from the init line of all the 4 units. For example: _dude = _this select 0; //check if the selected unit is not a player if (!isPlayer _dude) then { //add an AK 74 to the selected unit _dude addWeapon "AK_74"; }; Edit the script to your liking and then paste this in to the init line of all units: nul=[this] execVM "add_weapons.sqf"; I think that should do it. -
Spawning an ammo box in to a random town
MrRightclick posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hello! I've just gotten myself in to Arma 2 scripting, and I'm facing some problems with getting locations of towns and teleporting stuff around. What I'm trying to do is I've placed an ammobox in my map called "ammo1", and the idea of this script-training mission is to talk to a guy who tells you the location of this ammo box by telling you the name of the nearest town/city/village. The script would be called from the ammo box init field. So far what's working is the dude telling you the location of the handplaced ammo box, so I'd like it to be so that when the mission is loaded on a server (this will be later used on an online map on a dedicated server), the ammo box gets placed in to a random town in Chernarus. I can't really figure out how to select a random town and make the crate move there. I know the getPos and setPos commands to move the crate, but the actual select-random-town command I can't figure out. Also some randomization in the spawn location would be nice, so the box doesn't just get spawned right in the middle of the town. I've tried doing this through markers placed on top of towns, placing them in an array and then choosing a random one from there, getting it's position and then teleporting my character there just to try the script, but all it does is teleport my character to the ocean every time. TL;DR: How to get a random city/town/village out of all Chernarus towns and move a handplaced crate there, possibly randomizing the location it's placed in by let's say by 100 meters? Choosing a random marker for spawn is also fine. Thanks in advance! -
Do/will AI in Arma have unlimited ammo?
MrRightclick replied to BobcatBob's topic in ARMA 3 - GENERAL
Hope I'm not necroposting, but: I would definately not call that "pretty good". Also the godlike AK-sniping is really annoying at times. I know, I know.. MODS FIXETH! And I do use for example the Zeus AI mod, but only thing I've seen is that the AI now take forever to follow you, for example running from building to building goes more like: "COVERING, GO!" Guys lie in the middle of the road under enemy fire. "GO GO GO!" One of them starts running back to the way we came, even though going forward would lead to a safe zone. "*n* is dead" Replace *n* with any number the AI soldiers had. :rolleyes: Seriously hoping for better AI for ArmA 3. -
The Undead Mod
MrRightclick replied to charon productions's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Alright, thanks for the answer. It's too bad if one can't spawn both of the zombies, because the slow zombies are way too easy to outrun and the fast ones are too hard when they come at you with full force. :rolleyes: But it seems that handplacing some of both might work without problems? -
The Undead Mod
MrRightclick replied to charon productions's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
How would I make the game delete the zombies that aren't needed anymore? My mission consists of running through multiple villages, and if the game spawns the zombies to the villages I've already left, or if the player has just ran around the zombies without killing them, won't they take up space from the default 100 ZED limit, possibly making the module stop spawning zombies to the villages ahead? Also is it possible to spawn both the infected and the zombies at the same time from the same spawn module points? -
ACE 1.7 (Advanced Combat Enviroment) for OA/CO
MrRightclick replied to AnimalMother92's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Well now I have the acex_missions.pbo. Found out I had a very, very outdated version of ACEX (I guess), downloaded from ArmAHolic not too long ago. Downloaded 1.7..something from the ACE site, so after these alltogether like 500mb of downloading I hope the thing works. Still looking for the maps. Anyone? I'm just baffled that maps like those are so unavailable. :j: -
ACE 1.7 (Advanced Combat Enviroment) for OA/CO
MrRightclick replied to AnimalMother92's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Hey, I'm trying to connect to servers with ACE and AI Domination just so that I can get the god darned mission from somewhere. The only problem is that I'm getting "missing acex_missions" error when trying to join. I've looked EVERYWHERE for it. Found out it should be located in @ACEX/addons/acex_missions but it's not. What to do? OH and if ANYONE would be so kind as to save me multiple hours of finding servers with these two maps, please, help by uploading the map or giving a link Isla Duala with ACE and AI Takistan with ACE and AI Thanks!