MadMonk
Member-
Content Count
20 -
Joined
-
Last visited
-
Medals
Everything posted by MadMonk
-
I have placed this script in the player unit initialisation to add a weapons mounted light. The item appears in the inventory and is attached to the weapon but I cant switch it on. I have tried the headlight control L by default but it has no effect. Does anyone have any ideas? this addPrimaryWeaponItem "acc_flashlight";
-
Ive been trying to convert some sqf script for a dog AI system into an FSM now I understand how they work, but I'm really struggling with moving the dog unit around from within the FSM its self. As I understand it, if the FSM is called using the execFSM, any agent moves must be done using doMove. If the FSM is called using doFSM, then moveTo should be used. Having looked at some existing FSM code in arma2, I have seen examples that disprove this observation and I'm thinking that something could have changed with a patch. I've tried both calling methods in my code and the unit doesnt move at all. Ive put some over the top logging on all scripts and stages in the FSM and everything seems to be ok but no movement and no errors are logged in the rpt file. Up to now, the only Arma 3 FSM's Ive seen do not contain any functionality to move units and any information about moving units relates to Arma 2 and before. In case anyone else is looking at FSM's and finds this post in the future, Im posting a link to another thread I found which contains some good info but it doesnt seem to apply to Arma3. http://forums.bistudio.com/showthread.php?118451-doFSM-or-execFSM-is-there-an-advantage-for-one-over-the-other
-
Playing positional sound using playsound3D
MadMonk posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I've been testing this arma 3 command out tonight but I cant seem to get any positional properties to the sound. Changing parameters, I can adjust frequency and volume but not the position. I wonder if this works only with 5.1 systems and not with two speakers. Syntax: playSound3D [filename, source, isInside, position, volume, frequency, distance] Parameters: [filename, source, isInside, position, volume, frequency, distance]: Array filename: String source: Object isInside: Boolean position: Position volume: Number frequency: Number distance: Number - How far is sound audible (0 = no max distance). playSound3D ["C:\Users\A\Documents\Arma 3 Alpha\missions\playsound.Stratis\Zevongrowling.wav", player] This works playSound3D ["C:\Users\A\Documents\Arma 3 Alpha\missions\playsound.Stratis\Zevongrowling.wav", dogs, false, getPos dogs, 1, 1, 0] dogs is another unit (actually a rabbit that I have named dogs) that i move around the player to test positional properties. last value (max distance, 0 = no max, any other value here and there's no sound) last but one, volume (anything over 1 doesnt work, 0.1 lowers volume considerably) frequency alters pitch of the sound correctly. I am not sure what the difference is between source and position parameters. Source must be an object or unit, so in the test I used a rabbit. Does this mean the source of the sound, if so, then what is the position parameter. -
Thanks for the dog script it works great! Its cleared up a couple of misunderstandings I had about FSM's. It looks like the create agent method is broken when using doMove, Ive verified this a number of times now and have converted to using createUnit instead. It would be interesting to know the difference as I get the imrpression that createAgent has less overhead.
-
Thanks for this, Im going to have to look into it further. Actually, when I say dog, I'm actually using a man for the time being since creating a dog from the animals2 pbo using the createAgent method throws a repeated error log in the rpt file that just continues indefinitely. This is the error in case it means anything to anyone. I am thinking that its a conflict somewhere with an underlying fsm for the dog. The following three messages are logged repeatedly -: It seems that the createAgent command is causing problems with Arma 3. With further testing, I proved that doMove does work in the fsm if I add a unit in the editor and call the script in the units init to run the fsm file, whereas using createAgent and doMove, the unit remains static. To note, with createAgent and setpos, this does work. I seem to remember reading something a while back about createAgent not having any underlying AI functionality and that a doMove doesnt work because the base AI isnt there, I could be wrong though. Next step is to test createAgent and doMove with Arma2. The reason I'm caught up on using the createAgent method is that I've seen it being used in the Dayz code and thought the technique could be applied to dogs. Maybe not, or maybe its an arma 3 quirk. Basically I want lots of dogs that can run in packs and Im hoping to implement a fairly in-depth AI system. ---------- Post added at 20:51 ---------- Previous post was at 20:37 ---------- Many thanks for this, I'll give it a try and let you know how it goes. Yes, I'm hoping for some badass dogs with arma 3, the arma 2 dogs are pretty tame looking but I found that sampling some decent barking sounds off youtube clips does give them an edge. Its a shame the attack animation isnt configured though, I spent a good while looking at it, learned a fair bit but didnt crack it in the end.
-
Thanks for the replies. Ive tried reproducing the FSM in arma 2 and it still doesnt work so it looks like its a problem with my understanding of FSM's. At the moment, I'm experimenting with an example I found at this link : http://resources.bisimulations.com/wiki/File:FSM_Demo.zip I've got the example working, with a little tweaking as it was written for the BIS simulator system. Once I'm happy I understand what I did wrong, I'll convert it to Arma 3 and post my findings. Btw Zapat, I took the dogs from arma 2 by adding the animals2 pbo file. They work pretty well when controlling the dogs by script but I know FSM is the way forward now Ive been reading up on them. The animals 2 pbo dog (Pastor) does have some references missing to certain animations (like attack) which is a shame, Im hoping to be able to fix this by extending the config and adding the references to the rtm files. I have tried this once but didnt have any joy, but Im definitely giving it another go once I crack this FSM.
-
Playing positional sound using playsound3D
MadMonk replied to MadMonk's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ive been trying out the say3D command, this seems to work perfectly. If anyones trying it, just pop the references to the sounds in the description.ext and play the sound on a trigger such as -: rabbitDog say3D "growlSolo"; rabbitDog is a unit class CfgSounds { // List of sounds (.ogg files without the .ogg extension) sounds[] = {growlSolo,growlZevon}; // Definition for each sound class growlSolo { name = "growlSolo"; // Name for mission editor sound[] = {\sounds\SoloGrowling.ogg, 1, 1.0}; titles[] = {}; }; class growlZevon { name = "growlZevon"; // Name for mission editor sound[] = {\sounds\Zevongrowling.ogg, 1, 1.0}; titles[] = {}; }; }; -
Playing positional sound using playsound3D
MadMonk replied to MadMonk's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Just a note to correct the first playsound3D script example above, where I said that this works, what I meant was that it played the sound correctly but had no positional characteristics which I suppose would be correct since the location is the player. I've been looking into this command but the only info I can find is on the BIS wiki page. What I'm hoping to do is to add some shouting and dog barking sounds to a mission but for them to be really authentic, the positional effect is key. -
Switching on a weapon mounted light
MadMonk replied to MadMonk's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks for the replies, It seems to work now with the original line of code for the unit initialization with nothing different. I did have an arma crash to desktop though just after windows telling me I was nearly out of memory (4.7 gig used out of 8 gig) so there might be a memory leak somewhere. Next step is to equip some AI with flashlights. -
Switching on a weapon mounted light
MadMonk replied to MadMonk's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks for the suggestion, it didnt work here. Is the headlight control the right action, Ive gone through the controls and it seems to be the obvious choice. -
ARMA 3 base terrain textures WORSE than the original Operation Flashpoint
MadMonk replied to SandboxPlaya's topic in ARMA 3 - BETA DISCUSSION
I always assumed that rendering high detail terrain from a distance was too much of an overhead for the engine. A while back, me and a friend did some testing to determine the visibility of a player to someone at distance when the player being observed is crouched in grass and thinks they are fully camoflaged. The results were pretty bad really, the player basically stuck out like a sore thumb for quite a large distance. Surely, it would be pretty easy to design a system that hid the player at a distance if that player was proned in grass. The hide level could be altered based on crouch, prone and grass length or density. -
I've built an addon than I have classified as a vehicle so I can add and remove Item actions on the fly in script. The problem I'm having is that if the addon is dropped in a house, Its practcally impossible to access the action menu. Ive noticed that if I drop the item in the doorway of a house and crouch, so that I can see the top of the item and the background is not the house, the action menu appears correctly. Is anyone aware of a workaround for this as its the last problem Ive got with what I'm trying to build.
-
Problems with vehicle class action menus when item placed in a house
MadMonk replied to MadMonk's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks for the reply, I didnt think about using triggers. I'll look into that and post back later. I can see the item that I've placed in the house clearly, basically, its a sensor which is 5 foot tall with a small antenna on top. When placed near an open door where the top half of the sensor is above thre ground level with the outside as the backdrop, the menu appears but if the sensor is placed in the house with the backdrop being a wall, its near impossible to bring up the action menu. -
Problems with vehicle class action menus when item placed in a house
MadMonk replied to MadMonk's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Just bumping this incase. Have been doing more tests on this, the problem seems to be more noticable in different types of buildings. There is a corregated building near the barracs at the NW airfield that is much worse. Placing an addon unit here that has action menus assigned does not work at if all of the unit is in the building. If part of the unit is in a doorway, placing the in game cursor over that area of the unit will display the propper addon menu. -
Passing array and other parameters into function
MadMonk posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Im writing a function to search an array of objects for a particular type and also test for parameter values stored against that object. If the object matches and the two parameters also match, the object is then added to an array in the function and passed back to the caller. Is it possible to pass an array into a function, along with other parameters like this - : NewArray = [PublicSensorArray,"snsball",1,0,2,50,7] Call ArraySearch; This is the function header -: private ["_SearchArray","_Item1","_Element1","_Element1Value","_Element2","_Element2Value","_ElementsPerItem"]; //Get passed over variables _Array = _this Select 0; //Passed over array _UnitType = _this Select 1; //Object type to look for _Element1 = _this Select 2; //Element number _Element1Value = _this Select 3; //Element Item _Element2 = _this Select 4; //Element number _Element2Value = _this Select 5; //Element Item _ObjectElements = _this Select 6; //Number of elements for each object Im sure its something to do with how I'm specifying the array in the calling code but I've tried several ways of formatting this and it keeps throwing an error. Does anyone have any suggestions for the formatting? -
Passing array and other parameters into function
MadMonk replied to MadMonk's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Excellent, thanks for your help. I'm going crazy on functions at the moment, hoping to build a bit of a tool kit. -
Notepad++ SQF syntax highlight
MadMonk replied to nicolasroger's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Very good post, autocomplete is amazing when using good naming systems. -
Notepad++ SQF syntax highlight
MadMonk replied to nicolasroger's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks! I've just tried this and its great. -
Trouble with a script for a deployable sensor
MadMonk posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hello folks, Im new to scripting and have been playing with a few ideas but this one has really got me stumped. I've been experimenting with a script for a deployable sensor. From my current understanding, I am trying to create an in game trigger that is activated when I select ‘Enable Sensor’ from sensors actions menu, this trigger is to fire when anyone is in range and currently displays a text message about its state(I hope to have a localized audible). At the moment I'm using a satellite radio briefcase , a friend is creating a proper model for this . The situation is, I can pick up the case, move it and drop it, then enable the sensor. Doing this, the trigger is permanently activated, no matter where I am in relation to the case. If I go over and pick up the case doing nothing else, the trigger then functions as I would expect and if I enter the zone where the case was, it triggers and deactivates when I leave the zone. What I would like to do is be able to drop the case, activate and deactivate the sensor. The next step is to have multiple sensors triggerable in an internet hosed game. I have added the following script to the objects (satellite radio) initialization section.//Actions - Initialization of sensor take=0; act1 = this addaction ["Take Sensor","Carry.sqf","",1,false,true,""]; act2 = this addaction ["Enable Sensor","sensorBallON.sqf","",2,false,true,""]; act3 = this addaction ["Disable Sensor","sensorBallOFF.sqf","",3,false,true,""]; This is the drop and pickup script copied form another post on the forum //Carry.SQF switch (take) do { case 0: { _scase = _this select 0; _man = _this select 1; _scase attachto [_man, [0.035,-.055,-0.22], "LeftHandMiddle1"]; _scase setdir 90; _scase removeAction act1; act1 = _man addaction ["Drop Sensor","carry.sqf","",1,false,true,""]; take=1;scase = _scase; }; case 1: { _man = _this select 0; detach scase; detach _scase; scase setvelocity[0,0,-.3]; _man removeAction act1; act1 = scase addaction ["Take Sensor","carry.sqf","",1,false,true,""]; take=0; scase = _scase; }; }; //SensorBallOff.SQF (Deletes the trigger) hint "SensorBall Off"; deleteVehicle trg; This creates the trigger ( I have assigned markerobj variable to the player position by creating a copy of the variable because I thought that directly referring to player pos meant that the trigger position would continually update with the player position. My understanding of this is limited at the moment. //SensorBallON.SQF markerobj = +getpos Player; deletevehicle trg; trg=createTrigger["EmptyDetector",markerobj]; trg setTriggerArea[10,10,0,false]; trg setTriggerActivation["Any","PRESENT",True]; //trg setTriggerTimeout [5, 5, 5, false]; trg setTriggerStatements["this", "hint 'Alarm'", "hint 'Clear'"]; -
Trouble with a script for a deployable sensor
MadMonk replied to MadMonk's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks F2K, I've just tried this and it works great. My friend has finished the sensor now so it looks like we're nearly done.