Jump to content

Daemios

Member
  • Content Count

    16
  • Joined

  • Last visited

  • Medals

Community Reputation

10 Good

About Daemios

  • Rank
    Private First Class
  1. So is there no way to differentiate between players from the DS perspective? I need to run a script on the client AND DS and then pass information between the two? Edit: To get specific, say I want to add an objective for a player. Must I separate that part of the script and run it from the JIP client?
  2. I've been slowly working through the project and I seem to be learning something new each day, but something I'm having trouble wrapping my head around is player in a dedicated environment. I have been, rather foolishly, scripting and using my editor to debug the code. I just recently read a post about something, I forget what, when I read: "Probably unrelated to your problem, but player is always null on dedi server, so making alive checks or getting position might not be the best thing." And that really was a tough thing to accept for me, because I've been spending weeks on this project, and player is in a lot of my code. Here are my questions: Does that mean player is always null, no matter what, or does it mean that the dedicated server as an entity has no player object? If it means the latter, how do I reference a specific player? I have the ability to request randomly generated side-missions in my growing library of scripts, and I'm not sure how to make the transition to giving a specific group or side. Is it as simple as if (side == _oneSide) then {}; In a more distilled question, how do I reference the specific player who uses, say, an action that was added to a friendly NPC? If referencing player in every way isn't possible, how the hell do I do something like that? As always, I appreciate any help on the matter. I've looked around for the answer, but couldn't find anything. I've been reading http://killzonekid.com/category/tutorials/ and they've been immensely helpful, but they aren't comprehensive.
  3. Awesome! Thanks again. F2k and Taijin, you guys are both excellent. Thanks for supporting the community like this, I know there's at least one person who appreciates it!
  4. No errors, unfortunately. I did manage to get it partially working. I used the spawn function vs the call function. However, it still doesn't work the first time the script executes. I can call the first script once and it wont spawn the Land_HBarrier_5_F that it's supposed to. I can then move away from that spawn (or not) and call it again and it works fine. Thoughts? Edit: I haven't done much with modelToWorld yet, but really I use attach here to fit each piece perfectly to each other. It works, so it works for me. As per your last post helping me, I definitely have started taking a look at modelToWorld more.
  5. I'm running into an issue where two of the same functions I'm calling refuse to place nice together. Whatever I do, it will only ever call the second one. This is my first time using a function like this, so I'm sure I'm doing something horribly wrong, but I would appreciate any pointers as to why this isn't right. _placePos = _this select 0; //Example: //_n = [(getpos player)] execVM "hq\lib\fuel\lib_refuelAlpha.sqf"; //Useful: //_placePos = (getpos player); fuelAlphaSpeaker setPos [((_placePos select 0)-3),((_placePos select 1)-6),0];; // HQ fuelAlphaMain = createVehicle ["Land_Cargo_HQ_V2_F",(_placePos),[], 0, "CAN_COLLIDE"]; fuelAlphaMain allowDamage false; fuelAlphaMain setDir 270; // Towers fuelAlphaEnterTower = createVehicle ["Land_Cargo_Patrol_V2_F",[((_placePos select 0)-2),((_placePos select 1)-30),0],[], 0, "CAN_COLLIDE"]; fuelAlphaEnterTower setDir 0; fuelAlphaSideTower = createVehicle ["Land_Cargo_Patrol_V2_F",[((_placePos select 0)-25),((_placePos select 1)+15),0],[], 0, "CAN_COLLIDE"]; fuelAlphaSideTower setDir 135; // Military Misc fuelAlphaSpeaker = createVehicle ["Land_Loudspeakers_F",[((_placePos select 0)-3),((_placePos select 1)-6),0],[], 0, "CAN_COLLIDE"]; fuelAlphaSpeaker setDir 0; sleep 1; //N2 After 5m Break [ [((_placePos select 0)+5),((_placePos select 1)+19),0], 0, "Land_HBarrier_5_F", 1, 5.5, 0, 0 ] call bad_fnc_objRepeat; [ [((_placePos select 0)-20),((_placePos select 1)+19),0], 0, "Land_HBarrier_5_F", 3, 5.5, 0, 0 ] call bad_fnc_objRepeat; Here's the function itself: bad_fnc_objRepeat = { private ["_start","_obj","_objPos","_objDir"]; _start = createVehicle [_this select 2, _this select 0,[],0,"CAN_COLLIDE"]; _start setVectorUp [0,0,1]; _start setDir (_this select 1); _start setPosATL (_this select 0); for "_i" from 1 to (_this select 3) do { _obj = createVehicle [ _this select 2, _this select 0, [], 0, "CAN_COLLIDE"]; _obj attachTo [_start, [ _i*(_this select 4), _i*(_this select 5), _i*(_this select 6) ]]; _objPos = getPosATL _obj; _objDir = getDir _obj; detach _obj; _obj setPosATL _objPos; _obj setDir _objDir; }; }; I've tried adding a sleep in between them, to see if it was some sort of speed issue. No luck.
  6. Ok, I spoke to soon. I changed the code to: op_hq_solarArray1 = createVehicle ["Land_SolarPanel_1_F",[((_placePos select 0)+3.5),((_placePos select 1)-6.55),((_placePos select 2)+16.5)],[], 0, "CAN_COLLIDE"]; op_hq_solarArray1 setDir 180; And it still clips into the wall. What am I doing wrong? Edit: Again, http://i.imgur.com/BZnvGr7.jpg is what it should look like. http://i.imgur.com/Tz6kTdl.jpg is what spawns. I can achieve the first picture by simply typing: _placePos = (getpos op_hq_tower); op_hq_solarArray1 setPos [((_placePos select 0)+3.5),((_placePos select 1)-6.55),((_placePos select 2)+16.5)]; into the console. Not understanding why it doesn't want to spawn properly. Edit 2: Honestly it feels like there's some sort of improper reference somehow, but I tried sleeping to make sure the object was fully "there" just in case, and that didn't work. I don't understand how the script can do the exact same thing that I do in console and come up with a different result.
  7. I'm having a heck of a time trying to figure out a problem I'm having. I'm working on a script that spawns a group of objects into a base. I'm using a single object to create the "center point" so to speak, like so: _placePos = (getpos bluAlphaMain); I then use something like: bluAlphaEnterTower = "Land_Cargo_Patrol_V2_F" createVehicle (_placePos); bluAlphaEnterTower setPos [((_placePos select 0)-2),((_placePos select 1)-30),0]; Now, I realize that the second line there is redundant because I can do that in the spawn, but this allows me to use the debug window to place objects rapidly and edit them into proper position. My problem is when I use something like that to spawn an object, it will place it at a nearby-but-not-perfect position. This is especially apparent if I want to spawn objects that look "attached" to a building, like solar panels. Here is a perfect example of a few scripts that seem like they should work but for some reason don't. Keep in mind that if I copy the code directly from the script and run it in the debug window they are placed exactly where I want them. "Main" Script: // Generate Spawn _marker = createMarker ["respawn_east", (getPos op_hq_tower)]; sleep 0.1; // Hold position to spawn cleanly _placePos = (getPos op_hq_tower); // Cleaup Box deletevehicle op_hq_tower; // Create the Building op_hq_tower = "Land_Cargo_Tower_V3_F" createVehicle (_placePos); op_hq_tower allowDamage false; _units = [] execVM "hq\opfor\structures\tower\units\units.sqf"; Then the "units" script: _placePos = (getPos op_hq_tower); op_hq_solarArray1 = "Land_SolarPanel_1_F" createVehicle (_placePos); op_hq_solarArray1 setPos [((_placePos select 0)+3.5),((_placePos select 1)-6.55),((_placePos select 2)+16.5)]; op_hq_solarArray1 setDir 180; op_hq_solarArray2 = "Land_SolarPanel_1_F" createVehicle (_placePos); op_hq_solarArray2 setPos [((_placePos select 0)-3.25),((_placePos select 1)-8.7),((_placePos select 2)+16.5)]; op_hq_solarArray2 setDir 180; The end result ends up looking like this - http://i.imgur.com/Tz6kTdl.jpg Am I going about this all wrong? What's the problem here?
  8. I'm confused as to why this piece of code doesn't work entirely: op_hq_techBack1 = "O_UAV_01_backpack_F" createVehicle (getpos op_hq); op_hq_techBack1 allowDamage false; op_hq_techBack1 setPos [((getPos op_hq select 0)-3.75),((getPos op_hq select 1)-7.288),((getPos op_hq select 2)+10.25)]; op_hq_techBack1 setDir 270; op_hq_techBack1 setVectorUp [0,2,0]; It spawns the backpack, and if I do something like the following code, it will give me a position. _t = getPos op_hq_techBack1; player sidechat format["%1", _t]; But I cannot use setPos, and I cannot do deletevehicle op_hq_techBack1; And have the actual backpacks be deleted. Am I not understanding some sort of rule about stuff like this? My ultimate goal is to add these to be part of a base that gives a player a sense of progression by unlocking specific pieces of it. The backpack is supposed to be hanging on the wall.
  9. I'm specific issue is that I'm attempting to add backpacks to a wall they'd be "hanging" on and then generate new ones based on whether they were there or not the next time the loop iterated through. My problem, and general confusion, is that I'm unsure how the player inventory system operates in references to things like this. If I named the backpacks something static (like back1, back2, ..., back99) would the game still keep that name on the object even once a player was wearing said backpack? I imagine if it does, I could just use something like: if ((getpos back1) != back1_spawnPos) then { //Regen Backpacks for each missing. sleep _cooldown; }; But if it doesn't, how would I be able to determine they're missing? To further complicate it, how does the game handle UAV backpacks? When I unpack a UAV and then repack it, does the backpacks name stay put?
  10. Thanks F2k! If it's not too much trouble, could someone explain exactly why that works? I feel like I'm not understanding the core concept of a namespace. Perhaps someone could refer some related reading? I'm sure I'm going to have to do a lot of this sort of thing, and while I understand what is going on in this specifc example, I'm not sure I grasp how to determine when I should recognize when I should or should not declare something like that. What makes that command different than, say, removeAllWeapons _unitCritical; This is what I think I know: Those trigger commands never look at anything besides what exists in _trg. I should consider _trg a entirely separate section of code. Is the same true for for/ifs? Or nested for/ifs?
  11. Is there a way to declare the variable inside that trigger? I'm self-taught with this sort of stuff, but if I declare it globally wouldn't that interfere if I wanted to call this script twice and have it run in parallel to itself? I.e. having two missions of the same type running independently of, but simultaneously with, each other.
  12. Two questions regarding your response. 1) Wouldn't that just make him join my party the second he spawns? If the trigger was activating, it would put _unitCritical (the unit that's being captured) immediately into my group. 2) I have the condition "player in thislist" which should stop the unit from activating the trigger himself, no? Bonus Point: I have the hints debugging the activation, and I can say with certainty that the trigger itself is fuctioning in a way that appears to be correct. When I approach the unit, the hint pops up telling me I'm close enough. When I leave that area, it tells me I'm not close. For some reason, it's just not executing that first piece of code that makes the unit joinSilent. I've tried joinAsSilent too. No dice.
  13. Hey, I'm having a heck of a time trying to figure out why this wont work. I have a script that is supposed to generate a "mission" dynamically for the player. Everything works, except for one, small problem. In the mission, the player is required to capture an informant and bring him back to one of a series of areas. The problem? I can't figure out why the activation I've specified isn't working when I get close enough. I've put a debug hint in there and I'm sure the trigger itself is working, but when I apply the code to joinSilent on the players squad, it just kills the script. I've gone over the wiki, googled for what seems like years, and still I can't find any reason why it wont work. I would absolutely love anyone who could tell me what's wrong here. I have a feeling that my variables aren't being properly referenced there, but I don't know how else it would look, and I haven't seen any documentation to confirm it. I'm wondering if there's some sort of syntax I'm forgetting to adhere to when using a function is inside of that script string. // +--------------------------------------------------------------------------+ // | Informant mission for critical type | // | Capture the informant for your faction | // +--------------------------------------------------------------------------+ // | Filename mission.sqf | // | Author(s) Daemios | // +--------------------------------------------------------------------------+ _missionPos = _this select 0; _name = _this select 1; _faction = _this select 2; _radius = 800; // max limit of random area to set markers // CREATE NAME _mission_name = [_radius, _missionpos] execvm "missions\lib\lib_mission_GenerateName.sqf"; // Who the "friendly" faction is in this mission; random chance per mission // 0 = blue, 1 = op //_friendly = round(random 1); // CREATE ELLIPSE _ellipse = [_radius, _missionpos] execVM "missions\lib\lib_mission_EllipseZone.sqf"; // CREATE UNIT TO CAPTURE _group = createGroup west; _unitCritical = _group createUnit ["B_Helipilot_F", [_missionpos select 0, (_missionpos select 1)+2], [], 0, "FORM"]; _unitCritical setCaptive true; _unitCritical disableAI "MOVE"; removeAllWeapons _unitCritical; "badguy" setMarkerPos (getPos _unitCritical); _trg=createTrigger["EmptyDetector",getPos _unitCritical]; _trg setTriggerArea[5,5,0,false]; _trg setTriggerActivation["ANY","PRESENT",true]; _trg setTriggerStatements["player in thislist", "[_unitCritical] joinSilent (group player); hint'close'", "hint 'not close'"];
  14. Daemios

    =BTC= Revive

    This is easily one of the most necessary mods for our server. Keep up the good work!
×