Jump to content

kyfohatl

Member
  • Content Count

    247
  • Joined

  • Last visited

  • Medals

Posts posted by kyfohatl


  1. Sounds good. I'm not much of an editor, but here's a tool I think is good:

    Squint: https://sites.google.com/site/macsarmatools/squint

    its really a scripting manager. It helps you find syntax errors and stuff like that.

    Anyway, so what youre trying to make is some sort of a tool, that manages youre editing tools and allows you to combine them (i.e. use multiple editing tools at once all in one program)? Sorry if it's a noobish question, I just wanted to get a better picture of what this tool does :).

    Cheers

    EDIT:

    I don't know where to post this

    You should probably put this thread in the Mission Editing & Scripting section.


  2. Hey kyfohatl,

    thank you yery much for your great feedback!!!

    Yes, I will expand the scripting section because there is a lot stuff to explain.

    Just in this moment I´m sitting here with a coffee and copy & paste a lot of

    stuff from Guide 1 to Guide 2 :o. But I love the new on already and you and the Com will, too :D

    Best,

    Mr-Murray

    :yay: Thanks alot.

    Looking forward to your guide :bounce3:.


  3. But the "'s looks a bit wrong, shouldn't it be:

    "the whole thing having ""strings"" encapsulated in apostrophes" ? Single " is read as code, while double "" is read as strings.

    I think t looks a bit strange too... I got it from UNN's post since I don't trust my scripting skills enough (he wrote it for me). As you know, I've asked a question about the proper use of brackets; well, this is exactly why I asked it. Anyway, according to guidelines I got from skilled scripters like yourself:

    we have: onMapSingleClick {CODE ---> then command ----> then array ---> then Classname}

    So shouldn't it be: onMapSingleClick {selectPlayer (nearestObject [_pos, 'CAManBase'?

    Anyway, so would this work?

    (findDisplay <code for map>) displayAddEventHandler ["onMouseButtonClick", "_this call Function_MapClick"]

    Function_MapClick:

    private [_click, _returnvalue];

    _click = _this select 0;

    _returnvalue = false;

    if (_click) then {

    execVM "MyProcedure.sqf";

    _returnvalue = true;

    };

    _returnvalue

    MyProcedure.sqf:

    selectPlayer (nearestObject (_pos, 'CAManBase'))

    Theres a few things I don't understand:

    1. Why am I returning a value in the Function_MapClick? I did it because the wiki did, but I don't really know why its necessary.

    2. Where do I find the codes for the displays? (I of course need a code for the world map, but I couldn't find a list of display codes in the wiki)

    3. How do I refer to the position I clicked on the map? At the moment I'm using "_pos", but I'm not sure if it will work.

    4. Where do I put the line: (findDisplay <code for map>) displayAddEventHandler ["onMouseButtonClick", "_this call Function_MapClick"]

    Do I put it in init.sqs, or some script, or a trigger???

    Anyway, thanks for your response :).


  4. Hey Mr-Murray. I've just used your ARMA guide and I must say... SIMPLY EXCELLENT. Sadly I didn't find out about your tutorial for a long time, which meant struggling with the wiki (I didn't learn much from it in the end anyway). But your guide was very well written with lots of examples and very noob friendly.

    Could you perahps expand on the scripting section a little? There are some good scripting tutorials, but I found that none of the tutorials could explain the basic ideas as well as you could.

    Anyway, keep up the good work :).


  5. -How do I spawn in AI?

    Simple. In the editor, double click on the unit you want to spawn as, and in the unit box find the "Control" option. Click on it, and set the unit as "playable". Then while ingame, press "T" to bring up the team switch window, and then click on the AI unit's name to spawn as him.

    Or... have I missinterpreted your question?


  6. I've been trying to creat a feature for my mission that allows the player to take control of an AI unit simply by clicking on it (the units cannot be named, or changed in the editor [DAC generated], hence why I can't simply set them as playable in the editor).

    So what I'm trying to do is to use DisplayEventHandlers to creat this feuture. However, there seems to be no mention of them in any of the four scripting tutorials I'm using, and the wiki seems to be very noob unfriendly. Anyway, I've looked at the wiki, and all I can undrestand is that displayeventhandlers take an "event" (in this case the pressing of a key) and "attach" some sort of a function or script to it (in this case, I'de be using onMouseButtonClick). Exactly how they do this is too difficult for me to uderstand from the wiki examples. Could anyone help me better understand them?

    So here's the example given in the wiki:

    (findDisplay 46) displayAddEventHandler ["keyDown", "_this call functionName_keyDown"];

    functionName_keyDown =

    {

    private["_handled", "_ctrl", "_dikCode", "_shift", "_ctrlKey", "_alt"];

    _ctrl = _this select 0;

    _dikCode = _this select 1;

    _shift = _this select 2;

    _ctrlKey = _this select 3;

    _alt = _this select 4;

    _handled = false;

    if (!_shift && !_ctrlKey && !_alt) then

    {

    if (_dikCode in (actionKeys "NetworkStats")) then

    {

    nul = [] execVM "path\script.sqf";

    _handled = true;

    };

    };

    _handled;

    };

    I can see that local variables such as "_Ctrl" or "_shift" refer to the buttons, but I have no idea what the line

    (findDisplay 46) displayAddEventHandler ["keyDown", "_this call functionName_keyDown"];

    does.

    Also, how do I refere to the position on the map where I clicked with my mouse (is it possibly "_pos"?)?

    And finally, here is what I'm intending to do:

    OnMouseButtonClick -----> triggers the script: selectPlayer (nearestObject [_pos, "CAManBase"]) (so the player takes control of the unit he clicked on, on the map).

    By the way, I have tried (thanks to alot of help from Kyliana and UNN):

    onMapSingleClick "selectPlayer (nearestObject [_pos, "CAManBase"])"

    Though "onMapSingleClick" works fine for a small test mission I tried on Utes, it for some reason doesn't work on my actual missions (with more units, in Chernarus), which is why I'm trying to use event handlers (onMapSingleClick sometimes works and sometimes doesn't, and it seems to be completely random, it lets me play as some units and not as others).

    Thanks for the help. Sorry, I know I ask too many questions. I guess it comes from having not having any previous programming experience.


  7. @ Myke and Haroon:

    A big thankyou to both of you. An excellent guide for brackets :). It will make my learning much easier. Also I just searched "classnames" in the wiki, and realised the difference between objects and classnames.

    One problem that really bogged me was the use of round brackets around "getPos Player", but as haroon said, not having the round brackets will also work. So why did the author (writer of the scripting tutorial) put them there in the first place? To emphasize that they must be processed first by the nearestObject command perhaps?

    Anyway thanks again for your help. It was very useful.


  8. I've been learning ARMA 2 scripting, and one of my problems has been brackets in both sqf and sqs files. I've looked at quite a few tutorials, but they never seem to give an in depth explanation on them. So I'm asking for an indepth explanation on when to use what type of bracket in both scripting languages (sqf and sqs).

    here's an example of a problem I've been having:

    _myStreetLamp = nearestObject [(getPos player), "StreetLamp"]; (sqf format)

    So in the example above, why is "getPos player" put in round brackets (why not square or curely ones?) or "streetLamp" which I think is an object in quotation marks? (I thought objects did not need quotes)

    Thank you for your help.


  9. AHHA! Just what I needed... thanks mate. I'll try to get it to work and test it out, because it will be very useful for me. Personally, I don't care if player looses his equipment in water (players should be smart enough not to cross long ponds!), but its a real pain in the ass for the AI.

    Anyway, thanks again. I've been looking for something like this for ages. Its good to see someone has finally made it (I was trying to do it myself, but I'm still learning how to script :))


  10. damn, it doesn't work well. When I tested it, it worked (on a small test mission), but as soon as I tried the script on my actual mission (which is rather large), it wouldn't work and I tried changing alot of things, but it still didn't work. Actually it worked for one guy (one of the patroling guards), so I could only switch to him, but no one else (strange, isn't it?). Does anyone know why?

    I think it may be because, as UNN said onMapSingleClick is unreliable, so I went off to learn about event Handlers as UNN suggested. I did alot of searching, both in the wiki and in the forums, but I still don't understand how to use them (the wiki confused the hell out of me). My understanding so far, is that an event handler basically takes an enet, say the click of a mouse (MouseButtonClick) and "tags" it to a function that does something after the "event" has taken place. Is that right? If so, how do I "tag" the MouseButtonClick event to a function (function: has something in the lines of selectPlayer (nearestObject (<position & unit class>))?


  11. hmm... Thing is, the chopper has a land waypoint on an invisible helipad and then has some stuff in the condition field to make sure heli doesn't leave untill all the squad has boarded.

    Can I still do all that using the DoMove command?

    I'm not much of a scripter (Kylania and ruebe are the masters), but I don't see why you couldn't use:

    If (<your condition>) then {doMove or whatever}

    Just use a trigger with a syntax of something like countCrew <name of your chopper> >= to activate the script (it checks to see if your squad has entered the heli before letting it move)

    @ruebe: Your a legend mate! Just what I needed. I was about to remake my mission from scratch again. Thanks :)


  12. In your DAC archive under readme\english there is a file called "DAC V3 readme_b.pdf", it contains almost everything you need to know, and definitely how to disable the reduction feature.

    The documentation was not written and translated to English just because the guys had no idea what to do with their time.

    And in the 10 hours you wait now for an answer you could have read the documentation several times. ;)

    I think you missinterpreted my request. I certainly wasn't asking how to disable the reduction feuture; I already know how to do it. Besides, it's quite useful. What I was asking was to how to get around something that seems to be a bug, because when the player squad joins a DAC zone all of his squadmates except for the squadleader are "reduced", but they shouldn't be because they are right next to the player.

    EDIT: Ok, just found out that this only happens when editor placed groups join a DAC zone, if the player joins a DAC generated group, the squad is not reduced. So I guess I could script his squad mates to die before joining the DAC, and then he joins DAC... it would ruin the story though.


  13. Oh yes, I too had a lot of problems with choppers. For example in one mission of mine, I wanted the chopper to extract my squad behind the enemy lines. The problem was that once the chopper saw the enmies, it would head off to shoot at them, instead of extracting us, which was really annoying.

    Anyway, about your question: I can't remember if this is correct, but you should give it a try. I think using the doMove (or something like that) command instead of a waypoint should fix your problem, though again, I'm not sure.


  14. @UNN: Yes...IT WORKED! Thankyou very much. I know the method I'm using is not the best option. I will definitely learn how to use the EventHandler. I'm just using this method becuase I'm a noob and really can't script well, so I stuck with the very basic stuff untill I learn some more.

    @Kylania: That should too. Thanks alot. With my current scripting skills, I can undrestand about 80% of it. I'm looking at a scripting tutorial right now to improve, and hopefully fully understand it.


  15. I knew there were many things wrong with it...:o

    Anyway, I have to use this because the units are DAC generated (dynamic AI creator), so I can't set them to playable before the mission, as they are created at the start of each mission (but I'm sure you knew that :)).

    Could you perhaps help me improve this retarded script?

    Thanks for the quick reply by the way

    ---------- Post added at 07:11 AM ---------- Previous post was at 06:47 AM ----------

    Ok, made some improvements on the script, but it still desn't work:

    _nearunit = nearestObject [_pos, soldierWB]

    onMapSingleClick "selectPlayer _nearunit"

    Anyone know why?


  16. I've written the very simple script bellow, which runs in the init.sqs. It's supposed to allow the player to switch to the unit (any infantry) closest to where he clicked on the map:

    _nearUnit = nearestObject "Unit"

    onMapSingleClick "selectPlayer _nearunit"

    Why doesn't it work? (yeah, I know... I'm a noob) Maybe its because the object class "unit" doesn't make sense or its too broad?


  17. When the player's sqaud is inserted into a DAC zone, all squad members except for the player and the squad leader are reduced. How do I get around this? The reason for inserting the player squad into DAC is that the player is not the squad leader, and I want his squad to become a part of a DAC generated battle (later on his squad members are scripted to die and the player has to go lone wolf and blahblahblah...). Sorry, I don't know how to use the DAC config files very well.

    NOTE: for those of you who don't know, reduction is a DAC feuture via which sqad members of a squad far away from the player "dissapear" to save CPU. They reappear once close to the player.


  18. @CarlGustaffa: Yeah... I see your point. Maybe swiming for ever with lots of equipment is not particularly realistic, but surely when marines swim across a 2 meter pond (that is barely deep enough for them to swim across anyway), they don't loose all of their equipment? And their supposed to be trained hardy soldiers...

    4) It's easy to script to fix it if you don't want it.

    Really??? If so, could you please provide a script for it? It would be very useful for me (I would do it myself if I knew how to, but I've been learning scripting for a while and I havent gotten very far).


  19. @UNN: Thanks alot, it seems your selectplayer command is just what I need. The only problem is that the unit that is being selected is DAC generated (dynamic AI Creator) and it is not named hence not allowing me to use select player unit Name command). Is there a way around this? I have to somehow activativate this command when the player clicks on the unit on his map. I can do a bit of scripting, but I'm a bit of a noob, so I'm going to learn a bit more scripting to see if I could make this happen. I think it would be a cool feuture.

    ---------- Post added at 12:00 AM ---------- Previous post was Yesterday at 11:58 PM ----------

    Theres basic team switch in the game already, pretty simple if your making our own missions,

    just make them playable.

    Yeah, but as I said in my previous post, the units are generated by DAC at the start of each mission (which means that they do not have a name and cannot be set to "playable" before the mission starts in the editor).


  20. I just had a look, there are quite a few missions with "Insurgency" in their name. Could you possible give me a link to it please?

    Anyway, yeah, I think what I need is some sort of a "take control" command, which I could then combine with the Insurgencie's "click on the unit on the map to do..." script to allow the player to take control of the AI.

    The scenario is that after a reletively long singleplayer mission, the player gets to a town and kills the enemy commanding officer. This triggers a war between east and west created by DAC over a very large section of the map (includes tanks and helicopters and etc.). All units respawn in their camps and both sides have something like 800 respawns and the goal is to destroy the other side's camps to defeat that side (because they can't respawn anymore). Of course the player squad is the only group that does not respawn, and I thought this feuture would not only allow the player a limited number of respawns, but also allows him to either choose to be a squad leader or a squad member (by clicking on a DAC squad memeber rather than the squad leader). Anyway thanks for your help.


  21. You can script so that they get weapon back, or try the invisible walls method. Uhh, I actually haven't got to try this out for myself yet (shame on me). Not sure if they are still in OA standalone. Will they use bridge when all other options are blocked? Would be nice to know...

    Hmmmm.... some time ago I thought this was the solution to the problem, but someone told me that invisible walls work only for the player (can't remember the thread). Though I'm not sure if this is ture. Anyway, its just anoying having to waste time putting invisible walls all around the map, especially if your using a map with lots of water like Isla Duala (then it becomes a real pain) and just like how many people have said, its not particularly realistic for a marine loose all of his equipmnet by crossing some 3 meter long pond (which they shouldn't cross in the first place because going around it would be easier). I think it would be so much easier if we could just turn it off somehow. Its just game breaking "semi-realism".


  22. Not long ago, I was discussing and issue I had with the AI in some other thread, and from the discussion I realized that many other people were experiencing diffculties with the same issue.

    The problem is that the AI is not smart enough to go around things such as ponds, and swims across. In some cases they don't even bother crossing bridges over a river and simply swim across it. This causes the AI to loose all of its equipment and its particularly annoying. This is especially significant in maps/areas where there are lots of ponds (beaches are sometimes and issue as well) and causes the mission maker a lot of pain, forcing him to micromanage the AI. This of course is not only extra work, but also makes the AI too predictable and renders the usage of dynamic AI tools to randomize patrol paths and etc. nearly useless (like DAC or WICT).

    Could you please adress this problem? I'm pretty sure its just an AI pathfinding problem. Maybe just diable equipment loss during swimming for the AI?

    Thanks


  23. In my mission, I want to allow the player, once he dies, to click on any AI unit on the map and take contorl of that unit (the units are generated by DAC). Does anyone know how to do this? is it possilbe?

    When the player dies, the trigger DAC_Marker = 3 is enabled to display units on the map for the player to chose from, but how to make it so that once the player clicks on a unit, he takes control of that unit???

    Please Help. Thanks :)

×