Deusrexmachina 0 Posted August 28, 2006 Hello to all. As you've read by the title this is my very first post. I thought it was better to regroup my ideas and open one topic instead of opening more than one at a time! <span style='font-size:11pt;line-height:100%'>~Little Preview~</span> I've first started by discovering by accident the editor (before I was mainly interested in playing the game, not in making anything). When I've clicked on it I didn't know what the hell was going on, just saw a map, buttons around the brown frame, and that was it. Then by accident, literally, I've double-clicked on the map and that Insert Unit window came up. Whoooaaaa, the sky has opened! I went on trying all options I could understand, created my own battles, and spent hours solely with the editor. I felt like a guy in Playboy's mansion... uh, although I'd definetely prefer to stay with 'em bunnies rather than drooling them via monitor! Anyway, after knowing the general aspects, I've switched to scriptings WITHIN the editor with Triggers and/or Init Fields, and NOT by typing scripts in the notepad to then execute them ingame. I was quite reluctant at that time to learn basic programmings, and the lack of computer classes as a backup in my school background didn't help me at all. It was after acknowledging the limits of what I was doing so far that forced me to learn more! The toughest part wasn't to search & download what I could reach out for (including the Playboy bunnies as a distraction.) but mainly to UNDERSTAND what I've downloaded, to UNDERSTAND the various tutorials and to put what I've understood in the game! It was tough, oh boy if it was, but when I've managed to make the first working scripts my face beamed with a happy smile (the first one was to blow up stuff once they've reached a certain level of damage when you shoot at them, like cars that go boom in action films; the second is about zombies that I use for both men and vehicles as dynamic training targets instead of filling up the game with enemies.)! Now I normally deal with my own stuff within the editor -like my other training sessions- rather than official/unofficial missions; plus, it REALLY takes time to finish just one of Resistence's (frustrating) missions, and personal time isn't really by my side (working full-time.)! I'm also trying to model myself some stuff with Oxygen2, but that's even worst then expected!!! I really wish to make a coupla addons since those I've downloaded don't have what I have in mind (without showing off, eh? ), OR there are somewhere but didn't find them. I'll eventually open up another topic in the right thread! <span style='font-size:11pt;line-height:100%'>~Requests~</span> Before making you yawn too much, here are my questions: ### 1 ### I'd like to make a minefield and already know how to make the basic simple script. What I still can't figure out is how to activate it the way I want, either I use a script with the notepad or just type the command in a trigger. Basically it's to make a mine (shell, actually) that appears 1 meter or less underground once a 3x3 trigger has been activated by "Anyone": Quote[/b] ]Blast = "whatevershell" createVehicle/camCreate getPos [(setPos trigpos select 0),(setPos trigpos select 1),(setPos trigpos select 2)-1.2] and the Blast must appear where the trigger is -of course. My main problem now is divided in two categories: 1-a) USING COMMAND LINE: I have to give a name (trigpos in this example) to that trigger! If I have to place only a coupla mines there isn't any problem, but if a coupla DOZEN mines are needed it's a real pain to rename them all in order to then partially re-write the command up there with the different names, otherwise Blast will explode ONLY at the first trigger, no matter which trigger will be activated. 1_b) USING A SCRIPT VIA NOTEPAD: Quote[/b] ] #STARTBlast = "whatevershell" createVehicle/camCreate getPos [(setPos trigpos select 0),(setPos trigpos select 1),(setPos trigpos select 2)-1.2] Exit Clearly it's the same thing, and it's also clear that the problem still is there: what shall I write in the "Activation" field (especially in between [])to make it work when I have MANY mines out there? Quote[/b] ][] exec "Mines.sqm"] Still I have to name the trigger in order for the mine to appear in that specific spot. What I'd like to do in the editor is to create this trigger (with or the script or the command line), hit Ctrl+C, and literally spread around with Ctrl+V where is needed the copied trigger! Only that if I do it in either way... I have no choice but to rename all of them. Does anyone have a solution please? ### 2 ### I've a joystick (Microsoft Sidewinder Precision 2) that works wonderfully when I've to fly -especially with the planes-; the only problem I have with it is when I move my alter ego's head left and right: it turns suddenly when I press, and once released it returns looking in front. When I look up and down instead it moves gradually and remains where I've released the button. I need to move the head like up and down, that is slowly, and not with instant movements. I've tried several combinations with the keyboard and with the joystick's mapping buttons but still can't figure it out. Has anyone the same problem as mine? If so, are there any solutions for this? Ok, enough of my ramblings. I've done my first bombing script, which to be honest is a modification to a previous one made by someone else, and I can't recall in which site I got it from three or so years ago. I found that it was a little irrealistic that the laserguidedbombs would travel slower than the plane, so I've analyzed what he did and made my own speed. Well, actually his is more elaborated as there's one command I still have to understand: "onMapSingleClick". Mine instead goes to an already known target, so it's pretty simplified! If anyone's interested in viewing it, here you go (the EditorUpgrade102.pbo is needed)! Please keep in mind that it's one of my first attempts in understanding scripts: there IS one bug that fortunately happens rarely, that is the A10 doesn't arrive exactly from where I want him to and the bombs detonate under him since he hits them. I've seen it happen only once, but it's enough to show it's limits. I've to deal more with the geometrical inputs in the future. One last question, and this is merely for PC configurations: what kind of computer is needed to play OFP with the terrain detail set to "high" or "very high" with a medium or high detailed resolution (preferably 1024x768x16 or x32)? As I've discovered there's the chance in making things look more realistic rather than flat surfaces. But the video doesn't show any soldiers and I wonder how would it look like with more virtual people in it! Our PC is a PIII 1Ghz 384 Mb RAM and GeForce2 MX/MX 400; for what I've read so far GeForces give less problems than ATI (ALWAYS referring to OFP, eh? Not talking 'bout other games here.). Our PC can so far make the ECP run relatively well (with EVERYTHING in low details. -_-' ), hell I've even played DoomIII!! Thanks for reading! Share this post Link to post Share on other sites
combat-agent 0 Posted August 28, 2006 Scripted mines are fun, but scriptless mines are funner (or easier at least) Make a trigger Activation: Anybody present AxisA=5 AxisB=5 On ACtivation: boom = "grenade" camCreate getpos (thislist select 0) I remember when I first entered the editor 3 or 4 years ago, now I can pretty much edit any aspect of the game. Quote[/b] ]what kind of computer is needed to play OFP with the terrain detail set to "high" or "very high A NASA computer Good luck to ya Share this post Link to post Share on other sites
Deusrexmachina 0 Posted August 28, 2006 HELL yeah, now THAT'S what I'm talking!! Thanks a LOT there Combat-Agent! *thumbs up* Another thing: where did you get that command thislist? I've found it in only "OpFlashCmdRefv101.pdf" and in another site but there's no explanation in either both... I've tried to chang a little your line but only errors came out (Error Unknown operator thislist): Quote[/b] ]boom = "grenade" camCreate getPos [(setPos thislist select 0),(setPos thislist select 1),(setPos thislist select 2)-1.2] Can please tell me more about it?Oh and hey, here's a pic I've done this afternoon while testing -and wondering- if our PC could make some miracles. And surprisingly it did! Now the fields are making things more difficult and incredibly more challenging! YEHAA!! I prefer a great gameplay rather than fantastic graphics, and even if that pic might seem pretty low detailed -and it is- I feel as if I've stepped a higher level in OFP! It was tremendously fun to battle against other two squads with this kind of terrain (I wasn't fighting alone of course.) not counting trying to then aim from a tank gunner's point of view. Wonder why I didn't try to tweak things before... Share this post Link to post Share on other sites
Chris Death 0 Posted August 28, 2006 Well, this is taken from the official comref in first post of thread number four here in mission editing and scripting: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Triggers   Condition expression is used to determine when the trigger is activated. Boolean variable this is set during evaluation of condition expression to primary sensor activation condition. Array variable thisList is set to list of all vehicles that would satisfy primary sensor activation condition. Condition must return boolean value.   On Activation and On Deactivation expressions define action that is peformed when trigger condition changes to true or false. Expression must either be an assignment or return nothing (see type none).   Variable denoting trigger can be created by filling in name field After reading it a couple of times and thinking about it in combination with what you see in editor it should become selfexplainable.   Now to your problem: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">boom = "grenade" camCreate getPos [(setPos thislist select 0),(setPos thislist select 1),(setPos thislist select 2)-1.2] replace the '3' setpos you've placed there accidentially with getpos and remove the getpos infront of your array.  Should then look like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">boom = "grenade" camCreate [(getPos thislist select 0),(getPos thislist select 1),(getPos thislist select 2)-1.2] Setpos means to set a new position and getpos is to locate a position. Here ya go with explanation: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">getPos obj Operand types:   obj: Object Type of returned value:   Array Description:   Object position in format Position. Example:   getPos player <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">obj setPos pos Operand types:   obj: Object   pos: Array Type of returned value:   Nothing Description:   Set object position. Pos array format is Position. Example:   player setPos [getpos player select 0, getpos player select 1 + 10] ~S~ CD Share this post Link to post Share on other sites
combat-agent 0 Posted August 29, 2006 I explain thislist in my I own way just for craps. By typing "Thislist" in an on activation init in a trigger will call the selected units as selected by activation drop down box "West, East, Guer, Civi, Anybody." If you want to see what it puts out use: "hint format["%1", Thislist"]. And ill go ahead and tell about format because every scripter or probably mission editor should know about it. by using format["%1",something], you call a variable. Most of the time its used to display a condition text (hint format["You have %1 dollars remaining", rDollars]). Heres some quick uses hint format["%1, %2", weapons player, magazines player] hint format["%1", typeof vehicle player] hint format["%1", typeof player] hint format["%1", count units group player] hint format["%1, %2", count thislist, this list] It would be wild to play Ofp with all features set to max using and using a mod like ffur or ECP. Maybe in a few years. Share this post Link to post Share on other sites
Deusrexmachina 0 Posted August 29, 2006 Hehehe, thanks a lot there too Chris Death, for your help & explanations! That line will come in handy if I'll use Mavericks instead of grenades! And thanks again too to Combat-Agent as well! Guys like you rock! Uhm, I've searched around if there were other threads related to problems like I have with the joystick; since I didn't find any, can someone please tell me where I can post again the same request, instead of asking it here? Thanks! Share this post Link to post Share on other sites
Deusrexmachina 0 Posted August 29, 2006 Should then look like:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">boom = "grenade" camCreate [(getPos thislist select 0),(getPos thislist select 1),(getPos thislist select 2)-1.2] Er... I've tried your way but it doesn't work. In the game it writes what's the problem on top of the screen, but forgotten what it said. Have time to figure it out perhaps? Share this post Link to post Share on other sites
Chris Death 0 Posted August 30, 2006 I'm at work right now, so i can't test this for you. Just give it a try; Also i noticed that the third element of your position array you don't need to refer to (getpos this select 2) -1.2 since it will be by default 0 You just need to change it to -1.2 Also you don't need to name it: boom, since you don't need to refer later to it again by name boom - it should just explode and nothing else. And by taking a look into the official comref i find that grenade should be changed into: handgrenade Will look like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"handgrenade" camCreate [(getPos thislist select 0),(getPos thislist select 1),-1.2] :edit - my first answer was just straight pointed to the questions and problems of your previous post ~S~ CD Share this post Link to post Share on other sites
Deusrexmachina 0 Posted August 30, 2006 Thanks for your time! But sadly what you say still doesn't fit, and I've pasted exactly what you've quoted. But anyway my last request was because I've been fooling around with Mavericks instead of shells, and having it appear on activation for that instant to then explode isn't that realistic. The main thing is that the command line given from Combat-Agent works perfectly. Another detail: "grenade" doesn't need to be changed into "handgrenade". Share this post Link to post Share on other sites
Chris Death 0 Posted August 31, 2006 You know what - with your modification of the original code you brought me into: 'i cannot see the forrest because of the lots of trees there' Original code by Combat Agent: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">On ACtivation: boom = "grenade" camCreate getpos (thislist select 0) Your modified code: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">boom = "grenade" camCreate [(getPos thislist select 0),(getPos thislist select 1),(getPos thislist select 2)-1.2] My Code: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"handgrenade" camCreate [(getPos thislist select 0),(getPos thislist select 1),-1.2] OK, i tried it myself now (hence it's been a long time since i last time played around in editor every day) - and i found out what the problem was. You mislead me with your thislist and getpos of thislist. Look: thislist select 0 refer's to the first object which matches the trigger activation specifications. Getpos thislist select 0 returns the position of this object - a 2d positional array like: [x-axis,y-axis] thislist select 1 refers to the 2nd OBJECT in the trigger's list. Now if you want to create a grenade at the position of the first object (unit) which entered the trigger you would do like combat Agent posted. But if you want to camcreate it not on exaxtly the same position you already found out that you must change it by refering to the three axis. Well everything that was missing was one more SELECT in your code on each segment, which makes three selects. But this would make it look like e.g: getpos this select 0 select 0 Sounds confusing now? A better variant is to store the guy into an extry variable, like i did below with boomman. Here is the working code before i lose you in explaining and explaining: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">boomman = thislist select 0; boom = "grenade" camCreate [(getpos boomman select 0),(getpos boomman select 1),-1.2] One more thing: i found out that strangely you need boom = in a trigger but not in scripts. I was using that method (but with createVehicle instead of camCreate) for simulating artellery in earlier days, and i made this from scripts - therefore i wasn't aware about the fact that a trigger's onActivation field requires to create a reference for the explosion. Comref says different and to me it's not logical anyways but however. Everybody can learn after so long times some simple things like this even - what the hell of a game ~S~ CD Share this post Link to post Share on other sites
Deusrexmachina 0 Posted August 31, 2006 Hey Chris Death, it works! Thanks a lot, now I can use bigger explosions without fully destroying who activates the trigger; in fact, if you -whoever wanna try it- bury a shell for some meters, it will detonate causing virtual injury or virtual death, making the activator and debris fly allover, but under a certain depth there's only the explosion without dammage to whoever activates the mine. Try it with the laserguidedbomb as well. Quote[/b] ] boomman = thislist select 0; boom = "shell125" camCreate [(getpos boomman select 0),(getpos boomman select 1),-6] Thanks again Chris Death! Share this post Link to post Share on other sites
Deusrexmachina 0 Posted September 2, 2006 Instead of opening another topic, lemme continue here... As said above, I normally deal with my own "training sessions" with the editor, like this one as a Blackhawk gunner shooting at zombies (with one of the few working scripts of mine. ) that respawn at the spot after some seconds they've been gunned down. The chopper fly in four angles at random altitude making things more challanging in terms of aiming correctly; you've to shoot at the russian living-dead who in return will continue firing at you with his PK with endless ammo available (he gets filled up at every kill) while there's another one with an AK who somehow freezes whenever you go closeby. You on the other hand, at every complete cycle the chopper does in these four angles (which are four triggers) will have the armor completely regeneratad, while -and here is the problem- I can't have an ammo refill! I've tried with the command "vehicle setAmmoCargo ammoCargo" but I'm not too sure that's the right one, also 'cause it doesn't work... (rrrrrrrrright, otherwise where's the problem!?) EditorUpgrade102.pbo is needed, included in the zipped file in RAR format. There are no un-official addons in it, but in case I made a mistake open up the "mission.sqm" and see what has to be deleted. Quote[/b] ]addOns[]= { "HMMWV", "SSV_jeepmg", "6G30", "bis_resistance" }; addOnsAuto[]= { "HMMWV", "SSV_jeepmg", "bis_resistance" }; Can anyone please help me? The only way I've found was to put an ammo truck without feul and place it far away. Without any gas inside or it'll start following the chopper, but the procedure to go nearby and refill the BlackHawk takes quite some time. I know this is kinda silly since all you've to do is to restart everything, but I prefer if there's a continuation! AND to know what command is needed. Share this post Link to post Share on other sites
Deusrexmachina 0 Posted September 4, 2006 Nothing at all?! Share this post Link to post Share on other sites
Metal Heart 0 Posted September 4, 2006 The syntax for addmagazine is: vehiclename addmagazine "MagazineName" To find out what magazines a vehicle uses have a trigger like: condition: time > 1 activation: hint format ["%1", magazines vehiclename] {vehiclename addMagazine "Browning"} forEach [1,2,3,4,5,6,7,8,9,10] That on would add 10 Browning magazines. Values in the array don't matter, they're just there to loop the commands inside brackets without using a variable for as many times as there are elements in the array. Here's a reference of weapons and magazines (you can add weapons too for vehicles with addweapon): http://www.ofpec.com/COMREF/comref/weapons.html Share this post Link to post Share on other sites
Deusrexmachina 0 Posted September 7, 2006 Thanks a lot. I didn't even notice your reply, my bad... I'll try it this evening! Share this post Link to post Share on other sites