Jump to content

vapour

Member
  • Content Count

    38
  • Joined

  • Last visited

  • Medals

Everything posted by vapour

  1. I'm sorry, but I just can't get my head around sqf scripting yet. One day the pieces will fall into place for me, it just hasn't happened yet. This should be very easy for someone to answer. Here's my problem: I can create a light source, but I want it to go out when Light1 gets shot. Where am I going wrong? if (!isServer) exitwith {}; light = "#lightpoint" createVehicleLocal position Light1; light setLightBrightness 0.05; light setLightAmbient[0.2, 0.2, 0.2]; light setLightColor[1.0, 0.2, 0.2]; light lightAttachObject Light1; while {true} do { if {!(alive Light1) then {light setLightBrightness 0.0}; sleep 1; };
  2. In the editor under Objects - Small
  3. Light1 is a Wall Lamp Sorry guys, neither of your suggestions worked.
  4. There's a large wooded sign amongst the placeable empty objects with the stars and stripes on it. Does anyone know if it's possible to script a change of texture for this sign?
  5. Awesome Jelliz - Worked like a charm! Thanks heaps.
  6. Hi I'm having trouble finding anything that explains this clearly enough so that I can get my head around it. I have an example script that I'm not sure if it's going to perform correctly when there's several players in the game. I don't want it turning to custard when there's a dozen of us playing a co-op mission. THE EXAMPLE: I have a couple of scripts that randomly spawn 30 AI enemies and 30 AI friendlies at the beginning of a multiplayer mission. This is to create some good scattered fighting action in a town. The script uses local variables to generate the randomness. It runs great when I test it on my own. If I run this script during a multiplayer game, what actually happens? Does the server run it once and the 60 soldiers appear, or does the script get run once for each client who is playing the game and I end up with 120+ soldiers? Imagine what 720 AI soldiers would be like if there was 12 players! Talk about CPU meltdown. Do I need to make the variables global(public)? Should I be using one the following at the beginning of my scripts?: ? !(local player) : exit OR ? !(local server) : exit If I were to use these, what is actually happenning? Does the "local player" one get sent to each of the clients so that they know the scripts happened and therefore don't repeat the script, or is it the opposite, and that they all go ahead and perform the script indivudually. OR If it's set to "local server", does the server tell each of the clients to perform the script, or does it just do the script once, and all the clients see the result? Any clear and concise help would be much appreciated. THE SCRIPT (If you need to see what I'm talking about): :rolleyes:Please don't laugh at it - this way it makes sense to me. //CREATE GROUPS groupIn1 = createGroup East; groupIn2 = createGroup East; groupIn3 = createGroup East; groupIn4 = createGroup East; groupIn5 = createGroup East; _n=0 _g=0 #LEADERS _n=_n+1 //LEADER GROUP _g=_g+1 ? _g>5: _g=1 ? _g <2 : goto "GROUP1" ? _g <3 : goto "GROUP2" ? _g <4 : goto "GROUP3" ? _g <5 : goto "GROUP4" ? _g <6 : goto "GROUP5" #GROUP1 _group = groupIn1 ; goto "RANDOMPOS" #GROUP2 _group = groupIn2 ; goto "RANDOMPOS" #GROUP3 _group = groupIn3 ; goto "RANDOMPOS" #GROUP4 _group = groupIn4 ; goto "RANDOMPOS" #GROUP5 _group = groupIn5 ; goto "RANDOMPOS" #RANDOMPOS //RANDOM POSITION _x = getMarkerPos "Eastspwn" select 0; _y = getMarkerPos "Eastspwn" select 1; _x = _x+((random 1000)-500); _y = _y+((random 700)-350); //CREATE GROUP LEADER "Ins_Soldier_CO" createUnit [[_x,_y], _group,"",0.8,"Sergeant"]; ? _n<5 : goto "LEADERS" _n=0 _g=0 #SOLDIERS _n = _n+1 //GROUP _g= _g+1 ? _g>5: _g=1 ? _g <2 : goto "GROUPA1" ? _g <3 : goto "GROUPA2" ? _g <4 : goto "GROUPA3" ? _g <5 : goto "GROUPA4" ? _g <6 : goto "GROUPA5" #GROUPA1 _group = groupIn1 ; goto "RANDOMSOL" #GROUPA2 _group = groupIn2 ; goto "RANDOMSOL" #GROUPA3 _group = groupIn3 ; goto "RANDOMSOL" #GROUPA4 _group = groupIn4 ; goto "RANDOMSOL" #GROUPA5 _group = groupIn5 ; goto "RANDOMSOL" #RANDOMSOL //RANDOM SOLDIER TYPE _t = (random 12); ? _t <3 : goto "SOLDIER1" ? _t <4 : goto "SOLDIER2" ? _t <5 : goto "SOLDIER3" ? _t <6 : goto "SOLDIER4" ? _t <7 : goto "SOLDIER5" ? _t <9 : goto "SOLDIER6" ? _t <11 : goto "SOLDIER7" ? _t >10 : goto "SOLDIER8" #SOLDIER1 _type = "Ins_Soldier_1"; goto "RANDOMPOSI" #SOLDIER2 _type = "Ins_Soldier_Sniper"; goto "RANDOMPOSI" #SOLDIER3 _type = "Ins_Soldier_Medic"; goto "RANDOMPOSI" #SOLDIER4 _type = "Ins_Soldier_AT"; goto "RANDOMPOSI" #SOLDIER5 _type = "Ins_Soldier_AR"; goto "RANDOMPOSI" #SOLDIER6 _type = "Ins_Soldier_MG"; goto "RANDOMPOSI" #SOLDIER7 _type = "Ins_Soldier_GL"; goto "RANDOMPOSI" #SOLDIER8 _type = "Ins_Soldier_2"; goto "RANDOMPOSI" #RANDOMPOSI //RANDOM POSITION _x = getMarkerPos "Eastspwn" select 0; _y = getMarkerPos "Eastspwn" select 1; _x = _x+((random 1000)-500); _y = _y+((random 700)-350); //CREATE SOLDIER _type createUnit [[_x,_y], _group]; ? _n<24 : goto "SOLDIERS"
  7. Wow! Fantastic information guys. Things are now a lot clearer and starting to make sense to me. Not crystal, but the fog is deffinitly being cleared.
  8. Hi everyone Can someone please tell me where I've gone wrong with this script. I want all the AI, both enemy and friendly, who are in an area around marker "AreaCentre" to move to marker "fobtrig". The script triggers okay, as there are other bits before this bit in the script that run great, but this bit doesn't. I know it's probably dead simple, but I'm pretty thick when it comes to this stuff. Area1 = createTrigger ["EmptyDetector", [getMarkerPos "AreaCentre"]]; Area1 setTriggerArea [700, 500, 0, ellipse]; {_x doMove getMarkerPos "fobtrig"} forEach list Area1; Thanks in advance.
  9. Geez! :p I must have been way asleep to miss that one! In the end it was: this animate ["dvere1",1] Thanks heaps for the help!
  10. Does anyone know how to get a mission to start with building doors shut? I've added barracks and sheds and such to a mission. By default they have their doors open. I want them to be shut. I've searched lots of forums and tried all the different scripts that are suggested, but nothing works for me. By rights it should be : Barrack1 animate ["door1", 0] I've tried all sorts of things in place of "door1", such as "dvere1", "door", "doors", "doors1", "door2", "door01", "door02", "dvere", etc . . . I even tried using the gamelogic to set the building as a an id number, but still no luck. It should be such a simple thing, but I must be missing the obvious.
  11. I have an issue when a parachute landing takes place on top of an object that places it above ground level. In this case on top of a castle tower. The chute can not be packed away, because it still believes it's in the air I guess. The difficulty that it causes, is that it blocks the stairwell exit from the top of the tower. The para-jumper can do a skilled landing on top of the tower, but then he has ended up trapping himself up there. What I need to know is, is there a script that would be able to remove the used parachute? Even if I could attach the script to a radio button, so that if the problem occurs, all I need to do is use the radio commands to "Clear Chute".
  12. Thanks heaps LoyalGuard, you're the best!
×