Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

Dreadleif

Member
  • Content Count

    47
  • Joined

  • Last visited

  • Medals

Everything posted by Dreadleif

  1. My trigger is set to activate when blufor is present, repeatedly. For some reason it's not checking the IF conditions in the script. The result is that the units are spawned even when "tre_opforcaptured" (a simple opfor-present-repeatedly trigger) isn't currently activated. What noob mistake have I done here? Thanks! :) Trigger onAct: null=[] execVM "scripts\opfor\tre_Spawn.sqf"; tre_Spawn.sqf sleep 4; if (isserver and triggeractivated tre_blufor and triggeractivated tre_opforcaptured) then { //SPAWN GROUP _grp = createGroup EAST; //UNIT AMOUNT, ITEMS, LOCATION (CHANGE MARKER) for "_i" from 1 to round (random 4) do { _soldier = _grp createUnit ["O_G_Soldier_lite_F",(getmarkerpos "spawnguard_tre"),[],0,"NONE"]; removeAllWeapons _soldier; removeAllItems _soldier; removeAllAssignedItems _soldier; removeVest _soldier; _soldier addweapon "arifle_Mk20_F"; _soldier addMagazines ["30Rnd_556x45_Stanag", 6]; _soldier setFace "AfricanHead_02"; }; {_x addEventHandler ["Killed",{[_this select 0] execVM "scripts\DeleteDeadBody.sqf" } ]} forEach units _grp; //SET SKILL (CHANGE); {[_x] execVM "skill_2.sqf"} forEach units _grp; //ADD PATROL AND BEHAVIOR; {[_x] execVM "scripts\opfor\aipatrol.sqf"} forEach units _grp; //SPAWN GROUP _grp = createGroup EAST; //UNIT AMOUNT, ITEMS, LOCATION (CHANGE MARKER) for "_i" from 1 to round (random 4) do { _soldier = _grp createUnit ["O_G_Soldier_lite_F",(getmarkerpos "spawnguard_tre2"),[],0,"NONE"]; removeAllWeapons _soldier; removeAllItems _soldier; removeAllAssignedItems _soldier; removeVest _soldier; _soldier addweapon "arifle_Mk20_F"; _soldier addMagazines ["30Rnd_556x45_Stanag", 6]; _soldier setFace "AfricanHead_03"; }; {_x addEventHandler ["Killed",{[_this select 0] execVM "scripts\DeleteDeadBody.sqf" } ]} forEach units _grp; //SET SKILL (CHANGE); {[_x] execVM "skill_3.sqf"} forEach units _grp; //ADD PATROL AND BEHAVIOR (CHANGE); {[_x] execVM "scripts\opfor\aipatrol.sqf"} forEach units _grp; } else { };
  2. 1. Yes 2. Yes, nothing wrong. 3. Works as expected. 4. Went through them again. The only thing I can imagine is that the "Seized By" condition set in the trigger isn't corresponding with "triggeractivated tre_opforcaptured" in the script condition. Even though the trigger is set to repeatedly, maybe the script registers the trigger as always true, once it has been seized only once in the past? Only solution I can think of =(. It's okay, I can do a work-around, but was hoping to fix this. Thanks and liked :)
  3. Hey! :D Thanks in advance for any help. Problem: The second my "loopmarker" scripts at the bottom of my init.sqf start running, everyone desyncs from the server. I can see the players running around, and I can do stuff, but they see me running in place and can't interact with anything. I run non-dedicated server for friends. All the scripts work perfectly in single player. When I do a test to only remove the loopmarker scripts before hosting, everything works fine, so I know that they are making it desync. Is there some way to make them less taxing or rearrange this? I heard something about precompile, but I didn't get it - is that the solution, or how would you rearrange this (I'm fairly new to scripting)? :huh: init.sqf //KJØR STARTING SCRIPTS [] execVM "scripts\MAKEBUILDINGS.sqf"; [] execVM "scripts\MAKEBUILDINGSstatic.sqf"; [] execVM "scripts\friendlyfire.sqf"; [] execVM "scripts\removegearkilled.sqf"; sleep 1; [] execVM "scripts\ATM1.sqf"; //[] execVM "scripts\Mapactivated.sqf"; sleep 1; //SCRIPTS FOR INCOME [] execVM "scripts\blufor\cash_power.sqf"; // UNIT LOADOUT ON RESPAWN [west, "WEST1"] call BIS_fnc_addRespawnInventory; // REDRESSING null = [RESISTANCE, true, true] execVM "JSHK_Redress\redressInit.sqf"; //TESTING "GLB_Sound" addPublicVariableEventHandler { private ["_Gsound"]; _Gsound= _this select 1; player say _Gsound; }; if (isServer) then { sleep 100; [] execVM "scripts\opfor\loopmarker_mid_1.sqf"; [] execVM "scripts\opfor\loopmarker_mid_2.sqf"; [] execVM "scripts\opfor\loopmarker_mid_3.sqf"; [] execVM "scripts\opfor\loopmarker_mid_4.sqf"; [] execVM "scripts\opfor\loopmarker_mid_5.sqf"; [] execVM "scripts\opfor\loopmarker_mid_latest.sqf"; sleep 100; [] execVM "scripts\opfor\loopmarker_flank_1.sqf"; [] execVM "scripts\opfor\loopmarker_flank_2.sqf"; [] execVM "scripts\opfor\loopmarker_flank_3.sqf"; [] execVM "scripts\opfor\loopmarker_flank_4.sqf"; [] execVM "scripts\opfor\loopmarker_flank_5.sqf"; [] execVM "scripts\opfor\loopmarker_flank_latest.sqf"; sleep 160; [] execVM "scripts\opfor\AttackMid_1.sqf"; [] execVM "scripts\opfor\AttackFlank_1.sqf"; }; All the loopmarker scripts are identical, here is a sample. This script is the problem ----- LoopMarker_Mid_1.sqf while {true} do { if (!triggeractivated HQ_bluFORCAPTURED && triggeractivated one_bluFORCAPTURED) then { "attackspawn_middle" setMarkerPos getMarkerPos "spawnguard_HQ"; "attacktarget_middle" setMarkerPos getMarkerPos "spawnguard_one"; } else {sleep 19}; }; Why do they make the server desync? I really hope someone has the answer as I've been working many, many days on this map and now it's unplayable. I'm going to bed so can't respond to questions, but I shall praise the person who posts an example for solution :).
  4. Folkene som later som de er eksperter har for mye stolthet til å hjelpe deg. ^ The experts on this forum will solve it for you proudly. Below is about as far as I got, and from the coded and pedagogically "special" guides I got from the Spocks of scripting at the time ;), the most I was able to grasp from their arcane scribblings was something about remoteExec.. If I knew how, I'd explain how to do this for you in 10 words or less. init of unit this addaction ["Rig Car", {playSound "rigging"; "scripts\rig.sqf" remoteExec [ "BIS_fnc_execVM",2 ] }]; rig.sqf _nul = rigcar remoteExec [ "removeAllActions", 0, true ]; //Remove action for all players sleep 15; riggedcar setdamage 1; }; This is the only thing I've gotten working with this method. Global commands like setdamage will work, but not local ones.. It seems like after this much communicating back and forth, we'd have some definite guide on this by now. If I knew it, I'd share it with you, nord brother. Hail Ulfrik. :803:
  5. Thanks for the feedback, dreadedidentity, and thanks for the tip about sleep. I'll put that in all my looping scripts from now on. You're right that I have done a lot of searching and work to figure out how to script for multiplayer in a very short time. Before any post I make, I have worked on and searched for the problem for at least 2 hours. If you see a lot of posts from me recently, it's the fact that I have a weeks vacation now to just work on this map that I'm developing for my friends, and to develop my scripting skills. Said skills have leaped from no knowledge at all, to being able to do almost anything in MP in just a few weeks thanks to the great people who hang out here (you're the best guys). I push my boundaries, that's why you see me asking questions. I have to say that this was a bit demeaning, and I'd never say this to someone who was learning a field I was an expert in. More importantly it's bad advice, as learning complex SP-scripting will screw you over more times than help you, if what you want to do is get better at making MP-missions (i know from experience). Sort of like an author telling a teenager who is trying to write a write book that he should stick to a coloring book - it's not really relevant for what that person wants to accomplish. All of my multiplayer maps have been perfectly synced up to this problem with the looping script, and now it won't pop up ever again because I found the solution. I know how to create consistent MP maps with custom GUI's that spawn custom websites in-game, which link to scripts that do very advanced stuff, store functions and play videos in-game. I know a lot more than most MP-scripters already after just a few weeks, but I come here to iron some things out. My questions are relevant and not asked specifically before, otherwise I'd find it with a search. If I stuck to SP-scripting I would never advance in the field I want to learn, and I have no interest in SP-maps, but I do think your intention was good, if perhaps a bit jaded. I also have gotten feedback that my questions have been useful to other scripters, and I have helped other beginner-scripters solve their problems on many occasions, and don't see the problem with helping noobs out with new problems. In any case, thanks for the tips on the sleep in a loop, you're obviously a very skilled scripter, and no thread will be made about this problem in the future :).
  6. Dreadleif

    Enemy overrun script

    Trigger: OPFOR, Present Condition: (east countSide thislist) >= 41; OnAct: endMission "END2"; Add a countdown if you don't want it to seem too instant. Or a timeout if you want to give yourselves some chance to bring the number down again once it reaches above 40. Or if you need to check for it in the end of a script, remove the onact from the trigger and put it below "waituntil {triggeractivated triggername};" in the script
  7. Thanks both of you! I will do exactly that. :D Liked and changed to solved.
  8. Liked! [EDIT] It worked. You're amazing, I don't know why, but it worked. Gonna look into spawn. :D
  9. Hey, thanks for wanting to help :). So, I need some things to happen a certain number of times, once the conditions are true. But I'm struggling to design a script that works like that. After a lot of searching and trying I came up with this, but it doesn't work: _incomeCount = -1; _limit = 4; while {(_incomeCount) < (_limit)} do { if (triggeractivated four_bluforcaptured) then { cash = cash + 2000; _incomeCount = _incomeCount + 1; sleep 60; } }; The script is run at mission start from the init.sqf. What it tries to achieve is that once the trigger "four_bluforcaptured" is true, a timer will start and "cash = cash + 2000" will be run every 60 seconds, for 4 loops, and then come to a complete stop with a new message.
  10. _nul = [Dave,1] remoteExec [ "removeaction", 0, true ]; //Remove action for all clients and JIP Still not sure about how it works exactly, but I think this did it. Responded as fast as I could. :)
  11. Hello! Hope you're having a good day, and thanks for wanting to help someone. :D I've read the remoteExec page but I can't understand how to structure a normal command like "dave removeaction 0" inside a remoteExec. How would I transform this into a "removeaction 0" instead of removeallactions? I'm totally green on these commands. _nul = NPC1 remoteExec [ "RemoveAllActions", 0, true ]; //remove action for all ______________________________________________________________________________ My full script for anyone interested (in case anyone wants to show me a better way to build the whole thing for MP, but not required reading for answering the question): if (cash < 12000) then { hintSilent parseText format["<t size='1' color='#00FF3C'>You don't have enough money</t>", d]; } else { cash = cash - 12000; _nul = Dave remoteExec [ "RemoveAllActions", 0, true ]; //remove action for all //"TALK" Dave say3D "Dave"; Dave setRandomLip true; sleep 3; Dave setRandomLip false; buytruck setVehicleLock "UNLOCKED"; hintSilent parseText format["<t size='1' color='#00FF3C'>Received keys for military truck</t>", d]; } }; The above script is called in multiplayer from the NPC's init: this addaction ["Buy Military Truck for $ 19000", {"scripts\npc\talk_dave.sqf" remoteExec [ "BIS_fnc_execVM",2 ] }]; Thanks!
  12. I have no friggin idea why, but it works exactly opposite of intended. The second blufor captured a city, the spawning starts there, and the target marker moves to the opfor city infront. What's wrong here? _________________________________________________________________________________________ UPDATE: I FIXED IT. I had two "seized by" triggers overlapping, and they were being used in the conditions of one script. I assumed they would show OPFOR - captured by at the same time, thus making them reliable as conditions for my script, but it turns out that these two triggers, though completely aligned, were totally random with what they condiered someone conquering that sector. Lesson: If you're gonna used Seized By triggers, don't use two opposite ones to control an area. They will never agree on who's actually seizing the area.
  13. while {triggeractivated four_OPFORCAPTURED && !triggeractivated airbase_OPFORCAPTURED} do { "attackspawn_middle" setMarkerPos getMarkerPos "spawnguard_four"; "attacktarget_middle" setMarkerPos getMarkerPos "spawnguard_airbase"; sleep 5; }; Not working at all. Is it the { } instead of ( ) ? Noob scripter, started recently. Thanks!
  14. I see! This is what I had initially. I tried the IF thing inside the WHILE, but it seemed to just mess up, almost like it was checking for the opposite.. I will try it again and get back here if I fail. :)
  15. No, not at all, thanks for the suggestion though. :) Oh, wow, I've tried explaining this one time already and was not successful. I have 5 scripts constantly checking if conditions are true, to spawn soldiers in one camp and send it to the next, if the first camp is theirs and the next camp is not theirs. So this is one of those five scripts. It doesn't matter if two of them return true at the same time. Summary: The script needs to check if triggeractivated four_OPFORCAPTURED && !triggeractivated airbase_OPFORCAPTURED}; constantly thoughout the mission, every 5 seconds, and when its true, move the markers as seen above. The goal is that if any one of the cities is captured by opfor, and the one in front is captured by blufor, it will move the spawning marker to the opfor city and the target marker to blufor city. There is only one each of the target and spawn markers.
  16. Hello :). I hope someone can help me with this, as I haven't found any clear answers by searching. There are several areas scattered around the map where opfor units might wander off and get stuck, clogging the server. I want to cleanse them. imaginaryscript.sqf For each of the 8 areas, I want to do the following: If opfor units are in area_X, and blufor units are not in area_X, delete units of the side EAST in area_X. Loop every 10 seconds. right now I just have a silly trigger with action: {deleteVehicle _x} forEach thisList; condition: (this (opfor present)) && (!triggeractivated airbase_bluforpresent) But it's totally random and overall bad. :b:
  17. lol, I will admit it, when I first discarted EOS and thought "nah, I'm big enough to take on this myself!" I may have been a bit overconfident due to recent advances. It's really, really damn hard to make a coherent spawning system, no doubt. The problem is that EOS doesn't fit the kind of map I want to make at all, so I'm kind of forced to make my own.. I'm willing to pay someone right now to make it. The trigger didn't work, Davidoss.
  18. knowsAbout actually comes into play at 1.5 and goes to 4 as f2k said, which is complete knowledge. After some time, it drops to half, then goes away after 110 seconds. "east knowsAbout player >= 1.8" -stuff "east knowsAbout player >= 2.3" -stuff --for instance, works great as a condition for stealth missions. If you simply use "detected by" in the trigger, the AI will know about someone the second they have any information about them. Tune the knowsabout to your liking.
  19. Hey, thanks for clicking on a noob's thread :). So, disclaimer: I'm not good with coding, but I've tried and read everything before I posted this, for many hours. This will probably take some of you gurus out there just one minute. I'll try to boil it down before I draw the whole picture below. I have six cities on a side, which I use to move two markers between. And attack and a spawn marker. The spawn marker is always moved to the closest friendly city. The attack marker is always moved to the closest enemy city. I have triggers in each city detecting when a city changes side from friendly to enemy (condition in the script could be: triggeractivated x). I've been trying to build a script, and even doing it by triggers. This is above my understanding, and I've read a lot and experimented trying to get it to work, but alas.. :803: It's confusing to explain so I drew this masterpiece in paint :wub: : I have read all about IF, conditions, and all the commands but I don't know how to pick between this many complicated options in a script. I started scripting not too long ago and have been stuck on this all day.
  20. I have no idea what you just did, but I am in awe. Testing and using it in every way I can (though I have NO idea how to)! :D (if anyone is writing the "marker closest to" thing standalone, please don't hesitate to post it, it's super helpful) UPDATE: In the end, I solved it (for anyone understanding the challenge) by having scripts for each sets of 2 cities. The script checked if City 1 was friendly and City 2 was hostile, and then moved the two attack_spawn, and attack_target markers in a loop. This way the Attackers described above, were always attacking towards the enemy. A little rough but it works. I'm making a Jagged Alliance map for eventual fans. :)
  21. Thanks guys, and I get it :) . I think I found a simpler way to boil this down. All I need is a simple marker-movement system. 1. Create a list of markers A, B, C, D, E, F and G 2. Find the marker on the list closest to marker0 3. Move marker1 to THAT MARKER (edited, so sorry, messed up the logic) Loop point 2 and 3. :D (I really hope some coding wiz can solve this cause I've been stuck for 10 hours) (Even simpler still, maybe I can figure it out with just this information: Just explain how to find the marker from a list of markers which is closest to another marker.)
  22. Hello! ;) I have been struggling with this one challenge for a long time, I'd be super thankful if anyone could help me with. I'm making a Jagged Alliance map, and it's looking really good despite my lacking skills. I'm trying to accomplish what it says in the title, preferably I'd want this script(s) to: Delete items from all killed OPFOR units (spawned and otherwise) The killed AI then spawns a random item on the ground instead, from a pool of items defined in script notatallwhatiwanted.sqf //DELETE GEAR {_x addeventhandler ["killed",{ _this spawn {_unit = _this select 0; removeallweapons _unit;removeallassigneditems _unit;removeheadgear _unit;clearmagazinecargo _unit;sleep 60; deletevehicle _unit}; }]; } forEach allUnits; I really hope there is some way to do this, it would be a saving grace for my mission :b:
  23. Thanks but, ehm, I'm pretty sure this doesn't work for spawning items, but is for actual vehicles?? :huh: _randomItem = createVehicle [["16Rnd_9x21_Mag","9Rnd_45ACP_Mag"] call BIS_fnc_selectRandom,position _unit,[],0," CAN_COLLIDE"]; UPDATE: This seems to work but only spawns one.. _randomitem addWeaponcargoglobal [["launch_RPG32_F", 1],["srifle_DMR_01_DMS_F", 1]] call BIS_fnc_selectRandom; Tried this but didn't work =( _randomitem addWeaponcargoglobal [["launch_RPG32_F", 1],["srifle_DMR_01_DMS_F", 1]] call BIS_fnc_selectRandom; //_randomitem addWeaponcargoglobal ["launch_RPG32_F", 1,"srifle_DMR_01_DMS_F", 1] call BIS_fnc_selectRandom;//fail Found it. This works instead of what barbolani posted (for anyone looking in the future)! EDIT: I got it Barbolani, I made items on their uniforms instead, easier to find, thanks again :)
  24. Thanks all so much!! I'll stop posting in this thread now until I've tested everything and read through everything you've so kindly shared. Thanks again, Barbolani for that correction. Checked out your Antistasi, amazing work. Hope I'll be able to do something similar one day. Now for the testing.. ____________________________________________________________________________ UPDATE: I finally get to do this... :lol: ehem... Excuse me barbolani but should be :D
  25. Thanks guys! Writing this from my phone but will test it when i get home. Oh yes, barbolani, i learn so much from this, for example i just learned how to do random loops and random numbers :D, hope it works! Still hoping someone could show me how to spawn random items on dead bodies :)
×