Jump to content

wok

Member
  • Content Count

    183
  • Joined

  • Last visited

  • Medals

Everything posted by wok

  1. I am working on some scripts and I need to detect when you are aiming at an enemy. I did some research and found cursorTarget and sideEnemy. But I am not sure how to use it, I think the login (not actual code) would be something like: if (side cursorTarget == sideEnemy) { hint "test"; }; But how would I run that all the time? I mean, the code needs to be checking contanstly and show the hint if aiming at an enemy, do I need to use a loop, trigger or something like that? Where would I put the code? Sorry for the noob questions, any advice will be appreciated.
  2. So I downloaded the tools, after playing for a while and watching some basics tutorials I come to the conclusion that i have no idea what I am doing :P I did found some tuts, but they are all mostly for hand animations for weapon addons, or for customizing the look of the player. And the other animation tutorials I found are for Maya or other software, is it required to use an application like maya or 3dmax or can all be done with the bi tools? I was wondering if someone has a tutorial for creating a player animation, something like the simple salute animation or one of the gestures, from 0 to getting it ingame.
  3. I have been testing the drawIcon3D command, here's my test code: onEachFrame { { drawIcon3D ["", [0,1,0.5,0.4], [getPos _x select 0, getPos _x select 1, 2], 1, 1, 45, "", 1, 0.03, "default"]; } foreach allunits; }; I have two questions: 1) Is it possible to have arrows on the sides of the screen pointing at the icon direction when you are not looking at it? Sort of like what you see with squad members, or waypoints. 2) Is there any way to make the icons movement smoother? The squad hexagon looks much smoother than drawIcon3D icons. EDIT: Solved (2) using visiblePosition instead of getPos.
  4. I haven't received any pm so I am replying here, here's another related thread with some snippets that try to solve some issues: http://forums.bistudio.com/showthread.php?168525-Calculating-point-in-circle-circunference-gives-always-same-result I don't have my gaming pc running so I can't search for my test missions, I will try to connect that hdd later and dig them out. If I don't remember try sending me a pm.
  5. Took me a while to figure out I had to place the waypoint exactly where the heli name was appearing when mouse overing it, otherwise it would act as a MOVE type and just walk near it. It still does a huge unnecesary turn around the chopper but it works. Thanks a lot guys.
  6. I am trying to make an AI unit walk next to a heli on the pilot side and get in. I know I can make him get in with unit action ["getInPilot", targetVehicle] Now, the problem I am having is moving the unit to the correct position next to the heli on the pilot side, I tried MOVE waypoints (wanted to try the GET IN type but don't know how to set it to get in the pilot position) and doMove, also tried placing a helper to mark the position instead of moving it to the heli position. But the AI always stops a few meters away from the chopper. I wouldn't care if this was in the middle of the mission, but it's for a cutscene so I want it to look as good as possible. So how could I make the AI move to an exact position? Like the position he takes right before getting in the chopper when executing the "getInPilot" action.
  7. player switchMove "Acts_welcomeOnHUB01_PlayerWalk_3"; Works for me, but I would still also like to know other method of moving the player for interactive cutscenes, like doMove for AI, they doesn't seem to work for player.
  8. I am trying to attach a helmet onto a table, but I dont like that the visor part points down when I do this, so I was trying to use setVectorDirAndUp to rotate the helmet. For example: _table = "Land_CampingTable_F" createVehicle position player; _helmet = "groundWeaponHolder" createVehicle position _table; _helmet addWeaponCargo ["H_PilotHelmetHeli_B", 1]; _helmet setVectorDirAndUp [[1,0,0],[0,-1,0]]; That works for rotating the helmet, but when I add this: _helmet attachTo [_table, [0,-0.5,1.15]]; The helmets has always the same position with the visor pointing down. Am I doing something wrong? Or is there a limitation with certain objects, because if I attach it to the player then the helmet keeps the rotation I set with setVectorDirAndUp.
  9. I am working on a mission that starts with a cutscene, the player starts sitting in a chair (attachTo it). I want the player to be able to free-look around. The only way I found is to detach it, and since the player is locked on the sitting animation set by switchMove, this works well as long as the player only uses free-look, if he moves the mouse without free-look his position changes and he will snap out the chair and be sitting in the air. The problem is that the game starts without free-look activated by default and I can't find a way to activate it via scripts. Does anyone knows a way to trigger free-look via a script?
  10. I am actually doing that, I just separated the attachTo on the sample code to show that the rotation was working without it. This is my test code: _table = "Land_CampingTable_F" createVehicle position player; _helmet = "groundWeaponHolder" createVehicle position _table; _helmet addWeaponCargo ["H_PilotHelmetHeli_B", 1]; _helmet attachTo [_table, [0,-0.5,1.15]]; _helmet setVectorDirAndUp [[1,0,0],[0,-1,0]]; I tried different numbers on setVectorDirAndUp, but the rotation of the helmet never changes once attached. EDIT: The problem must be the table, I found a workaround, I placed a pointer (helper) and attached it to the table, then spawned the helmet on the pointer position and rotated it. That keeps the helmet rotation, now just need to figure out the right position where to attach the pointer so the helmet looks like its resting on the table. EDIT2: The pointer method didn't work because I wasn't able to set the right Z position, so I just used enableSimulation false + setPos, I don't know why I didn't use that from the beginning, I've used it before.
  11. I am working on a mission and the player will start sitting on a chair. I am using this to make him sit: [player, "SIT_AT_TABLE", "ASIS", chair1] calls BIS_fnc_ambientAnim; It works fine, but I have a few questions: 1) Is it possible to let the player still move his head (like while holding alt) when using the ambientAnim? 2) How do I give the player the control back? because ambientAnim kinda disableUserInput, (esc, map, compass etc still works). 3) Is there any built-in animation to stand up from the sit anim?
  12. You can check that here, that script is called on init.sqf with execVM.
  13. I remember seeing this working somewhere in the past, but can't get it working myself. I am trying to attach a backpack to a players hand. I tried with the sample code from the wiki just replacing the classname like: _bp1 = "B_AssaultPack_blk" createVehicle position player; _bp1 attachTo [player, [-0.1,0.1,0.15],"Pelvis"]; I though that maybe spawning the backpack may be the problem, so i tried placing a backpack on the editor and referencing it by its name like: bp1 attachTo [player, [0,0,0]]; Also tried attaching the backpack to another object that is not the player, like a table, but that didn't work either. So, is not possible to use attachTo with backpacks? Is there any workdaround that doesn't involve addons?
  14. Thanks a lot! I wasn't expecting to get a reply on this thread. I guess I should also thank thetrooper for bumping it and mattar_tharkari for the points list.
  15. I have managed to use kiory's tutorial to get his sample animation from 3ds max into the game. Now I am trying to do my own stuff, I have a 750 frames animation in 3dsmax that I am trying to get into the game. The problem is that in the game, the animation plays extremely fast, like 1 or 2 seconds, and I want it to be around 10-15 seconds. I can control the speed in buldozer with the [ ] keys, but no idea how I set the speed for the in-game animation. I tried both autotime and autotime 1.0 in Oxygen2, both give the same super fast animation result in-game, and if I dont use autotime the animation wont work, the player just stays for a second in the T-pose and then goes back to normal. I tried playing around with the "time range" option but I don't know what it does or how to use it, it didn't do much. I would post the files but I have other problems with the animation like the mesh getting messed up or the pelvis not moving at all (which doesn't happen on 3dsmax), but I want to solve this issue first before moving into that. How do I set the speed/time range of the animation that will be played in the game? ---------- Post added at 01:41 ---------- Previous post was at 01:27 ---------- Oh f@#k me!, I spent like one hour trying to set this on Oxygen2, didn't think about looking at the config file. Let's blame tunnel vision so I don't feel so dumb. Sorry for this thread, if a mod wants to remove it, go ahead.
  16. Hey thanks a lot for the info, with the help of kiory I was able to use his tutorial and get an animation in game, I still find it quite difficult to make a good animation but thats probably because I don't know how to use 3dMax, the only knowledge I have comes from an autocad course I did 10 years ago.
  17. Are you running this code in a .sqf or a .sqs file? Also always check your .rpt log file for errors, in Win 7 its in :/Users/youruser/AppData/Local/Arma 3/
  18. Since I can't add custom items to the inventory (without addons), not even objects like the antibiotics, blood bag and all those Objects (small) recently added, I am thinking about doing some dialogs to fake a few inventory slots for some of these items. I have the dialogs done, but I don't know how to trigger the open/close dialog when the inventory opens and close. I couldn't find a event handler for this. Does anyone knows a workaround?
  19. Have tried a few different things like using createDialog in the rsctitles onLoad to open a separated dialog, but that also stops the inventory from opening until you close the dialog. Also tried using execVM instead of using createDialog directly on the rsctitles onload, so I could use sleep and make sure the inventory was already open, but then the inventory closes when the dialog opens. I will keep trying for a few days but I guess I will end up using addAction for the items options. Thanks a lot for the help anyway iceman. KevsnoTrev, thanks for the suggestion but I am trying to use scripts only, no addons. With addons it shouldn't be too hard, I think dayz does something like that too. A "solution" I was thinking about is adding a mouse click event handler to the main display like: (findDisplay 46) displayAddEventHandler["onMouseButtonClick", "hint str _this;"]; And then calculate if the coordinates where the click happened are the same position than the fake slots, that does fires when clicking even with the inventory open, but the coordinates always return 0.5, 0.5. And I think it would be a pain in the ass to make it work across all resolutions/aspect ratios anyway.
  20. Thanks a lot, the problem I am having now is that, if I use createDialog to open the dialog, then the inventory wont open until I close the dialog (with esc), and I need both the inventory and my dialog to open at the same time since I am not handling the entire inventory, just a few fake slots. The inventory opens fine if I use RscTitles and cutRsc instead, but that gives me a different problem. I want to open some sort of contextual menu when clicking on the fake slot, and display some options on a listbox. When using createDialog, the mouse event handlers (im trying to use onMouseButtonClick) work well, but when using cutRsc the click event doesnt fire anything. Will see if I can create a sample later, my current code is too messy right now.
  21. wok

    Carbomb

    You could just make defuse.sqf set a global var like defused = true; and in carbomb.sqf you check for that var, if( defused == true ) then { exitWith{}; };
  22. Looks pretty nice, I was wondering if that laptop item could be used with setObjectTexture or for PiP stuff, so we can display a custom screen, that would be awesome. Didn't have time to look into it.
  23. I would use the positionCameraToWorld method (+ an image with 50% empty space) just because it keeps the icon centered even if you aim at the sky, with screentoworld when you aim above the horizon (where there's no land), the position wont be where the player is aiming. The movement doesn't look 100% smooth, but neither it does when using screentoworld. But since I am not sure I fully understand what you need this may not be the perfect method for you. I think the size is 1 : real icon size, 2 : double size, etc, so 5 would be 5 times the real icon size. I am using killzonekid method too to use paa files on a mission, it works well. And I think he got banned because he downloaded a leaked version of dayz (and he said he did it here in the forums).
  24. Can you show a screenshot of the problem? Or some code to reproduce it.
  25. Try SatchelCharge_Remote_Ammo instead. Edit: I tried your code with SatchelCharge_Remote_Ammo but I couldn't get it working anyway, the only way I was able to make it work is with setDamage, like this: _chopper = "O_Heli_Light_02_F" createVehicle (position player); _chopper setFuel 0; _chopper lock true; _chopper addEventHandler ["HandleDamage", { hint format["Projectile: %1\nDamage: %2", (_this select 4), (_this select 2)]; if ((_this select 4) == "SatchelCharge_Remote_Ammo") then [{(_this select 0) setDamage 1;},{0}]; }];
×