

SilverRanger
Member-
Content Count
108 -
Joined
-
Last visited
-
Medals
Everything posted by SilverRanger
-
try this one
-
quick help with script (Addaction)
SilverRanger replied to EACC's topic in OFP : MISSION EDITING & SCRIPTING
not sure if what you want can be done... the problem is that you assign the action to the unit's vehicle NOT the unit itself _Act = [color="Blue"]vehicle _player addaction [/color]["Pull out Player from vehicle", "Pullout.sqs"] and so _Player = _this select 0 will not return the unit inside the vehicle, but the vehicle the unit is riding in there is a possibility to exploit a bug in OFP that retains the action assigned to a unit even if the unit is inside a vehicle, but that's not 100% certain... -
How to script a unit to never lie down or crouch?
SilverRanger replied to Rigel's topic in OFP : MISSION EDITING & SCRIPTING
mySniper setunitpos "up" => this will keep the unit standing mySniper disableAI "move" => this will keep it from moving -
if the location you need to escort the VIP is for instance your 2nd waypoint add a trigger somewhere use this condition: !(alive VIP) activation: [group player,2] setwppos (getpos (vehicle player)) this will place the 2nd waypoint directly above your unit and thus activate it
-
I'm having some trouble understanding why the magazines command returns an array that doesn't seem to function properly. I'm writing a small script that needs to count the number of a specific magazine, but the magazines array, while formated properly, doesn't seem to work I did a quick search in the forums but couldn't find any relevant posts so I wrote this script to test it _magazines = magazines player hint format ["%1",_magazines] _handgrenades = "handgrenade" count _magazines _string = format ["%1",_handgrenades] cuttext [_string,"plain down",1] ~1 ? "handgrenade" in _magazines : hint "player has handgrenades" the hint box correctly shows all magz the player holds, but the _string returns a 0 even though the player has handgrenades on him. in _magazines doesn't seem to work either am I doing something wrong? is there a workaround to this problem?
-
I have already considered the ammo command, but it's not reliable for my purpose the "throw" weapon uses both handgrenades and smokeshells as mags so if you have 0 handgrenades and 1 smokeshell, the script will return 1 and 1, while "throw" ammo player will return 1. I need a way to tell if the given unit is carrying more handgrenades or more smokeshells. I already wrote a simple config to add two separate throw weapons (1 for grenades and 1 for smokeshells), but I now need to add more grenade types and I really don't want to be adding more throw weapons for each new type...
-
you my friend are a god damn genius! :notworthy: it worked! :D however, I now have a more disturbing problem... when I throw all my handgrenades, the script still returns 1! oddly enough, it returns 0 if I just drop them :( _magazines = magazines player hint format ["%1",_magazines] _handgrenades = {_x == "handgrenade"} count _magazines _string = format ["%1",_handgrenades] cuttext [_string,"plain down",1] any thoughts?
-
my problem is not how to display the result, but the result itself "handgrenade" count magazines player returns 0
-
I think he wants to adjust the init speed of the bullet so it can reach further
-
Sapper released a Zil-157 pack that has an armored version of the truck with an attached Dshk machinegun
-
Map Click Movements for Units??
SilverRanger replied to Blitzen's topic in OFP : MISSION EDITING & SCRIPTING
yes, yes and yes :) the onMapSingleClick command works like any other command line. think of it as an init line or like calling a script. once you define it, you simply click on the map and the command executes whatever code you put between the quotes for instance onMapSingleClick "invisibleH setpos _pos ; [Helo6,1] setWPpos _pos , [Helo6,2] setWPpos _pos ; [Helo6,3] setWPpos _pos ; player setdammage 0 ; skiptime 5 ; ...etc" -
Map Click Movements for Units??
SilverRanger replied to Blitzen's topic in OFP : MISSION EDITING & SCRIPTING
this is what you are looking for... example: onMapSingleClick "[Helo6,1] setWPpos _pos" -
http://forums.bistudio.com/showthread.php?p=1812233#post1812233
-
I can think of a couple of more, but again not defined for east side UKF Landrovers and Operation Frenchpoint Vehicles Pack have very nice looking models. also the Swedish Forces Pack contains a large selection of vehicles, but it's a huge pack to download if all you need is a couple of armored cars.
-
there is the Otocar Cobra from the Turkish Union addons, but I can't remember if it is for east or west side. there are of course a bunch of BRDM addons you can try if that's what you are looking for...
-
I'm trying to separate the grenade throwing action by adding 2 new "throw" weapons, one for hand-grenades and one for smoke-grenades. this is my config class CfgWeapons { class Default {}; class GrenadeLauncher:Default {}; class Throw:GrenadeLauncher {}; class ThrowGrenade:Throw { magazines[]={"HandGrenade"}; }; class ThrowSmoke:Throw { magazines[]={"SmokeShell","SmokeShellRed","SmokeShellGreen"}; }; }; the problem is that when I try to add either one of the weapons to a unit, I get an error saying the weapon is not defined I copy pasted this into another completed config, and it worked fine. what am I missing?:confused:
-
thanks for the replies it appears my stupidity has wasted everyone's time :( I forgot to add the damn cfgPatches :banghead: :banghead: :banghead:
-
No, it doesn't, but I don't think it's necessary to define the grenades again as they are already defined inside the BIS config.cpp. Besides, the error message says the weapon class is not defined... I'm probably making a stupid mistake somewhere, but I just can see it :confused_o:
-
High Dispersion by Script
SilverRanger replied to -Snafu-'s topic in OFP : MISSION EDITING & SCRIPTING
I have a question some time ago I tried to write a similar script, but when I tested it, it worked fine for the first 10-15 shots and then it stopped. from what I could tell, after 10 or so shots, the script wasn't even executing anymore. every time I reloaded the mission, it worked great again for another 10 shots and stopped again. was it because I executed a script instead of a function from the eventHandler? -
AC-130 Spectre Gun Cam Possibility?
SilverRanger replied to Blitzen's topic in ADDONS & MODS: DISCUSSION
the reason you see the custom tracers only and not the actual rounds is because the 25mm rounds weigh more than the tracers. this allows the tracers to maintain their trajectory while the actual rounds fall to the ground faster. this is more apparent the further away the plane is. I need to play around with the tracer weight in order to match the two but I'm too lazy to do it :p if you want to give it a shot Drop ["kouleSvetlo","","Billboard",0.1,5,[0,0,0],(_AProundspeed select 2),0,[color="Red"][b]2[/b][/color],1,0,[5,5,5],[[1,0.5020,0.2510,1]],[0,0,0],0,0,"","",_APround] the red number is the weight. below 1.27 the weight is less that air density so the tracers move upwards, 1.27 they stay where they are (with no initial velocity set) and above 1.27 the are heavier than air so they fall downwards. to answer your other question, you can start the script whenever you want and use whatever parameters you want. you can even start multiple instances of the script with the same or different units. all you need to call the script is [nameOfUnit,SideToBeIgnored,nameOfPlane] exec "ac130.sqs" as long as you have a single unit, a plane flying around, some enemies and the "EnemyZone" and "SafeZone" triggers, the script should work. as for the reveal trigger, I put it there to make my tests easier and less time-consuming. as I said inside the readme, it IS necessary for the player (unit defined by the 1st parameter) to be aware of the target, before the plane can engage. once again, the script was written with the parameters of a specific mission in mind, so some oddities still exist inside. you can safely remove the reveal trigger as it is not needed by the script. now, it would make no sense to reveal targets to the plane or modify the script to engage based on the targets the plane knows about. the plane is a prop ONLY. it's just flying around aimlessly and I only put it there at your request to make it look more realistic. the plane doesn't actually engage any targets as it is set to "Careless" mode and in any case it couldn't spot infantry from 500m in the air :) one thing you can do, is open the ac130.sqs, look for ? (_player knowsabout _target) > 0.1 and (canMove _target) : _ValidList = _ValidList + [_target] and change it to ? (canMove _target) : _ValidList = _ValidList + [_target] this will eliminate the need for the unit to know about the targets before the plane can engage them keep in mind though that the _ValidList, as well as the _PriorityList are defined based on the distance of the target from the unit in the 1st parameter of the script. I made it like this to avoid hitting the unit with stray fire and also to have the unit close enough to see the whole effect. that is the reason the "EnemyZone" trigger is always repositioned on top of the player. lastly, you can have as many waypoints as you want for the plane. what the init.sqs actually does in this case, is place the 5 waypoints of the plane at an altitude of 500m so that the plane won't have to dive down all the time to activate it's waypoints. just count how many wps your plane has and adjust the script accordingly "[group _plane,_x] setWPpos [(getWPpos [_plane,_x] select 0),(getWPpos [_plane,_x] select 1),500]" forEach [0,1,2,3,4,5,6......99] of course this is all optional, but the whole effect looks awful with a plane flying at 150m or so :p -
AC-130 Spectre Gun Cam Possibility?
SilverRanger replied to Blitzen's topic in ADDONS & MODS: DISCUSSION
I can't seem to find anything wrong with the code and it still works just fine on my pc.:confused::confused::confused: I re-uploaded the example mission with the new script and an A10 flying around at 500m. give it a try in vanilla OFP and if it works, the problem is probably with some addon or mod you are using, although I can't think of anything that would cause this:( I also recalculated the velocity of the rounds that are created to be based on the plane's altitude in case the starting velocity was causing the rounds to hit the ground before the intercept.sqf could calculate and guide the rounds to the target. if this was the cause of the problem, it's could only be caused by lag, since the calculation is supposed to be immediately after the round's creation. if this is the case, avoid using heavy addons and limit the view distance to 1000 or so.... -
keep in mind that once you have disabled the AI for target or autotarget, there is no way to re-enable it. still, this may be obvious, but why not just order the troops to hold fire?
-
AC-130 Spectre Gun Cam Possibility?
SilverRanger replied to Blitzen's topic in ADDONS & MODS: DISCUSSION
I made the same changes in my script and it worked just fine for me.:confused: maybe you skipped a step or didn't replace something. look for paragraph called #FireRounds, delete every line between that and _count = _count + 2 and paste in the code from my last post. you should also delete the three lines above the #FireRounds because those define the _randompos variable which is no longer needed since the rounds are created on the plane's position. also the _plane = _this select 2 goes on top of the AC130.sqs. Make sure every other instance of plane inside the AC130.sqs is changed to _plane and use the plane's name as the third variable when executing the script. -
AC-130 Spectre Gun Cam Possibility?
SilverRanger replied to Blitzen's topic in ADDONS & MODS: DISCUSSION
didn't mean to imply you were stealing my script man. it was just a bit funny to be getting back my own advice :D anyway, the division by zero error comes from the intercept.sqf. probably something to do with the specific angle of the round that results is 0. nothing to worry about as it doesn't happen often and has little effect on the rest of the script... as for the problem with the rounds exploding under the plane, I saw the same thing. It's a well known problem, caused by the stupidity of the script's author:p try this instead #FireRounds _addx = random 10 _addz = random 10 ? _addx > 5 : _addx = _addx -10 ? _addz > 5 : _addz = _addz -10 _APround = "Cannon25HE" camcreate [(getpos plane select 0),(getpos plane select 1),(getpos plane select 2)-15] _APround setvelocity [1,1,-500] _AProundspeed = [_APround,_target,_count,_addx,_addz] call Intercept _APround setvelocity (_AProundspeed select 2) Drop ["kouleSvetlo","","Billboard",0.1,5,[0,0,0],(_AProundspeed select 2),0,2,1,0,[5,5,5],[[1,0.5020,0.2510,1]],[0,0,0],0,0,"","",_APround] this should fix the problem with the rounds and also add cool looking tracers that will work with SLX. it doesn't however look too good in vanilla OFP with both the original and custom tracers, but you can either delete the drop line or change the ammo used from "Cannon25HE" to "Heat73" for example and get the same basic effect but with a bit more punch :cool: just name your aircraft as "plane" or define it as "plane" in init.sqs (or anywhere you want). you can also add a third variable to the script by adding _plane = _this select 2 in the beginning of the script, changing all "plane" instances to "_plane" and calling the script like this [unitName,Side,NameOfPlane] exec "ac130.sqs" -
AC-130 Spectre Gun Cam Possibility?
SilverRanger replied to Blitzen's topic in ADDONS & MODS: DISCUSSION
LOL:D:D:D I think you may be forgetting who gave you the script to keep the planes from stalling :D but to answer your questions it's easy enough to attach tracers to the 25mm rounds, although the ammo I use in the script are the original BIS ones that already have tracers. I intentionally had the example mission take place at night so you can see them more clearly. If you wish to add others though, all that is needed is to create a drop and give it the same velocity as the rounds. give it a try and if you can't do it, I'll be happy to make them. as to your other point, attaching the trigger to the plane is also easy. still, this script was written for a specific mission, so I added a parameter inside the script that terminates it once that trigger has no enemy units inside it's radius. an easy fix, but given that the plane would need some additional time to circle back into firing position, you would have to change all the delay parameters as well, otherwise it would take way too long between shots. now regarding the firing position, I know that the shots come from a different direction each time and that's supposed to simulate the plane flying around. it does however look a bit off sometimes when it fires a second time at the same target because the firing position has changed. that is a dumb mistake I neglected to fix, but all that's actually needed is to take the position generator line outside the loop. I'll try to find some time the next couple of days to fix it. btw, thanks for all the feedback...