Jump to content

Somerville

Member
  • Content Count

    154
  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About Somerville

  • Rank
    Sergeant

core_pfieldgroups_3

  • Interests
    Guitar, ArmA, OFP, eating.
  1. Ahh, thanks for the help
  2. Morning all, I've been trying to get this working. The below is a script that is designed to spawn an empty T72, but to try and make it 'enemy' so that an A10 can lock on to it. However, it just shows as a white dot on the radar and won't lock on no matter how many times I fly past. Here is the script: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?!(local Server): exit _Xpos = _this select 0 _Ypos = _this select 1 _Xspread = _this select 2 _Yspread = _this select 3 time = _this select 4 targets = _this select 5 localtargetcounter = 0 showresult = false Publicvariable "showresult" TargetHits = 0 publicVariable "TargetHits" Targetmiss = 0 publicVariable "Targetmiss" targetcount = 0 publicVariable "Targetcount" #loop _X = _Xpos _Y = _Ypos _X = _X + (random _Xspread - _Xspread /2) _Y = _Y + (random _Yspread - _Yspread /2) _target = "T72" createvehicle [_X,_Y,0] _grp1 = createGroup EAST _spawndrive = "SquadLeaderE" createUnit [position _target, _grp1,"spawndrive = this",1,"PRIVATE"] spawndrive moveInDriver _target _target setSide OPFOR _driver disableAI "MOVE" _markerf = createMarker ["Fired", position _target] "Fired" setMarkerSize [250, 250] "Fired" setMarkerColor "ColorRedAlpha" "Fired" setMarkerShape "ELLIPSE" ~240 deleteMarker "fired" targetcount = targetcount + 1 Publicvariable "Targetcount" localtargetcounter = localtargetcounter + 1 testnumber1 = localtargetcounter Publicvariable "testnumber1" testnumber2 = targets Publicvariable "testnumber2" timecount = 0 #Time showhint = false Publicvariable "Showhint" ~0.25 ?(getdammage _target > 0.1) : goto "hit" timecount = timecount + 0.25 ?timecount < time : goto "time" _target setdammage 1 Targetmiss = Targetmiss + 1 Publicvariable "Targetmiss" ~1 showhint = true Publicvariable "Showhint" goto "next" #Hit _target setdammage 1 TargetHits = Targethits + 1 Publicvariable "TargetHits" ~1 showhint = true Publicvariable "Showhint" goto "next" #next ~2 deletevehicle _target ~2 ?localtargetcounter >= targets : showhint = true; Publicvariable "Showhint"; goto "end" goto "loop" #end testinprogress = false Publicvariable "testinprogress" showresult = true Publicvariable "showresult" testnumber1 = 0 Publicvariable "testnumber1" testnumber2 = 0 Publicvariable "testnumber2" I hope you can help Thanks, Somerville
  3. Somerville

    Sahraniville - An RPG Map for ArmA

    Hi guys, Sorry about the pictures, and the confusion. 1) The 24/7 Server is called -{SAHRANIVILLE}-. However, simply entering "gol" into the server-name filter will bring up the server for you 2) I did write some rules/guidelines/laws... I'll post these later. They need changing, since the mission layout has changed a lot since I first made it. I'll work on it, though! Here's a few rough things though: <ul> [*]New Life Rule - When a unit dies, they CANNOT remember what happened before they died! I.e. You won't remember who shot you. [*]Cop Powers - Cops can and will use their powers. They can detain you in custody (Paraiso Airfield) if they suspect you of a crime. The recommended maximum detention period is 10 minutes, after which the detainee should be charged or released. IF charged, they can be sent to prison for the allotted Jail-time of 10 minutes
  4. Evening all! Up for Public Beta is Sahraniville, an RPG Map I started working on not long after I bought an import of the Czech version of Armed Assault, those many moons ago. Originally, it was based on CrimeCity scripts from OFP. However, the main issue was Join in Progress. So, I shall tell thee a tale, as I am bored: I made a new version - from scratch. I based the Shops and Money on SPON_Core & Money (I love you Spooner). Spooner was a great help - always willing to respond to a question with helpful advice. There were many other helpful individuals, too, and I'm really grateful to you all So, why has it taken so long? Numerous factors - I'm in a clan, and that takes up a lot of time; other games, university, housework... lots of stuff really. I've reached a point now where I've decided that it's best if I let you have it, play around with it, see what you think and, hopefully, provide some feedback. A lot of the bugs have been ironed out, but there's probably more that'll be found. You can find a bug tracker here, and a developer's blog here. If you want a few pictures, there will be some below. What is Sahraniville? Sahraniville is a Roleplaying Map for Armed Assault. It was originally started ages ago, but has undergone a total revamp since the first version. Yay. What do you do? Well, you either play as a cop or a civilian - kinda like CrimeCity for OFP. As a civilian, you either follow the law, or break it. Cops simply uphold the law but, as you may have worked out, can be corrupt, too. Where can I get it? I'm hoping others will host the mission file, and maybe even the addons required, but we shall see. For now, you can click here. I prefer to use Yoma's Addon tool for Armed Assault, so I've set up one of these for Sahraniville. You can find a guide to setting that all up here. The addons shouldn't take too long to download, as long as you're not on a 56K modem. So yeah.. before you play it, I know it's not amazing, and it's not as good as other RPG maps, but I still hope people will play and enjoy it There is a 24/7 Sahraniville server running, lovingly hosted by -{GOL}- Thanks for reading, hope you enjoy the map - constructive criticism would be appreciated Pickchaz [ig]http://www.gol-clan.net/sahraniville/pictures/jail1.jpg[/img] [ig]http://www.gol-clan.net/sahraniville/pictures/jail2.jpg[/img] [ig]http://www.gol-clan.net/sahraniville/pictures/jail3.jpg[/img] [ig]http://www.gol-clan.net/sahraniville/pictures/blood.jpg[/img] [ig]http://www.gol-clan.net/sahraniville/pictures/graves.jpg[/img] To Editors I don't mind if you edit it - all I ask is that you credit the Sahraniville team for their work thus far. Alternatively, why not ask to work with us?
  5. Thanks for the reply, UNN I've not made a public array before - how does it work? Is there any chance you can put together a small example for me? Pwetty pweese? Edit: Okay, I've looked at the Wiki - at ObjNull, isNull, and isNull_grp. What I seem to read of isNull_grp is that it checks if Any_value == isNull_grp. So am I correct in assuming you'd need to create a variable along the lines of "PlayerJIP == true", then check if this variable was true/false before adding actions, right?
  6. Bugger me, this is annoying! Nothing seems to be working! Thanks for the suggestion Odin, but that doesn't seem to work Basically, with the current version in the first post, it works fine. It doesn't work, however, if a unit joins in progress. Anyone who plays from the beginning gets the actions, and I think it works if you leave the AI on. However, that means a load of markers and players cluttering up the map needlessly. Also, the actions don't work when the unit respawns. The problem with actions.sqf above is that it doesn't detect if the unit already has the actions, so you'll end up with units who have duplicate actions, right? Is there any way to stop this, so that units that respawn get the actions again, but those who already have them don't? Please help, I'm literally sobbing now - this is the last issue I need to fix before I can release it - I'll kiss whoever fixes it/helps fix it. Honestly. The other issue, of course, is join in progress - however, all I need to know here is how to check if the actions have already been added and, if so, how to prevent it from being re-added. If I was, for example, to put in a variable - let's say, actions = false, and then declare that as 'true' at the bottom of actions.sqf.. then in the was_killed.sqf say: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ?(actions = TRUE) : exit Hope someone can help - I'm really stuck here
  7. Okay, thanks Odin Is there a way to make ArmA check if the actions are already on the unit, and only then to add the actions to a unit that doesn't have them? Or would it be best just to have 'west' actions script, and 'civilian' actions script, run from the init line of each unit? Edit: Hmm - that doesn't seem to work on our dedicated server. I'm having a tweak with it now, see if I can make it work
  8. Hi all, So I'm working on an RPG map, Sahraniville, and so far it's all going fantastically - work is progressing well, and with the help of numerous members of this forum, we've overcome some scripting obstacles. However, we've encountered a few more, and I'm hoping someone can share some words of wisdom with me Firstly, the scripts; the first script is actions.sqf: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _array = [c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22]; waitUntil {alive player}; if (side player == west) then { { _x addaction ["Arrest Civilian", "arrest.sqs"]; _x addaction ["Fine Civilian", "fine.sqf"]; _x addaction ["Disarm Civilian", "disarm.sqf"]; _x addAction ["Check Car Licence", "clicence.sqs"]; _x addAction ["Check Gun Licence", "glicence.sqs"]; } foreach _array; player addaction ["Stats", "stats.sqf"]; } else { player addaction ["Hands Up", "HandsUp.sqs"]; player addaction ["Stats", "stats.sqf"]; }; As you can see, it makes sure the player is 'alive' before adding the actions to the array. Now, the issue is, when a player joins-in-progress, unless the AI are enabled, the player has no actions. Which is wierd, because I thought at least the actions would be duplicated for existing units? Anywho, the next issue. In Init.sqf, I have put the following: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> player addeventhandler ["killed", {_this execVM "was_killed.sqf"}]; ... And Was_killed.sqf is: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> waitUntil {alive player}; player execVm "actions.sqf"; Which doesn't do anything *profanities, hair tearing*. I'm new to SQF, but I've been told SQS is 'dirty', so I should stay away. I didn't really want to have a trigger for each unit to run the actions for each unit, but if that's the best option in your opinion, I shall opt for it. Can anyone suggest any way to make it work with players who JIP? I can't really ID the actions, because _id is local, and it's not worth tying global variables to actions (or is it?).. any help, pointers or whatever is very much appreciated Somerville
  9. Somerville

    Join In Progress Actions

    Hi, So, basically, the above seems to be working with Join in Progress. However, it's not working when a unit dies - they respawn without the actions. I put this into my init.sqf: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">player addeventhandler ["killed", {_this execVM "actions.sqf"}]; So that it runs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (side player == west) then { { _x addaction ["Arrest Civilian", "arrest.sqs"]; _x addaction ["Fine Civilian", "fine.sqf"]; _x addaction ["Disarm Civilian", "disarm.sqf"]; _x addAction ["Check Licence", "clicence.sqs"]; } foreach [c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22]; player addaction ["Stats", "stats.sqf"]; } else { player addaction ["Hands Up", "HandsUp.sqs"]; player addaction ["Stats", "stats.sqf"]; }; However, the problem I can see with this is that it will add the action to all units - C1, C2, C3 etc... regardless of whether or not they have the action already. Is this the case? Is there a way around this at all?
  10. Somerville

    Join In Progress Actions

    Ah, I see - many thanks Any thoughts as to how Join In Progress will act with regards to this?
  11. Hi guys, I've got a bit of a problem, but hopefully you can help. I've got 22 civilians, each of whom has the same actions for any player on the WEST side. Here is what I have so far in my init.sqf to add these actions: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (side player == WEST) then { c1 addaction ["Arrest Civilian", "arrest.sqs"]; c1 addaction ["Fine Civilian", "fine.sqf"]; c1 addaction ["Disarm Civilian", "disarm.sqf"]; c1 addAction ["Check Licence", "clicence.sqs"]; c2 addaction ["Arrest Civilian", "arrest.sqs"]; c2 addaction ["Fine Civilian", "fine.sqf"]; c2 addaction ["Disarm Civilian", "disarm.sqf"]; c2 addAction ["Check Licence", "clicence.sqs"]; c3 addaction ["Arrest Civilian", "arrest.sqs"]; c3 addaction ["Fine Civilian", "fine.sqf"]; c3 addaction ["Disarm Civilian", "disarm.sqf"]; c3 addAction ["Check Licence", "clicence.sqs"]; C4 addaction ["Arrest Civilian", "arrest.sqs"]; c4 addaction ["Fine Civilian", "fine.sqf"]; c4 addaction ["Disarm Civilian", "disarm.sqf"]; c4 addAction ["Check Licence", "clicence.sqs"]; C5 addaction ["Arrest Civilian", "arrest.sqs"]; c5 addaction ["Fine Civilian", "fine.sqf"]; c5 addaction ["Disarm Civilian", "disarm.sqf"]; c5 addAction ["Check Licence", "clicence.sqs"]; C6 addaction ["Arrest Civilian", "arrest.sqs"]; c6 addaction ["Fine Civilian", "fine.sqf"]; c6 addaction ["Disarm Civilian", "disarm.sqf"]; c6 addAction ["Check Licence", "clicence.sqs"]; C7 addaction ["Arrest Civilian", "arrest.sqs"]; c7 addaction ["Fine Civilian", "fine.sqf"]; c7 addaction ["Disarm Civilian", "disarm.sqf"]; c7 addAction ["Check Licence", "clicence.sqs"]; C8 addaction ["Arrest Civilian", "arrest.sqs"]; c8 addaction ["Fine Civilian", "fine.sqf"]; c8 addaction ["Disarm Civilian", "disarm.sqf"]; c8 addAction ["Check Licence", "clicence.sqs"]; C9 addaction ["Arrest Civilian", "arrest.sqs"]; c9 addaction ["Fine Civilian", "fine.sqf"]; c9 addaction ["Disarm Civilian", "disarm.sqf"]; c9 addAction ["Check Licence", "clicence.sqs"]; C10 addaction ["Arrest Civilian", "arrest.sqs"]; c10 addaction ["Fine Civilian", "fine.sqf"]; c10 addaction ["Disarm Civilian", "disarm.sqf"]; c10 addAction ["Check Licence", "clicence.sqs"]; C11 addaction ["Arrest Civilian", "arrest.sqs"]; c11 addaction ["Fine Civilian", "fine.sqf"]; c11 addaction ["Disarm Civilian", "disarm.sqf"]; c11 addAction ["Check Licence", "clicence.sqs"]; C12 addaction ["Arrest Civilian", "arrest.sqs"]; c12 addaction ["Fine Civilian", "fine.sqf"]; c12 addaction ["Disarm Civilian", "disarm.sqf"]; c12 addAction ["Check Licence", "clicence.sqs"]; C13 addaction ["Arrest Civilian", "arrest.sqs"]; c13 addaction ["Fine Civilian", "fine.sqf"]; c13 addaction ["Disarm Civilian", "disarm.sqf"]; c13 addAction ["Check Licence", "clicence.sqs"]; C14 addaction ["Arrest Civilian", "arrest.sqs"]; c14 addaction ["Fine Civilian", "fine.sqf"]; c14 addaction ["Disarm Civilian", "disarm.sqf"]; c14 addAction ["Check Licence", "clicence.sqs"]; C15 addaction ["Arrest Civilian", "arrest.sqs"]; c15 addaction ["Fine Civilian", "fine.sqf"]; c15 addaction ["Disarm Civilian", "disarm.sqf"]; c15 addAction ["Check Licence", "clicence.sqs"]; C16 addaction ["Arrest Civilian", "arrest.sqs"]; c16 addaction ["Fine Civilian", "fine.sqf"]; c16 addaction ["Disarm Civilian", "disarm.sqf"]; c16 addAction ["Check Licence", "clicence.sqs"]; C17 addaction ["Arrest Civilian", "arrest.sqs"]; c17 addaction ["Fine Civilian", "fine.sqf"]; c17 addaction ["Disarm Civilian", "disarm.sqf"]; c17 addAction ["Check Licence", "clicence.sqs"]; C18 addaction ["Arrest Civilian", "arrest.sqs"]; c18 addaction ["Fine Civilian", "fine.sqf"]; c18 addaction ["Disarm Civilian", "disarm.sqf"]; c18 addAction ["Check Licence", "clicence.sqs"]; C19 addaction ["Arrest Civilian", "arrest.sqs"]; c19 addaction ["Fine Civilian", "fine.sqf"]; c19 addaction ["Disarm Civilian", "disarm.sqf"]; c19 addAction ["Check Licence", "clicence.sqs"]; C20 addaction ["Arrest Civilian", "arrest.sqs"]; c20 addaction ["Fine Civilian", "fine.sqf"]; c20 addaction ["Disarm Civilian", "disarm.sqf"]; c20 addAction ["Check Licence", "clicence.sqs"]; C21 addaction ["Arrest Civilian", "arrest.sqs"]; c21 addaction ["Fine Civilian", "fine.sqf"]; c21 addaction ["Disarm Civilian", "disarm.sqf"]; c21 addAction ["Check Licence", "clicence.sqs"]; C22 addaction ["Arrest Civilian", "arrest.sqs"]; c22 addaction ["Fine Civilian", "fine.sqf"]; c22 addaction ["Disarm Civilian", "disarm.sqf"]; c22 addAction ["Check Licence", "clicence.sqs"]; player addaction ["Stats", "stats.sqf"]; } else { player addaction ["Hands Up", "HandsUp.sqs"]; player addaction ["Stats", "stats.sqf"]; }; However, I have an issue in trying to make these actions happen for all players, even those who join in progress. Currently, it works for all players who start the map at the same time. However, it does not work for join in progress players. Is there a way of telling ArmA "Check if the actions are already on the unit - if they are, go away, if not, add them"? I'm not sure if naming each action would help - y'know, _arrestc1 = c1 addAction ["Blah", "blah.sqs"].. but surely there's a more efficient way?
  12. Yay! JasonO suggested that in the Init.sqf I put this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">fine = []; fine_player = []; "fine" addPublicVariableEventHandler {if (player == fine_player) then {_civilian = fine_player; SPON_playerBankBalance = SPON_playerBankBalance - fine; _civilian groupchat format ["You were fined $%1 by the establishment!", fine];}else{_officer groupchat ["%1 fined.", _civilian];};}; And fine.sqf should be this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_civilian = _this select 0; _officer = _this select 1; _fine = 1000; fine_player = _civilian; publicvariable "fine_player"; fine = _fine; publicvariable "fine"; _msg=Format["I gave %1 a fine of $%2", _civilian,_fine]; _officer globalchat _msg; And it works - thanks for all ze help everyone
  13. Oh noez.. still doesn't work - just tried testing with another player, and their money doesn't get taken away either I've now got this: Finez.sqf <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">fine = []; fine_updateFunction = { fine = _this; publicVariable "fine"; // send fine var over the network _this call fine_function; // call the fine function also on this machine, because the pvEH will not trigger on the sending machine by default }; fine_function = { private ["_civilian", "_officer", "_fine"]; _civilian = _this select 0; _officer = _this select 1; _fine = 1000; if (player == _civilian) then { SPON_playerBankBalance = SPON_playerBankBalance - _fine; _civilian groupchat format ["You were fined $%1 by the establishment!", _fine]; } else { _officer globalchat ["%1 fined.", _civilian]; }; }; switch (side player) do { case CIVILIAN: {if (SPON_playerBankBalance < _fine) then {player globalchat "I can't afford the fine." }else{ SPON_playerBankBalance = SPON_playerBankBalance - _fine; player globalchat "I paid the fine.";};}; case WEST: {_msg=Format["I gave %1 a fine.", _civilian]; _officer globalchat _msg;}; }; "fine" addPublicVariableEventHandler { (_this select 1) call fine_function; // (_this select 1) contains the value of "fine" pv, at the time of the event };
  14. Okay chappies! Just done a quick MP Test and sadly, it doesn't appear to be working. I say this only because it does not hint when the player had paid the fine. Although I'm only testing on AI on our dedicated server, it doesn't work *weeps* So, I've got the "finez.sqf" script that I call from my init.sqf, which reads what you have placed above, Sickboy Then, for the "Fine.sqf" which is called when the officer approaches the unit and gives the fine, displays: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[_civilian, _officer] call fine_updateFunction; Am I missing something here? Sorry, it's probably because it's early(ish).. I am very much grateful for the help thus far though
  15. Cheers, guys, thanks for all the help! SickBoy, I love you - I'll test that out and see how it works! Edit: Okay, so I'm trying this in Single Player at the moment, but it's not 'hinting' that the fine has happened.. I'll try it in MP as well to see if it works there
×