Rejn 0 Posted April 30, 2007 Im sure this has been asked before but couldnt find anything specific under radius or marker + radius... Im looking to create a marker with a name and use the position of an object such as the player with a random placing in a radius of 200... Can anyone help me? The command I was looking at is: marker= createMarker [Marker1, position player ] In createvehicle I could alter the radius but Im not sure about how to go about it with createmarker. Thankyou for any help D: Share this post Link to post Share on other sites
Rejn 0 Posted April 30, 2007 Alternativly Could someone tell me how to create a game logic via script? I basically want the same deal: Create gamelogic at poition object with a placement radius of 200 I also want to know how to delete said gamelogic if your not using createvehicle/unit Thanks. Share this post Link to post Share on other sites
fasad 1 Posted April 30, 2007 To select a location at a given radius from a position : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_position = [x,y,z]; _distance = 200; _angle = random 360; _newPosition = [(_position select 0) + _distance*(cos _angle),(_position select 1) + _distance*(sin _angle), _position select 2]; to create a gameLogic, use <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"logic" createUnit ..... to delete anything use deleteVehicle Share this post Link to post Share on other sites
Rejn 0 Posted April 30, 2007 I tried using : _position = [x,y,z]; (I changed this to _position = player) _distance = 200; _angle = random 360; _newPosition = [(_position select 0) + _distance*(cos _angle),(_position select 1) + _distance*(sin _angle), position select 2]; I get type array expected config entry error D: Share this post Link to post Share on other sites
fasad 1 Posted April 30, 2007 Your error is caused by not using the player, rather than the position of the player. eg: _position = getPos player; Sorry, I made a mistake too, the last position in the last line needs to start with an underscore. _newPosition = [(_position select 0) + _distance*(cos _angle),(_position select 1) + _distance*(sin _angle), _position select 2]; Share this post Link to post Share on other sites
Rejn 0 Posted April 30, 2007 ok I got it to work thanks Im using it as a mortar script however I seem to get CTD at random times when using it.. D: I'll post the script for you to look at mabey you can tell me if theres something that CTD's me... basically i created 2 logics.. one is in the distance and never moves it is only used to trigger a mortar fire sound. (ie: Jig) The second (Blon0) is moved around the player in a random radius. Quote[/b] ]gold=creategroup west blon1= gold createunit ["logic", position player, [], 150,"none"] #jet jig say "can" _position = getPos player _distance = random 200; _angle = random 360; ~2 blon1 setpos [(_position select 0) + _distance*(cos _angle),(_position select 1) + _distance*(sin _angle), _position select 2]; ~2 blon1 say "wiz" ~0.8 "grenadehand" createvehicle position blon1 "grenadehand" createvehicle position blon1 "r_pg7v_at" createvehicle position blon1 ~2 jig say "can" _position = getPos player _distance = random 200; _angle = random 360; ~2 blon1 setpos [(_position select 0) + _distance*(cos _angle),(_position select 1) + _distance*(sin _angle), _position select 2]; ~2 blon1 say "wizz" ~0.8 "grenadehand" createvehicle position blon1 "grenadehand" createvehicle position blon1 "r_pg7v_at" createvehicle position blon1 ~2 ? help2=true: goto "end" goto "jet" #end The script repeats itself twice so that I could use two different wizz sounds for the incoming mortars. It then loops checking if help2 is true before repeating. I have the variables updating before each blast. The blast consists of 2 grenades and an rpg round to simulate a small mortar effect. Now for some reason it works but after a while I get a CTD... Ive gotten the CTD multiple times before while working with the script... originally I just spawned a housefly around the player and then deleted it if it was still alive and used that as a loop but even then i was getting crashes to the desktop so I am unsure as to what the problem is. I recently installed new vid drivers for my GTX8800 so it may be that.. dunno... If you see anything that stands out let me know thanks. Share this post Link to post Share on other sites
fasad 1 Posted April 30, 2007 first up, check your ? line ? help2=true: goto "end" should be ? (help2) : goto "end" edit: removed "==true", sorry for all the mistakes, I spent all night scripting and my brain is jelly... I've had the script with all sound related lines removed running for ~10 mins on my system without any CTD. It could be sound related. I once had crashes caused by using lots of EH to keep the player alive during testing, that might be a possibility if you are doing the same? Share this post Link to post Share on other sites
Rejn 0 Posted April 30, 2007 Im getting constant crashes to desktop with the new drivers. D: At least on the hour every hour... Also I couldnt add arma.exe as a profile in nvidia vtune / 3d settings without that crashing. So ive reverted back to 97.?? for stability. Will post my findings if any crashes continue. 8800gtx x1 win xp home with SP2 2gig ram AMD xp3600 or 3200 dual core Share this post Link to post Share on other sites
Rejn 0 Posted April 30, 2007 ok even with 97 im still getting crashes... Something is wrong and I have no idea what... the game ran fine before the install of the new drivers now its gone to @#$% :/ Share this post Link to post Share on other sites
Rejn 0 Posted April 30, 2007 hmm seems my game is crashing outright as of late. Ever since i installed new vid drivers.. now I reverted back same prob so Ive reinstalled the new ones and have installed new soundcard drivers... see if that helps... sigh.. I hate technology... Might have to reformat if she keeps crashing. Share this post Link to post Share on other sites
Rejn 0 Posted May 4, 2007 Just thought id mention the above script which i posted causes crashing after 2-10 seconds of it running. I had to kiss two sticks of ram good bey because of it lol... somehow after multiple crashes i ended up getting the BSOD. Afterwhich i had to format and all my install files became corrupted ... ran a memtest and sure enough.... :/ Wasnt due to the script itself was just multiple crashes and resets and hangs on my pc etc. Just a rheads up. Share this post Link to post Share on other sites