Jump to content

A-SUICIDAL

Member
  • Content Count

    520
  • Joined

  • Last visited

  • Medals

Everything posted by A-SUICIDAL

  1. It's hard to explain an example of this. I have a punish script that when you kill a friendly unit or civilian it executes a script that punishes the player, and lets say that I just accidentally killed 3 teammates. I want to then execute a script that actually punishes the player and does a bunch of stuff, but I do not want the script to run multiple times, in this case 3 times for each of the 3 teammates that were killed. I tried adding a counter that first counts the kills, then pauses for a second and then executes a script based on the counted kills being >0. And then after the punish script finishes it sets the kill count back to 0 again. But so far I can't even get this to work. So I figured that I need to try a different method, but I first wanted to find out what other methods might be possible. So is it possible, once a script starts running, to prevent the same script from running again until the original script has finished? Basically prevent 1 script from running multiple times. So if I kill 3 teammates, it then executes only 1 punish script. My punish script is working great, but there are times when I kill more than one teammate with something like an explosion where the punish script then runs multiple times and just seems freaky.
  2. Well, that sounds pretty tricky, but not completely undo-able. I wasn't sure so I messed around a bit and managed to make a radio1 and a radio2 and they both mirror each other, so if you turn one radio off, they both turn off, and they both play the same track at the same time. I actually had fun with this. I guess you could make as many radios as you want with my script, but at a certain point I would imagine that it might start getting a little weird. I made another sample mission that has 2 radios in it. You start out near "radio1" and then you can hit 0-0-1 to attach it to the front of your ATV, then you drive a about 100 meters and hop out near a chopper and then hit 0-0-2 to attach the radio to the right side door of the chopper, then you fly to the end of the airstrip, land and get out and you will see "radio2" sitting on another crate. when the 2 radios are close to each other, it starts sounding like a bad trip because the radios are never perfectly in sync with one another, but if you turn one radio off, they both turn off, and then when you turn it back on, both radios start playing in sync. They radios always stay close to being in sync, they only fall out of sync a little bit whenever you move around fast and cause the pitch to drop or increase. Sample Mission with 2 Radios suicidals_radio_x2.zip I would suggest maybe using at most 3 radios, but keep them very far apart. You could either have all 3 radios accessible, or you could hide one in a wall if for some reason you might not want anybody using it. You can see in my new sample mission how I have it set up to work with 2 radios and from there you should be able to figure out how to make a 3rd or a 4th radio. You can also see how I have 0-0-1, 0-0-2, 0-0-3 radio triggers that repeat, so you can attach the radio to a car, then attach it to a chopper, then attach it back to the car again, then attach it back on top of the crate. the 3 numbers that you adjust to attach the object are fun to play around with. For the ATV, I attach the radio using... radio1 attachTo [atv1, [0,+0.84,-0.48]]; if you are sitting on the ATV... 0 = left and right adjust. +0.84 = forward and back adjust. -0.48 = the height adjust. You could even go as far as to attach the radio your body and have it detach if you die, lol. If you add a radio to a chopper, when the track changes it might suddenly sound very low volume, I think the chopper engine takes priority, so just make sure to start a new track first, then start your chopper engine. I had a blast testing it with the ATV.
  3. They were oroginally: Vorbis, 22050Hz, 45kbps, (0.4q), mono. I just changed the quality to: Vorbis, 16000Hz, 56kbps, (0.4q), mono and re-uploaded the file. I included 2 MP sample missions so people can see the file size for themselves and test it easier without having to open and save it in the editor. I could actually go lower on the quality if needed. I don't really know what is considered a large file size when it comes to missions. I also don't understand why it takes so long to connect to a server and download a mission that is only a few KB is size when I have a 60 down and 10 up connection. I removed 2 tracks, "Prisoner" by Iron Maiden and "She's not there" by The Zombies and I changed the track order and made sure all the sleep times were correct. So now after track 8 it will cycle back to track 1. The files size is now 9mb. I tested it and it still sounded decent, much like a PA system you would hear on an old episode of MASH, lol. I like all the songs in the playlist, but honestly, being that I am an ex- death metal rhythm guitarist and spent 8 years in a magnet band banging my head against marshall stacks, my playlist would normally be full of a lot more ear bleeding titles, but I tried to pick what I thought would work for everybody. It would have been nice to throw in some "Back in Black" and "War Pigs". Maybe next time.
  4. Ok, so I had trouble trying to get this working the way you suggested, only because I lack some understanding, but I am certain that your method would have worked great. After many hours I put my new attempt aside and went back to my original fail example and managed to get it working on a dedicated server. I did keep in mind that you had mentioned in your first reply - that I would need to "broadcast a PublicVariable to everybody and launch the radio on the client that activated it", which sounded confusing to me, so I did what comes natural to me and I made it even more confusing - and I tried to do exactly what you said, but "in reverse" lol. I tried to figured out a way to have a client activate it automatically or manually through actions and then PV it to all other players, without using any event handlers. I used my usual poor-mans ghetto scripting abilities, lol, and I actually got this to work. Well, at least so far I haven't hit any big bumps. I tested it on my own dedicated server(the same crappy computer I edit from). I posted a new topic basically releasing it as a stand alone "Song Playlist PA System". I thought it might get buried here under this thread that started out as a fail. Here's the link: Adding a "Song Playlist PA System" Radio to your Base
  5. I created a sample mission of a PA System for my base. I placed a radio (small object) then I added an action to it "Turn on radio" and it plays a sound file by attaching an invisible helipad to the radio and then using "say3D" to make the invisible helipad play the sound. When the the player chooses the action "Turn on Radio", the action is then replaced with a new action "Turn off radio". When the player choose "Turn off radio" the invisible helipad is deleted, which stops the sound from playing and I then use "terminate" command to completely exit the script that plays the music since it uses sleep timers that would need to be stopped. Each time the player turns the radio "on" a new sound plays. There are 10 music sound files in total, each one was saved as a 22050Hz, 45kbps, mono ogg to keep the file size small and yet it still retains good quality - considering that PA systems usually do sound mono and low in quality. The idea behind this is... to have some sort of PA system at base that plays through a list of 10 music sound files and then loops back to the beginning of the list. If players do not want to hear it, they can turn the radio "off", or if they want to hear a particular song for the moment they are at base, they can cycle through the list of songs fast to get to the song that they want to hear. Basically the radio is meant to be turned on and left alone to do its own thing. Each song has a sleep timer that is matched to the song length. In testing in single player (editor preview) and a hosted environment, everything seems to work as it should, but when I launch a dedicated server from my computer and then connect to it and launch the sample mission, the action to "Turn on radio" appears, but when I then perform the action, nothing happens and the action "Turn on radio" still shows when it was supposed to play a song and be replaced with the action "Turn off radio". So basically the radio never turns "on" at all on a dedicated server and I can't seem to figure out why. I was hoping that somebody could help me get this to work on a dedicated server. It is a cool feature to add to any mission. Battlefield Vietnam had the same kind of PA System featured in the game at base. In the sample mission, the radio object appears on a small pole, which looks lame, but I planned to have the radio appear on a wooden crate in the final version. I also planned to use different music and possibly extend my song list to have more than 10 songs. I in no way take any credit for the music used in the sample mission. Here's a sample mission: radio_test.Takistan.zip init.sqf: description.ext: sound\sound.cpp: radio\radio_on.sqf: radio\radio_off.sqf: radio\radio_playing.sqf: radio object init: I left the sample mission running and I fell asleep and when I woke up it was still playing through the song list.
  6. In my mission the leader can deploy a Rally Point, which is used so other players can teleport to the Rally Point from base flag. When the Leader chooses the action to deploy the Rally Point, a dialog appear asking "Deploy Rally Point?" with "Yes" and "No" choice buttons to choose from. This prevents the leader from accidentally choosing the action to deploy the Rally Point in an area that he or she would rather not have, which is very helpful considering that there is also a 10 minute wait time before the leader can deploy a new rally point. I have already added a system that checks to make sure certain conditions are met before the Rally Point can be deployed. These are as follows: if (alive s1 and rallyCountdownActive) exitWith { hint rallyTimerMsg; // for example "Rally Point Unavailable (line break) 00:08:42 remaining before a new Rally Point can be deployed." rallyDeployAttempt=false; publicVariable "rallyDeployAttempt"; }; if (((getPosATL s1) select 2) >1) exitWith { hint "You must deploy the Rally Point at ground level."; rallyDeployAttempt=false; publicVariable "rallyDeployAttempt"; }; if (s1 distance base_center <500) exitWith { hint "You cannot deploy the Rally Point within 500 meters of base."; rallyDeployAttempt=false; publicVariable "rallyDeployAttempt"; }; _list= position s1 nearObjects ["ALL",5.5]; if (count _list > 1) exitWith { hint "There are objects or players in the way. Find a clear 6 meter radius to deploy the Rally Point."; rallyDeployAttempt=false; publicVariable "rallyDeployAttempt"; }; So my problem is... sometimes when I choose to deploy the Rally Point, it tells me that there are objects in the way, when there are not, at least nothing that I can see other than myself and some grass. So I want to check for specific object types, but I am not sure what I should add to the list of objects types to check for, or if maybe the check should be done using some sort of array. There have been other times when there were objects within 6 meters of my position, like a long wall for example, and yet it did allow me to go ahead and deploy the Rally Point, which also didn't make much sense to me. Lastly, I wasn't sure if maybe I should be checking for any other conditions, but if you can think of anything I have left out that I should be checking for, please let me know. Sorry for the long explanation, I just want to get this working perfectly.
  7. I'm sorry to dig this topic up after it's been more than a couple of months, but I am having this same exact problem. For some reason I cannot get this to work on a dedicated server. This is the only thing that protects my base from damage. protected_zone.sqf //spawn at markers pzone1 - pzone10 _pzone1 = "ProtectionZone_Ep1" createVehicleLocal (getMarkerPos "pzone1"); _pzone2 = "ProtectionZone_Ep1" createVehicleLocal (getMarkerPos "pzone2"); _pzone3 = "ProtectionZone_Ep1" createVehicleLocal (getMarkerPos "pzone3"); _pzone4 = "ProtectionZone_Ep1" createVehicleLocal (getMarkerPos "pzone4"); _pzone5 = "ProtectionZone_Ep1" createVehicleLocal (getMarkerPos "pzone5"); _pzone6 = "ProtectionZone_Ep1" createVehicleLocal (getMarkerPos "pzone6"); _pzone7 = "ProtectionZone_Ep1" createVehicleLocal (getMarkerPos "pzone7"); _pzone8 = "ProtectionZone_Ep1" createVehicleLocal (getMarkerPos "pzone8"); _pzone9 = "ProtectionZone_Ep1" createVehicleLocal (getMarkerPos "pzone9"); _pzone10 = "ProtectionZone_Ep1" createVehicleLocal (getMarkerPos "pzone10"); //make them invisible to eye _pzone1 setObjectTexture [0,"#(argb,8,8,3)color(0,0,0,0,ca)"]; _pzone2 setObjectTexture [0,"#(argb,8,8,3)color(0,0,0,0,ca)"]; _pzone3 setObjectTexture [0,"#(argb,8,8,3)color(0,0,0,0,ca)"]; _pzone4 setObjectTexture [0,"#(argb,8,8,3)color(0,0,0,0,ca)"]; _pzone5 setObjectTexture [0,"#(argb,8,8,3)color(0,0,0,0,ca)"]; _pzone6 setObjectTexture [0,"#(argb,8,8,3)color(0,0,0,0,ca)"]; _pzone7 setObjectTexture [0,"#(argb,8,8,3)color(0,0,0,0,ca)"]; _pzone8 setObjectTexture [0,"#(argb,8,8,3)color(0,0,0,0,ca)"]; _pzone9 setObjectTexture [0,"#(argb,8,8,3)color(0,0,0,0,ca)"]; _pzone10 setObjectTexture [0,"#(argb,8,8,3)color(0,0,0,0,ca)"]; For anybody that does not know what this does exactly, it basically prevents any kind of damage from being done within a 50 meter radius of the object. Placing a bunch inside your base, about 25 meters distance apart, will protect your base from anything from bullets and c4, to artillery and plane crashes. Basically it protects your base from idiots. I read somewhere that it needs to be run on each client, so what would be the best way to do that? I haven't been able to test this further, but this is what I am guessing... init.sqf (wrong?): if (isServer) then { null = [] execVM "protected_zone.sqf"; }; init.sqf (would one of these be correct?): [player] execVM "protected_zone.sqf"; [] execVM "protected_zone.sqf"; execVM "protected_zone.sqf";
  8. Yeah, that was the first thing I tried, but it didn't seem to work. I thought that maybe it was because the guy sitting in the passenger seat was never actually assigned to the cargo of the vehicle. But I think once he is forced out of the vehicle, he then suddenly becomes assigned to the vehicle somehow. Maybe that's why ai commanders are always telling me to get back in a vehicle that I just hopped in-and-out of for a moment - with no intention of getting back in. Anyway, I tried again to use the script that you suggested and now suddenly it seems to be working. I'm guessing I must have made a typo the first time around because the script you posted looks identical to what my first attempt looked like. This seems to be working fine. There's actually almost no delay between the pilot leaving the vehicle and the passenger automatically switching to his seat. So that's good. I might try to use this for my other choppers in the event of the pilot getting shot and killed. I mean come on, in real life, if a blackhawk pilot gets shot and killed, you can bet your ass somebody is going to take his seat fast. Some how I can't picture a bunch of guys in cargo just saying F-it, lets just go down with the ship. Or maybe a script that ejects all crew in the event that the pilot died, nah, I like the first idea better. waitUntil {s1_inJail}; _list = assignedCargo littlebird1; _unit = _list select 0; unassignVehicle _unit; doGetOut _unit; sleep 1; _unit assignAsDriver littlebird1; [_unit] orderGetIn true; _unit moveInDriver littlebird1; littlebird1 engineOn true; Thank you Mattar_Tharkari :)
  9. I'm still working on this. I got sidetracked a little, but I'm still on it.
  10. Wow, thank you! I really appreciate all the help. It's extremely generous of you to take the time out to script all of this and also explain everything in great detail. I'm going to work on this now and do my best to get it functioning correctly. I downloaded Celery's Jukebox 2 days ago and looked through his scripts a bit and I figured that it wouldn't fit my needs since his Jukebox uses music.cfg and not sound.cfg, but I do remember seeing that he had all of his tracks and times in one long array similar to how you demonstrated above. The one thing that struck me was - that Celery's script featured a sort of pause/resume ability that prevents the music from skipping ahead when the player hits the escape key or pauses the game. From my experience, a sound file currently playing in the game will normally keep playing even when the player hits escape. If I have a sound file playing in single player and I hit escape, the game pauses, but then when resume the game, it's as if the sound file not only continued to play while the game was paused, but it actually seems to have fast forward a little bit too. If I keep hitting escape and pausing and resuming the game many times in a row, the sound file seems to keep skipping far forward and finishes playing much sooner than it normally would have. I don't think I need to worry about that too much since I am trying to get this working on a dedicated. I'm mostly worried that if I use random, some songs might play twice in a row, which would seem weird. Or you might hear track4 play three times in a 20 minute period of time and other songs haven't even had the chance to play yet. I figured if I stuck to playing the songs in a set order, then at least each song would have a fair chance to be heard. Allowing players to cycle through the songlist fast was really not important, but I just figured that it would be a cool additional feature. Also, I read somewhere that there is an actual PA speaker object that could be seen in the campaign. I'm guessing on the carrier. I've never seen one before, but if it does exist and there is a classname for it that I could spawn, it would look much nicer than the tiny white radio from Giligans island that I feel stuck with, lol. If anybody knows anything about a PA speaker object, let me know.
  11. Well, I'm not currently using CBA. I'm trying not to use any addons at all for the mission that I am currently working on. Actually, this sample mission is in Takistan, but the real mission I want to add this to uses the Island Faysh Khabur by =KCT=BlackMamba, which is the only addon required so far. I'm not sure if you and =KCT=BlackMamba are the same guy, but if you're not, I am still very much appreciative to both of you, for both the island, and the advice you just gave me. I wish I had a better grasp for scripting. I guess at this point I can't really say that I am new to scripting, but I still feel a newb. I now get to try to learn how to use addPublicVariableEventHandler for the first time, which should be a fun learning experience, I just wish I could sit down in a classroom and have somebody teach it to me rather than have to google my brains out looking for any example I can find to school myself on how it use it correctly. I only just yesterday launched a passworded dedicated server for the first time from my computer, but only for script testing purposes. I have no plans to use the server to play a full mission with others. I launched my game from the same computer and connect to the server. Does the dedicated server treat me like anybody else that joins the server? or does it see me as some sort of host like player since I'm joining the dedicated server from the same computer? I noticed that a lot of my scripts did not work in my mission, so little by little I have been making changes to get everything working as it should. This radio PA system is something new that I started working on 2 days ago. I had a small radio in base playing some terrible Arab music that came with the game and for the last month or so of testing my mission, the radio music has really been getting on my nerves, so I wanted to do something to replace it. I remembered playing Battlefield Vietnam a million years ago and I loved how they had a PA system at base that played Hendrix and stuff, so I just wanted to some how add something similar to my mission. I'm rambling. I'm still a very confused, but I will do my best to learn how to use a PVEH and implement what you suggested. Thank you.
  12. I know I am a bit late, but here's another good link for HALO: http://www.kylania.com/ex/?p=94
  13. First I just want to thank you for the omg amazing help you gave me. Very impressive stuff. I'm testing it now. I'm not sure what "cl_r" and "pow" are. I'm guessing that cl_r is some kind of rock and pow probably works for power line poles, power generators, power plants, power stations etc. I created a test mission and placed 1 man named "s1" and a functions module. I added a repeat trigger radio juliet to activate a shortened version of the script. null = [s1] execVM "deploy_rally.sqf"; I created an init.sqf and put this in it: FNC_instring = compile preprocessFileLineNumbers "instring.sqf"; I created an instring.sqf file and copy and pasted exactly what you had above. Then I created a deploy_rally.sqf and only added this to it: _return = false; _clutter = str nearestObjects [s1, [],8]; { _return=[_clutter,_x] call FNC_instring; } foreach ["t_","b_","r2","cl_r","pow"]; if !(_return) then { hint "Area clear. There are no trees, bushes, rocks in the way. That goes for whatever cl_2 and pow are too. Deploying Rally Point..."; } else { hint "The area is not clear. There are trees, rocks or bushes in the way. Find a clear 8 meter radius to deploy the Rally Point."; }; Finally I previewed it and ran up to bushes, trees, rocks, power line poles and activated the trigger and it always told me that the area was clear when it was not. So I'm not sure what I am doing wrong. ---------- Post added 01-23-2013 at 01:21 AM ---------- Previous post was 01-22-2013 at 11:28 PM ---------- I just noticed when trying to use this... _list = nearestObjects [s1, ["Thing","AllVehicles","building"],8]; ...to detect if a building was within 8 meters of the player - that on most occasions it would not detect big buildings even if I was standing right up against the side of a building, but if I entered the building and stood in the center of it, it would then detect that the building was within 8 meters. It's almost as if some big buildings have a detectable radius no bigger than a skinny pole. I thought I could detect the actual collision points of the buildings, but instead I only seem to be able to detect the most central placement position of most big buildings. I still can't get it to detect the trees, bushes etc.
  14. I tried what you said and used: _list = nearestObjects [this, ["Thing","AllVehicles","building"],8] .. and it works great. Thank you so much. As far as writing a function to look for specific letters, I don't know how to do that. I didn't even know that was possible. Trees and bushes are the only things left that might cause problems. Large rocks might be a problem too, but I don't think it would be possible to detect whether a rock is tiny or very large. Obviously tiny rocks shouldn't cause any problems. Is there a sample script somewhere that I could study that shows how to write a function that looks for specific letters? It would be nice to add trees and bushes to the list.
  15. Clutter cutter would probably not help much except to maybe make clearing after the Rally Point has been deployed. I was just looking at the wiki for "nearEntities" and I thought maybe that might be an option, instead of using "nearObjects". One of the wiki examples looked like this: _list = (position player) nearEntities [["Man","Air","Car","Motorcycle","Tank"],200]; Maybe remove "Man" and add to it "House", "Tree". Rocks might not be a good thing to detect for since I wouldn't want a tiny rock to prevent the player from deploying the Rally Point, you also said that it won't find rocks anyway, so I guess trying to detect a rock nearby is pointless. ---------- Post added at 01:26 PM ---------- Previous post was at 12:15 PM ---------- So far this seems to work, but it doesn't detect most editor placed objects that are in the way, like tents, ammo crates, H-Barrier walls. I also would like it to detect if trees are in the way. Is there any possible way to detect these things? I set the detection radius a little bigger since the Rally Point was colliding with some tanks after it was deployed too close. _list = nearestObjects [s1, ["House","Air","Car","Motorcycle","Tank"],8];
  16. Yeah, I figured that. What object types should I be checking for? I figured buildings, but I also do not want rocks, trees, bushes in the way either. Players can be in the way, that shouldn't matter much. But what else should be added to the list that I'm not thinking of and where can I find a list of object types so I can add the exact names for these things?
  17. Yeah, bottom left works great. I got it to remove all the grass at my base. Now my base doesn't look like it an abandoned outpost that has not be well maintained. This is a good script. Thanks again.
  18. waitUntil {not(isNil "BIS_fnc_init")}; worked! but I still can't get it to use the correct angle of 300. It seems to want to face north 0 degrees. ---------- Post added at 07:10 PM ---------- Previous post was at 06:53 PM ---------- Like you mentioned earlier, I would need to make it much bigger to cover the area. I'll play around with it a bit and see if I can get it to at least cover the base area enough that it gets the job done. I very much appreciate the help you've offered me. Thanks F2K Sel :)
  19. ...yes axis a: 45 axis b: 87 angle: 300 shape: rectangle trigger name: trig1 activation: none condition: this Invisible Helipad name: Hcutter init: null=[Hcutter,45,87,trig1] execvm "cutter.sqf" ---------- Post added at 06:51 PM ---------- Previous post was at 06:32 PM ---------- and I just added a functions module, still no luck. Anything else I might be missing?
  20. I tried the first script and it worked well. I used an invisible helipad as the object and placed it in the center of the base area. It worked, but it did not use the same direction that the invisible H was pointing in, which was 300 degrees. I will try your second script now that uses a trigger. ---------- Post added at 06:19 PM ---------- Previous post was at 06:02 PM ---------- I placed a trigger 45 x 87 at an angle of 300 and named it "trig1". I placed and invisible helipad named "Hcutter" in the center at an angle of 300 - right on top of the trigger. In the init of the invisible helipad I put: null=[Hcutter,45,87,trig1] execvm "cutter.sqf"; Then I used your script: cutter.sqf: _start = getpos (_this select 0); _xpos = _this select 1; _ypos = _this select 2; _trig = _this select 3; for [{_xx = 0},{_xx < _xpos},{_xx = _xx + 10}] do { for [{_yy = 0},{_yy < _ypos},{_yy = _yy + 10}] do { _newpos = [(_start select 0) +_xx,(_start select 1)+_yy,0]; if ( [_trig, _newpos] call BIS_fnc_inTrigger) then { veh = createVehicle ["ClutterCutter_EP1",_newpos,[], 0, "can_collide"]; };};}; But it didn't work. I didn't see any change and I received no errors.
  21. I'll try it. The base is very flat. When trying to spawn enough clutter cutters to cover my base, it took 153 of them. 9 collums by 17 rows, each clutter cutter is 1 grid square away from the next. At mission start the grass is removed. There is a nasty bit of lag while it removes the grass. It would be so much easier if there was a way to remove the grass within a trigger radius some how, without having to add a ton of ugly markers to my base. At least I made the markers 0.5 x 0.5 in size and colored them white named ng1 - ng167 (ng for "no grass").
  22. It must have some sort of reference name or something.
  23. Yeah, it works, but in order to clear the grass within the base, which is a 45x86 rectangle area, I would need to place about 100 markers and then spawn a ClutterCutter_EP1 at each marker position. Where can I find the class names for the different types of grass? at missions start: grass_count = 0; then run some kind of script like this: while {grass_count < 1} do { _object_grass = (getMarkerPos "respawn_west") nearObjects 150; {if (_x isKindOf "GRASS_CLASSNAME") then {sleep 0.1; deletevehicle _x}} forEach _object_grass;}; grass_count = grass_count + 1;
  24. Thanks, I will try to spawn them at marker positions and see if it works.
×