Jump to content

DChristy87

Member
  • Content Count

    111
  • Joined

  • Last visited

  • Medals

Everything posted by DChristy87

  1. Okay, so I have a script run from a player. It creates an enemy patrol at a randomly selected game logic and puts a marker on the players map. For some reason, deleteGroup isn't working for me now. Here's my script: _unit = _this; sleep 20; _apos = [posA,posB] call BIS_fnc_selectRandom; _rSound = ["RadioAmbient8","RadioAmbient6","RadioAmbient2"] call BIS_fnc_selectRandom; _eArray1 = ["O_Soldier_SL_F","O_Soldier_GL_F","o_soldier_f","o_soldier_f","O_Soldier_AR_F"]; _eArray2 = ["O_Soldier_SL_F","O_Soldier_SL_F","O_Soldier_SL_F","o_soldier_f","o_soldier_f","o_soldier_f","o_soldier_f"]; _eArray3 = ["O_Soldier_SL_F","o_soldier_f","o_soldier_f"]; _eArray = [_eArray1,_eArray2,_eArray3] call BIS_fnc_selectRandom; _pos = getPos _apos; _side = createCenter East; _grp = creategroup East; _grp = [_pos, EAST, _eArray] call BIS_fnc_spawnGroup; [_grp, _pos, 45] call bis_fnc_taskPatrol; hint format["Enemies have been spotted! \nCheck your map for their location.",_unit]; _marker1 = createMarkerLocal ["Marker1", getPos _apos]; _marker1 setMarkerTypeLocal "o_unknown"; _marker1 setMarkerColorLocal "ColorOPFOR"; _marker1 setMarkerTextLocal "Enemy patrol!"; _marker1 setMarkerSizeLocal [1, 1]; playSound _rSound; sleep 20; deleteGroup _grp; deleteMarkerLocal _marker1; _unit execVM "sideMissions.sqf"; As you can see I have short sleep times just for testing. The script creates a group, makes them patrol, waits 20 seconds and then is supposed to delete the group and start over again. The marker is deleting, but not the group. Any ideas why it's not working? NOTE: the deleteGroup WAS working before I added the _eArrays to randomize the group that spawns. But that shouldn't effect the group being recognized as "_grp" and preventing the deletGroup from working.
  2. Hmm, I appreciate the tip. I'll have to look into finding out how to run scripts on the server vs otherwise. I'm still a noob and trying to to figure all that out.
  3. That did it! Thanks kylania! (deleting the group only 20 seconds after it was created was for testing purposes) I plan to have it sleep 500 + random 400; or something but I can't wait that long just for testing it :)
  4. DChristy87

    Help with addAction on Player?

    Heh! That did it! Can't believe that was it. Code certainly is unforgiving. Good catch, and thanks a lot for your help!
  5. I'm trying to create an addAction to the player only if he picks up a radio and it's in his assigned items...I'm using code based from here:http://forums.bistudio.com/showthread.php?125141-adding-addAction-if-player-has-item-(bribe-function) Heres what I have in my players init field in the editor: this addAction ["Action!?", "action.sqf", [], 1, false, true, "", " ""itemRadio"" in (Assigneditems _this)"]; But no action options pop up once I pick up the radio! Any ideas what I'm doing wrong here?
  6. Hey kylania, any chance you know if it's true or not if they plan to bring back the switch sides module?
  7. I think BI had a module for switching sides but they took it out, I read somewhere that they would include it in the final release?? I have a similar situation with switching factions, I hope they do bring it back. I guess we'll find out September 12th.
  8. DChristy87

    UPSMON for arma3

    Ollem, did some brief testing with your updated version and a civilian and I haven't received any _surrender errors. He walks the area just as desired :) Thanks Ollem!
  9. I'm trying to create a simple AI spawning script. I want the AI to spawn when a player gets within a 200 meter radius of a game logic. I create a game logic and put this in the init field: nul = this execVM "test.sqf"; test.sqf: _AISpawn = _this; _pos = getPos _AISpawn; _list = _AIspawn nearEntities ["Man", 200]; _players = []; waituntil {!isnil "bis_fnc_init"}; while {true} do { { _players = isPlayer _x }forEach _list; _cnt = count _players; while {_cnt > 0} do { _side = createCenter East; _grp = creategroup East; _grp = [getPos _pos, EAST, ["o_soldier_f", "o_soldier_f"]] call BIS_fnc_spawnGroup; [_grp, getPos _pos, 45] call bis_fnc_taskPatrol; }; }; I get an error on line 17, "type bool, expected array" Any ideas? ---------- Post added at 18:02 ---------- Previous post was at 17:58 ---------- Nevermind, I'm an idiot. I had to put [] around _players: ---------- Post added at 18:15 ---------- Previous post was at 18:02 ---------- Ehh, I also had to change the BIS_fnc_spawnGroup and the taskPatrol lines to this: BUUUUUUT now my mission freezes up... lol. I've found out its because its spawning more and more of the groupSpawns :confused:
  10. Nice, that explains a lot! I'll be reading over the wiki link several times, I'm sure. Again, I appreciate all the knowledge passed my way! "Faster booty calls through functions!" - Now THAT really made some sense to me!
  11. Nice man, That helps a lot with my understanding of how a function itself works. I guess what I really don't understand is when you create a function like that "CHR_fnc_spawnGroup"... where it, itself, is placed (like do you define it in the init.sqf?) Also, when you use something like how it knows to get to the "CHR_fnc_spawngroup" without being referred to an actual .sqf file. Like, really whats the difference from creating a "CHR_FNC_WHATEVER" and just calling an sqf (in Arma Edit, it refers to .sqf as a "function file") so why not just use that? Sorry if I'm hard to follow. It's just hard for me to wrap my head around it. :confused:
  12. Thanks fellas. Kylania, You're right, of course, when I managed to hit esc and break out of the loop I saw a hundred or more AI all spawned on the game logic. I appreciate the guidance as usual Kylania! I'll try and come up with something as you suggested to make it only happen once. Johnson, I see your brother was in the Marine Corps. I was stationed in Camp Lejeune with 1/9 for a few years and 3/9 for the rest of my enlistment. I appreciate the sacrifice your brother and your family made, Semper Fi.
  13. I do appreciate the tip Johnson. However, I am aware of the modules and the few out of date tutorials for using them. I'm really just trying to learn scripting, and just hoping for some help along the way.
  14. DChristy87

    Scripting and locality?

    That's a really nice touch there Kylania, I like that :)
  15. DChristy87

    Enemy occupation system (eos)

    I was actually wondering if it would be..unethical?... to use the patrol_VD and patrol_ED sqf files from this handy script http://www.armaholic.com/page.php?id=19832 with EOS. I really like the spawn system and AI reaction from EOS but I really love the patrolling from the AI spawn script. Would anyone have any idea how to implement those into EOS?
  16. DChristy87

    Enemy occupation system (eos)

    Make sure you have a unit that is a player (the editor won't allow you to create a game logic or empty object without establishing a unit as a a player) then create a new unit (same way you created your player) but change the "Side" to "game logic" then just name the game logic "server".
  17. DChristy87

    Enemy occupation system (eos)

    Is there a way to change the waypoints given to the spawned groups? In my mission it seems like each group that spawns migrates towards North East. My goal is to have them kinda linger in a smaller area, even if I make the marker smaller, they still set their patrol waypoint to the northeast and leave the marker area. Am I doin something wrong?
  18. I'm currently trying to create a script that will allow me to place a civilian "informant" if you will... Basically a civilian you place in a town that if he sees a blufor unit, he will send that information along to the opfor team (a marker on the map?) I'm stuck in the very beginning...I know...I'm a noob. Can anyone give me a nudge along? I have: _spy = _this select 0;//the civilian unit _potential = _spy nearTargets 100;//all near units _pos = _potential select 0;//position of units _side = _potential select 2;//side of units The next step I think i need to take is to find out which units in _potential have a _side == "WEST" and put that in a new array (lets call it _knownEnemy) and then reveal to opfor each _knownEnemy. Amidoinitright? But how do I get each _side that is == "WEST" and extract that into a new array? ---------- Post added at 16:02 ---------- Previous post was at 15:48 ---------- This is my lazy attempt to explain what I would imagine the script would kind of go towards...I know the syntax is wrong and all but is this the right direction? Are there any scripting commands I should look into?
  19. Alright! Thanks again Kylania!
  20. DChristy87

    UPSMON for arma3

    I'm getting the same error, I have UPSMON running on a civilian too Ollem. I hope this helps!
  21. So I have this? { deleteMarkerLocal _x; } forEach inPlayMarkers; inPlayMarkers = []; ---------- Post added at 18:05 ---------- Previous post was at 18:02 ---------- Oh, and do you think it would be possible to fine tune this so a marker only displays if the spy actually sees him and knows about him? I can't be sure if this is what's happening or not but in testing this a marker displayed even though I stood behind the spy.
  22. Thanks for all of your responses, I've learned a few more things today! Kylania, I've added this: to the very bottom to have it update every 10 seconds. Other than that, it works amazing, As always, you're the man Kylania! BTW this is what I had going before you posted that, and it wasn't working, of course:
  23. Thanks for the tips everyone! The responses you all gave are very much appreciated! :)
  24. Has anyone tried all of these? If so, do any of you have any opinions on which might be the best? the AI Spawn Script I'm referring to is found here:http://www.armaholic.com/forums.php?m=posts&q=21499&d=0 I'd like to know which are less riddled with errors (hopefully error free, or kept current with updates to prevent errors). Also, which might have the most features/customization/and just overall more useful? In short - just which one is the overall best and if you have the time, why?
×