Jump to content

xxanimusxx

Member
  • Content Count

    453
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by xxanimusxx

  1. ahahah my bad, I tried the code out in an example mission but somehow managed to write it down the wrong way in this thread x'D If the second trigger somehow fails to accept the condition, try playAltitudeAlarm == true instead. Haven't tested it yet, just in case it gives you some errors.
  2. Well I'd use two triggers to achieve this: Trigger 1) Activation: GameLogic (Repeatedly) Condition: ((vehicle player getPosATL) select 2) >= 100 onAct.: playAltitudeAlarm = true; execVM "playMissileInbound.sqf"; onDea.: playAltitudeAlarm = false; Trigger 2) Activation: GameLogic (Repeatedly) Condition: playAltitudeAlarm Timeout: 10, 10, 10 onAct: execVM "spawnEnemyFighter.sqf"; In playMissileInbound.sqf you'd implement a loop which will play the sound you're searching for (I also didn't find it in a quick search, but "missile inbound" has a good ring to it). To loop the sound you need the length of the sound and multiply it with 1000 to set the correct delay. The result could look like this: while {playAltitudeAlarm} do { playSound "......"; sleep 1300; }; This example is for a sound which takes 1,3 seconds to play. I'm sure there is a more efficient way to achieve sound loops using triggers, but as I'm not an experienced developer, this is the most I can do ^^ In spawnEnemyFighter.sqf you'd sleep for 15 Minutes (isn't this a bit too long? I mean if the enemies are already warned by the radar, why bother to wait 15 minutes until they actually attack?) and spawn a Heli with AI's and let them attack the player. The commands you'd want to use are "createVehicle" and "createUnit". As for the AI and attacking part you have to look around in this forum, the BIKI or ask someone else who has more experience in AI scripting :D
  3. Hi there fellow scripters, I'm editing a mission which will have lots and lots of quests to accomplish and some of them contain a mission to find a specific AI or Player in a crowd and eliminate it. To be able to find the "object" (I'd rather refer to the AI/Player as an object to make things easier to understand) in question, the Player can activate some sort of optical enhancement which will color all unrelated objects in a dark shade and highlight the target - that's the theory so far. The effects should look pretty similar to activating the TWS scope of a rifle, shading everything dark/bright except of bodies. So there must be a way to (at least) apply a post process effect to achieve the thermal sight which is already implemented into the game. What I want is to selectively shade a target and not all bodies in another color - like the Eagle View in Assassins Creed (yeah, I know, it's a far-fetched example, but explains a lot). The workflow would look like the following: a) shade everything in the screen with a dark color b) select objects X and highlight them using a bright color So are there ways to use PP-Effects or smiliar techniques to apply these effects for selected objects?
  4. Thanks Loyalguard, now I have at least some pointers which should lead me into the right direction. As far as I understand, there must be a hiddenselection-Array in the configuration of the specific object for setObjectTexture to work. Because no matter what object I try to execute this command on, it doesn't change anything. This really begins to bug me alot, how the f*** is the thermal mapping working on every player/body even if they don't have hiddenselections ? Im really confused right now, because after searching the cfgVehicles to find any object which has the hiddenselection-Array, none popped out. Can someone provide an example mission or script fragment which shows the usage of setObjectTexture using Procedural Textures on an existend object? // edit @2nd Ranger Yeah thats another approach you showed there, I already anticipated this method and it will be my fallback plan if everything else won't work. Thanks for the particle effects, it really looks interesting xD
  5. Thanks for the hint, im gonna look into that. But how is the thermal sight of some snipers implemented? I thought almost everything in arma is done by scripts, if so, there must be a location where that script is, isnt it? Or is the TWS scope implemented using the weapon model and doing some magic alongside the model data? // edit: I tried to use setObjectTexture and the example in the bottom of the BIKI article but after executing the command nothing happens in particular O_O I mean are there any conditions to meet or why doesnt it do anything despite me trying to change the texture of several objects? :<
  6. Well the bounding box of an object don't have to reflect the actual size because a bounding box is used to show the outer boundings of an 3D object. For example if said object is a composition of several 3D objects, the bounding box will also be bigger as the object itself. In some of my tests the bounding box results showed some weird values because the object was at the bottom of the bounding box with at least 5 meters of empty area till the top bounding - this happens when the 3D Object while beeing edited is saved that way (it's useful ingame if you have to align several objects into one and dont want to do math for every single object, e.g. the LHD) I also could be wrong but I learned to question the values returned by boundingBox :D
  7. xxanimusxx

    Whats wrong?

    uh, you forgot to close the case-block.... case "Bunker (Bulding)": { _vehClass = "Land_fortified_nest_small_EP1"; }; // ------------ // this should do it :)
  8. xxanimusxx

    HideObjects

    Well hideobject does what it says: hide an object. It will be unvisible on the machine where the command was run. But the object will be able to move and will further communicate with the server. If you really want to cut down network expenses you should consider using enableSimulation and set it to false on every object after you made them invisible. As this command also requires you to run it on every machine to take effect for every player, you have to remotely run it on the other machines. But be advised that using RE will hide the objects on ALL machines, which could contradict your game logic, let's say you have 5 players on your map and 4 of them are near your objects and one player is 1km far way, so all objects would be hidden and the other 4 players wouldn't be able to see them. So what you want to do is check the distance between every player individually and the objects. You have to constantly check the distance of the player(s) to the objects you want to hide and then execute the commands. I'm not a scripting guru so there could be another approach to your issue but you could add a loop which constantly looks for the distance between the current player and the objects (use the command "distance") and hides the objects if the conditions are met. ----------------- Okay, I tried it out now and this code is working for me (at least in singleplayer): Put this into your init.sqf (or in a seperate sqf and execvm it from your init.sqf) // init.sqf _hideAndSeek = { while {true} do { { if (!(isPlayer _x)) then { _object2Hide = _x getVariable["object2Hide", false]; if (_object2Hide) then { if ((player distance _x) > 1000) then { _x setVariable ["hidden", true]; _x hideObject true; _x enableSimulation false; } else { _isHidden = _x getVariable ["hidden", false]; if (_isHidden) then { _x setVariable ["hidden", false]; _x hideObject false; _x enableSimulation true; } }; }; }; } forEach allUnits; sleep 10; } }; _hideAndSeekSpawn = [] spawn _hideAndSeek; player setVariable ["hideAndSeekSpawn", _hideAndSeekSpawn]; Now you have to insert the following code into the Init-Field of every unit you create: this setVariable["object2Hide", true, true]; I tried this code out but it could still be buggy but it should hide every object (which you decorated with the line above) if the distance to the player is more than 1km and checks every 10 seconds for the distance (with that great distance you don't have to check it more frequently). There are still some informations missing to really help you out though! Like when are the objects you want to hide are created? In the init.sqf? In the missions.sqm or during the game? If your objects are created during the game you have to synchronize your objects with the objectsArray (like using publicVariable) or hope that setVariable does the job. If your objects are created in the init.sqf or within your missions.sqf you don't have to do anythin more. Well I'm sure there are more efficient ways of doing this (like with triggers or smth) and I'm sure someone with better knowledge will help you out ^^
  9. Well I still don't know why there is no function for directChat and I'm afraid u'd still have to do a workaround like a for-each-group over all playableUnits/nearEntities and checking the distance to them before issuing a chat-function.
  10. Okay I did the following steps: I downloaded and "installed" the following http://www.armaholic.com/page.php?id=7864 Then I overwrote the files Alex4 posted and reopened NPP. The only entry I see in the Language-Tab is "SQF" and that won't highlight my scripts! So what did I do wrong in the process? :< I feel like I missed some steps in between ... :S
  11. Now I'm desperate.... I did get the autocompletion to work but the highlighting still won't work :< What do I have to do in order to activate the highlighting? I already downloaded a bunch of files from this thread and I don't know anymore where I have to put em and what I have to do in NPP to activate it. I'm using NPP v6.2.3 I would really appriciate help here cause I'm editin all my SQF-File within NPP and the highlighting would be a really neat feature :>
  12. Well I'm also working on something like the OP does and I'm using the Editor to place the objects/triggers/whatnot into the Chernarus-Map and save the Mission as an User-Mission. Afterwards I simply merge my mission.sqm with the one provided in DayZ (Server). It's not a pretty thing to do but it works. Overall it's a pain in the ass because the facts the posters above already depicted - and the thing is: you won't get your hands on the official server-pbo from DayZ and talk about modifying it unless you use some private hive and if you do, the forum/blog of the devs who created the prvate server is your place to go in order to ask questions :)
  13. xxanimusxx

    Adding Music Not Working

    Well and there you have your error :) If you want to define several sounds in your definitions.ext you should do the following: class CfgSounds { // List of sounds (.ogg files without the .ogg extension) sounds[] = {song1, song2, song3 ...}; // Definition for each sound class song1 { name = "combat1"; // Name for mission editor sound[] = {\sound\combat1.ogg, 1, 1.0}; titles[] = {}; }; class song2 { name = "combat2"; // Name for mission editor sound[] = {\sound\combat2.ogg, 1, 1.0}; titles[] = {}; }; class song3 { name = "combat3"; // Name for mission editor sound[] = {\sound\combat3.ogg, 1, 1.0}; titles[] = {}; }; }; But as far as I saw some description.ext's before, the following notation should also work (no warranty!): class CfgSounds { // List of sounds (.ogg files without the .ogg extension) class sounds { class song1 { name = "combat1"; // Name for mission editor sound[] = {\sound\combat1.ogg, 1, 1.0}; titles[] = {}; }; class song2 { name = "combat2"; // Name for mission editor sound[] = {\sound\combat2.ogg, 1, 1.0}; titles[] = {}; }; class song3 { name = "combat3"; // Name for mission editor sound[] = {\sound\combat3.ogg, 1, 1.0}; titles[] = {}; }; // [...] }; }; I really don't know if the latter works but it does for Dialogs though :) // edit: Shit, too late :> (relating your ogg-files: I'm used to scale down the bitrate of my files under 100kbit/s as no one really hears the difference, but it will downsize your files considerably)
  14. xxanimusxx

    Adding Music Not Working

    Afaik crashes like these occur when the description.ext is somewhat malformed. I don't know if it will help you but try to enclose the relative path of your sound-file with quotation marks. [...] sound[] = {"\sound\air1.ogg", 1, 1.0}; [...] http://community.bistudio.com/wiki/description.ext#cfgSounds
  15. Hello there Bohemians, after a long consideration I finally brought myself to register to this very useful forum in order to ask some questions which are bugging me quite some time now. I'm a computer science university student in Germany (well you'll notice soon enough while reading my English) and I must say: the script-syntax used in Arma2 is the most ugly one I've encountered so far :) (No offense to the programmers though!) The learning curve is very steep but somehow I managed to get a hang of it and building my own scripts is not that hard anymore (although MP locality confuses me sometimes...). Okay let's end the introduction and get to the real topic. I'm here because I have a lot of questions concerning the editing of missions and common Do's and Don'ts which couldn't be answered by a noob like me but by experienced users. Here is some short basic data: I'm in the process of editing a Chernarus-Mission of a (by now well known) Mod for Arma2. My current approach is to add my stuff in the Arma 2 Editor and merge the output with the mission-pbo from the Mod - which actually works great so far. As this approach sounds like unnecessary work it is unfortunately the only way because the Mission-pbo is the only part of the Mod I can legitimately modify. I have no access to any other parts of the Mod or whatsover. In addition to the Arma2 Editor I also use the RealTimeEditor (by Jonas Scholz) every time I have to insert Units e.g. in buildings - for placing Triggers and Waypoints I prefer to use the ol' good Arma2 Editor :) [TABLE=width: 600, align: left] [TR] [TD]Used Arma-Game:[/TD] [TD]Arma 2 Combined Operations[/TD] [/TR] [TR] [TD]Arma2-Version:[/TD] [TD]1.62[/TD] [/TR] [TR] [TD]Beta-Patch:[/TD] [TD]1.62.97771[/TD] [/TR] [TR] [TD]Mods used while Editing with RTE:[/TD] [TD]@CBA(_A2/_OA), @JayArma2Lib_new, @RTEditor[/TD] [/TR] [/TABLE] Okay now I want to ask the common questions (which are somehow connected to the mission I want to edit). Triggers Like everybody else I also use triggers to put dynamic reactions to player behaviour: I placed triggers (Bluefor / repidiately) and Condition: "this" into the entrance of the churches in the map. The onAct-field calls a function (thisList call fnc_showMessage;) which checks a variable (_this select 0 getVariable...) and outputs a message onto the display if this variable is not set. After that the variable will get set and every consecutive call of fnc_showMessage will do nothing - it's just to notice the player once what he can do in that buildings. Unfortunately this happens: Any player of Blufor activates the trigger and the message is shown to all players. Changing the Condition to "player in thisList" shows the message only to the player who enters the trigger area, but if someone else stepts into the area while another one is still in there, he won't get any message. After I read some topics related to this I concluded the following: Triggers inserted within the Editor are MP global, so fulfilling the condition will execute the script given in onAct(ivation) on all machines, thus leading to undesirable behaviour if the condition or onAct-Script isn't written to counterbalance. One could use the following in the condition field or in the called script: player in thisList Unfortunately this leads to another problem: thisList holds all players within the trigger range who fulfilled the condition and gets updated when more players are entering the trigger area. If you use to call/execVM a custom made script within the onAct-field, one has to constantly loop within the script in order to assign the effects to all players in the trigger (e.g. with {..}foreach _thisList) because the trigger is fired after one player has fulfilled the condition - latecomers won't affect the trigger state unless all players have left the trigger area. Triggers inserted with createTrigger are local (according to Biki). So activating the trigger by the player on whose machine the trigger was created will have the opposite effect of the trigger above: the onAct-field will be executed on the players machine only and won't get broadcasted to the other machines. thisList select 0 will return the player and count thisList will always return 1. Result: So to solve my problem I just need to create the triggers script-side (e.g. in init.sqf). The position and other attributes can be copied from withing the Editor into the script to match the location. Q1: Is this the correct approach? As createTrigger is local, there shouldn't be any problems even if the triggers overlap (they surely will because the same location is used for all of them), should there? [*] Actions What I actually want is to add various Actions to playable units but with the condition that the players who actually got the actions assigned can't see them. Every player should be able to see the actions of the other players, but not their own. For example: We have 3 player in the server and the action "Tell me a joke" is added to all players. As common sense dictates you should be able to choose "Tell me a joke" if you face another player but to see this option on yourself would be... rather... well, socially awkward :) According to Biki the addAction command is local, so I can put some code into the init.sqf which will loop all playable units and add the actions from the perspective of the current player who loads the mission. This will ensure that the current player won't get to see this action on himself for the simple reason that there is no code adding that specific action to the player on his machine. The problem: If a player joins later on or reconnects the method described above will fail because the current player has already initialized the mission. Surely there is the [] spawn {loop ... sleep}-Method but I want to dissociate myself from doing so because I think that the aforementioned method is the least effective in regards of ressources and script logic. Q2: Is there a way to solve this problem? Just thinking about using a PVEH to check if the new player has the action in order to add it gives me the chills... But I won't resist if this is the best solution though. [*]Tasks Using createSimpleTask one can create Tasks which can be assigned to players. This command is labeled as Global in Biki. Q3: What does that mean in this context? Normally you'd execute somethink like:_myTask = player createSimpleTask["myTask"]; This will normally add the task (after additional commands and setCurrentTask) to the player. As the other task-commands seem to be local, does that mean executing createSimpleTask will create that Task on every machine but every player can set the tasks and taskstate for themself without changing the states globally for that specific task? So what happens if someone succeeds or removes a task? Is this broadcasted to every machine or is that local? Sub-Tasks One can assign Sub-tasks to a parent task with the following lines of code: _task = player createSimpleTask["myTask"]; _task setSimpleTaskDescription ["To learn more about Arma Editing", "The Super-Task", ""]; _task setTaskState "Created"; _otherTask = player createSimpleTask["myOtherTask", _task]; _otherTask setTaskState "Assigned"; player setCurrentTask _otherTask; [...] For some reason _otherTask is aligned just under the Parent-Task without any context as beeing the Sub-Task. This could also be a misunderstanding because I never did see a sub-task for myself before but I expected at least some sort of indention to show that _otherTask ist actually a subclass. Q4: What did do I wrong here? I also read that succeeding the parent task will succeed the subtasks automatically, but what does happen when all the sub-tasks are succeeded? Will the parent task succeed when all the subtasks also succeeded? Or do I have to set the parent tasks' state manually? TaskHint I don't know why but calling [objNull, ObjNull, _myTask, "SUCCEEDED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf"; doesn't do anything! There isn't even a script error, nothing happens in particular. Is this supposed to be? I know that there is a taskHint command and it's fairly easy to use, but I wanted to see what this script actually does... Okay then, these were my "common" questions for the problems I encountered so far. I'm sure that I need to ask much more questions after these but this will suffice for the time being. So what am I trying to accomplish? I'm adding some kind of RPG-System into my Chernarus-Mission which is influenced by a game series that is somewhat close to the storyline of the Mod I'm using. If you wan't to know the Mod's name by now, it is... DayZ. I know I know, there are already enough forums dealing with that already but I immersed myself into learning Arma 2 Editing and the actual Mod doesn't really matter at this time. There are several more things I want to know like Camera-Editing and such but I'll read into that before I actually ask some questions as the knowledge base of this particular topic is quite big. Okay folks, that's it for now. I hope you didn't "t/l;d/r"'d my topic and took your time to get acquainted with my chains of thoughts. It's really sufficient if you can deliver a link to the questions so I can look into or just some short sentences which could lead me to the right track. I'm fairly new to this whole business so prepare to get asked more frequently from now on :) In regards, Animus
  16. Okay after some time spent on trying things out I managed to write a simple function which indents the subtasks somehow. The outcome will look like this: I tried to use some cool chars like └ or ├ but these got replaced with a whitespace although I used toString and UTF8 'n shit.... I don't know if this is of any use for you guyz but I'll post the code anyway :) TASKS_fnc_addTask = { private ["_player", "_taskName", "_taskTitle", "_taskDescription", "_taskMarker", "_taskMarkerName", "_taskMarkerPos", "_parentTask", "_taskObj", "_taskParams"]; _player = _this select 0; // The player who gets the task _taskName = _this select 1; // The Task-Name (not the title! Will be used to identify the task) _taskTitle = _this select 2; // Title of the task to show in diary _taskDescription = _this select 3; // Description of this task // Now comes the optional parameters _taskMarker = []; // Array containing Marker-Title and Marker-Position if (count _this > 4) then { _taskMarker = _this select 4; }; _taskParams = [_taskName]; _parentTask = taskNull; // Parent-Task to which this task should be added to if (count _this > 5) then { _parentTask = _this select 5; _taskParams set [count _taskParams, _parentTask]; }; _taskMarkerName = ""; _taskMarkerPos = []; if (count _taskMarker > 0) then { _taskMarkerName = _taskMarker select 0; _taskMarkerPos = _taskMarker select 1; }; _taskObj = _player createSimpleTask _taskParams; if (!isNull _parentTask) then { // Get the level of this child _level = 0; _indent = ""; _parent = _parentTask; while {!isNull _parent} do { _level = _level + 1; if (_level > 1) then { _indent = _indent + " "; }; _parent = taskParent _parent; }; // Insert the indention _indent = _indent + "|- "; _taskTitle = _indent + _taskTitle; }; _taskObj setSimpleTaskDescription [_taskDescription, _taskTitle, _taskMarkerName]; // Add the Destination-Info if there is one if (count _taskMarkerPos > 0) then { _taskObj setSimpleTaskDestination _taskMarkerPos; }; _taskObj; }; Here is the sample Code which leads to the output above: _notSoIMportant = [player, "none", "Nothing to see here", ""] call TASKS_fnc_addTask; _notSoIMportant setTaskState "Failed"; _superTask = [player, "MySuperTask", "Shopping", "I need some stuff from the market!"] call TASKS_fnc_addTask; _breakfast = [player, "breakfast", "Breakfast", "Some stuff for the breakfast", [], _superTask] call TASKS_fnc_addTask; _breakfast_bacon = [player, "breakfast_bacon", "Bacon", "All the bacon you can get. I said ALL!", [], _breakfast] call TASKS_fnc_addTask; _breakfast_bacon_all = [player, "breakfast_bacon_all", "Get 'em all!", "All the bacon you can get. I said ALL!", [], _breakfast_bacon] call TASKS_fnc_addTask; _breakfast_eggs = [player, "breakfast_eggs", "Eggs", "Fetch me 6 Eggs, will you?", [], _breakfast] call TASKS_fnc_addTask; _bbq = [player, "barbecue", "Barbecue", "Let's grill!", [], _superTask] call TASKS_fnc_addTask; _bbq_steaks = [player, "barbecue_steaks", "Steaks", "MEEEAT!", [], _bbq] call TASKS_fnc_addTask; _bbq_lettuce = [player, "barbecue_lettuce", "Lettuce", "Wth?!", [], _bbq] call TASKS_fnc_addTask;
  17. Ahaha yeah, I wondered before why I get animals in my result array x'DD I also thought about using the cursorTarget-approach but wasn't sure if this would be practical, but thinking about it twice it seems to be a neat solution rather than doing all the work for JIP client and synchronizing 'n stuff :) Well now there is still my problem with Sub-Tasks... can someone provide a working script with sub-tasks to a parent-task? I don't know if it's just me or the task display is just supposed to show it like that but I don't have the feeling that my tasks are beeing grouped under my parent task :S I attached an image showing the tasks I created: Is this really supposed to look like this? :<
  18. Well that seems reasonable :) My problem was that if more than one person is in the trigger the other persons stepping into the trigger zone didnt get any message shown. On the other hand I had another trigger which would just attach an action to the person who is in the trigger zone and it did work - but somehow all the other players in the server also did get the action attached to themselfs, so I was somewhat confused. I'll try this and report back :) Okay if I understand this right this will show the Action on the local player if anybody else approaches him - but the action will be shown to the local player, not to the one approaching him, right? I mean the effect of addAction is not global, so the other machines don't know about this action attached to the local player. That's an interesting approach but I see one potential problem here: let's say there is a player near me (<= 3m) I'll get the action added to the local player. So if I choose "Tell me a joke" the .sqf-Script will be executed and 4 parameters delivered - the first two of them containing who activated the Action and on whom the Action is attached. In this case both parameters will be identical because the action is attached to the local player in addition that the local player activated that action on himself, so I loose the opportunity to actually identify the person I wanted to hear the joke from :) Well I could get the player in the script with (getPos player) nearEntities ["Man", 3] but if there are more than one person which met the criteria above it will be impossible to distinct the right person. The scenario with the joke telling is a simple example but I want to know who activated the action on the player in order to process some data - like for example an action in order to steal something from within the inventory: the player approaches another one and chooses "steal something", so I can get the inventory of the player who is robbed and randomly take an item away. Do I misunderstand something here? :< Thanks for the insight, I'll keep that in mind. Actually did you ever use CA\Modules\MP\data\scriptCommands\taskHint.sqf ?
×