Jump to content
Sign in to follow this  
Bullz_eye_on_my_back

Need help for a script for a spy camera

Recommended Posts

I'm currently working on a UAV spy camera called the Cypher that is used by the US military. I've got it in game....

I've been using an old script out there called the "helmet cam" to test the potential of the spy camera....

So far it works and looks great, the only problem I have with it... is that I can't control the AI's direction of view (bearing or heading), nor the height in which it flies...

The cypher acts essentially like a helicopter, so it will hover.. I envision using the cypher to fly either low through streets of towns or high above the terrain to do scouting and view enemy bases.

If anyone could help, I would like to encorporate the "helmet cam" script with another one that has an interface when your watching the cam... to chose to make the spy camera drop/raise 5 feet at a time....and possibly turn or rotate left/right by about 60 degree at a time.

I have no clue about scripting - I'm just a rookie here and thought this would be one sweet addition to the game!

Please help!! smile.gif

Share this post


Link to post
Share on other sites

oops!! forgot to say....

the way I would like it set up is...that the cypher is essentially a remote control helicopter that you could control from anywhere on the map!

Thanks

Bullz_eye

Share this post


Link to post
Share on other sites

well I've seen that in missions that were out and thought it was a really sweet thing....I was amazed when i saw it..especially with the zoom!

But with this you could be seeing through the camera's eyes....from the horizontal view too and not restricted to only a view from the vertical (if someone was hiding in a building or under a tree or bush you couldnt see them from the satellite) plus with the spy camera you can use the night vision goggles

with the helmet cam you can see what the "character/object" sees as it moves a long. I just wondered if there was a way to manually control an AI helicopter pilot to raise up or down and turn left or right (rotate) to actually manuver (sp?) the spy camera through streets and possibly even big buildings to scout or to hide and watch.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Look at this...

[url=http://home.arcor.de/vektorboson/en/scripts.html<span id='postcolor'>

already offered it to him, but he wants to have it different.

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">with the helmet cam you can see what the "character/object" sees as it moves a long. I just wondered if there was a way to manually control an AI helicopter pilot to raise up or down and turn left or right (rotate) to actually manuver (sp?) the spy camera through streets and possibly even big buildings to scout or to hide and watch.<span id='postcolor'>

If you are a hell of a scripter maybe. But AI is still too smart to go into low runs through streets. No chance here. AI will ever try to go round or higher even if you force them down by script.

Share this post


Link to post
Share on other sites

hmmm....i guess this is the only time i wished the AI was reaaaally stupid! lol....

Cool, well thanks for answering, I was just hoping there was a way to do it.

A few of the scripts on that page looked promising too...

Thanks again!

Bullz_eye xmas.gif

Share this post


Link to post
Share on other sites

hmmm....I'm back at the cypher addon again. I've fixed my geometry LOD. I can now fly it straight into a building doorway and up a flight of stairs to sit and hover at a window (very carefully and slowly).

I've been looking at scripting snipets and everything, and think that there might be a way to make it all work. Only thing is I have no experience in scripting- so I'm trying to learn.

If anyone knows how to make an interface with slide bars, butttons, and setting a heli heading (facing direction) please let me know.

I'm going to try my hardest to figure it out, as soon as I do, and get the textures on...I'll send it out

Thanks!!! biggrin.gif

Share this post


Link to post
Share on other sites

Well good news!!! I have been slowly learning code and have gotten a few things done....

I've started making a dialog incorporating a modified "helmet cam" script ....in it so far i have created a way to rotate the spy camera (through buttons)...have it fly at any height wanted....through buttons that add or subtract height from the given flying height....also landing

I'm currently trying to make it turn on/off its light....and the night vision goggles also. I'm looking into controlling the speed and moving small incruments(left, right, forward, and back) and to specific griddings.....

I could use some help still...

if anyone has any suggestions or would like to help...please post it

thanks!!

Share this post


Link to post
Share on other sites

To move the object you are tracking your best bet would be to use the setvelocity command.

RED

Share this post


Link to post
Share on other sites

ahhh....good call! I just started trying to work on that...i've had lil luck with going one meter forward and everything...

hmmm..im going to have to think about how to make it set the velocity direction determined on its heading....

also, i have the fly in height working, but i just noticed once it stops to hover at its positon it doesn't want to fly up or down. Would "setpos" with a loop (to make it slowly raise up) work or would i need to use the set velocity also?

I've never used the setvelocity....would i need to set the velocity to zero once it hit the mark....or will it die out over a distance?

Thanks for the advice!!

by the way....is it possible to set the camera's dive and bank, when using the target command?? or even use the dive and bank command at all?

Share this post


Link to post
Share on other sites

cool..I've gotten the movement in small incruments to different directions! (well tested in one direction and pretty sure i can get the others- using the sin*getdir and cos*getdir commands)

Very good idea with the set velocity, because it gets rid of the AI wanting to fly up to 50m before moving!

Thanks Red!!

I have a problem though....since the flyin height command only works while in movement (as far as my tests show).... how do i make the heli raise up or down and stay at a certain height?? I was trying to figure out a way using the setvelocity, but it flies up and then falls back down to its original altitude....

Share this post


Link to post
Share on other sites

hmmm.....so far I've been able to menuver it manually through the interface into a building and through the rooms, but i still can't get it to at a hovering state raise up and fly at a higher altitude....

ive tried.....

spycam setvelocity [velocity spycam select 0 ,velocity spycam select 1,((velocity spycam select 2) +2)]

~0.3

spcaym setvelocity [velocity spycam select 0, velocity spycam select 1,velocity spycam select 2]

exit

then tried...

spycam setvelocity [0,0,((velocity spycam select 2 )+1)]

~0.7

spcaym setvelocity [0,0,velocity spycam select 2]

exit

then...

_num = 0

#plus50

_num= _num +1

spycam setpos [getpos spycam select 0, getpos spycam select 1, _z + _num]

_ht= getpos spycam select 2

spycam flyinheight _ht

~0.02

?(_num < 50): goto "plus50"

exit

everything ive tried makes it raise up , but then falls back down to the original altitude....anyone have any ideas?? Ive searched but can't find anything

Share this post


Link to post
Share on other sites

If you want it to stay at that height just loop a setpos,

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_sypcampos = [getpos spycam select 0, getpos spycam select 1,getpos spycam select 2]

#loop

sypcam setpos _spycampos

0.01

goto "loop"

<span id='postcolor'>

RED

Share this post


Link to post
Share on other sites

hmm....i just tried that...it went up, but like most things in gravity...it came back down.....not exactly why its not working, but i will fool around with it to see if i can get it to work!

Thanks again Red!!!

I'm starting to think i picked a doosy (however you spell it) to try and learn how to script on. smile.gif

Wondering....should i try and place a lasertargeting script on it....so that it will "paint" a target with a laser dot?

Also, if there are any texture people out there...i really really could use some help!!!! I've never textured, all i need is the cypher to be textured, and just a green colored (see through) .paa file ..where it looks like the NV goggles (without the black round circle) and a laser sight and maybe a "locked on" sight too....

I'm thinking also...at a certain health status..ill try and make the cam flicker and get a little fuzzy

Share this post


Link to post
Share on other sites

hmmm...i tried the setposition, but it negates just about everything else for moving. with the loop it just sticks to that one spot basically.

Dschulle has been taking a look at everything when he gets the time and has been helping solve some problems.

About the laser designator or targeting device...how could i place it on a heli? to use to "paint" the target? i know you can find the painted target through scripts, but not sure how to add it to a vehicle.....

Share this post


Link to post
Share on other sites

Use this to add the laserdesignator to your heli:

this addmagazine "LaserDesignatorOH";this addweapon "LaserDesignatorOH"

I dont see how the setpos loop can make the heli stick to one spot, if you use it right it should only stick to the same altitude only.

Heli setpos [getpos Heli select 0, getpos Heli select 1, Z]

Z is the altitude you want it to fly on, wich you can change whenever you want, to a different altitude.

You can also use flyinheight and setvelocity

Heli setvelocity [velocity Heli select 0, velocity Helis select 1, 0]

Play around with them a bit and you should get it to work.

I dunno if you solved the problem with controlling the camera with sliders but here is a singlemission (no mission) with a camera that moves by sliders. Hope any of this helps.

-Edit

Forgot to add the link LOL smile.gif

Spectator.zip

Share this post


Link to post
Share on other sites

Thanks InqWiper for the laser designator help!!!

Now i just need to figure out a way to make a script to make it actually use it.

Yes, I've been trying to play with the setvelocities and setposition and flyinheights....

unfortunately the only way for me to stay at the height i want it to during hovering mode....is to set a loop, but i can't stop it for when i want to move. The script is stuck in the loop.

Dschulle has suggested using different camera scripts that you can use the key pad to direct it, but not sure if it will allow the dialog to be used too

I'll check out the spectator script

I have fixed the camera, but not by sliders or anything. I've set up a set of buttons that will rotate the whole cypher in certain specified increments (+/-1,15,30,60, & 90 degrees or heading direction). Then I have set up a tilt of the camera up or down, then centered. I'm currently trying to mess with the animations to make the camera on the model also rotate up or down with relation to the button pushed to tilt the camera...

i need to figure out how to make it perform the animation action through scripts

Share this post


Link to post
Share on other sites

#Loop

?ForceAlt:Heli setpos [getpos Heli select 0,getpos Heli select 1, Z]

~0.01

goto "Loop"

this way it will only be forced to a specific altitude when ForceAlt is true(if I havent messed up somewhere wink.gif ).

Share this post


Link to post
Share on other sites

hmm...i can't get it out of the loop still...

if anyone would like to help figure it out.. i would gladly send a zip of the files your way to try and get this scripting done

here is a small update on what I've got left so far:

1. figure out how to change the hovering height

2. get some textures for NV screen/ texture for the spycam (addon & icon)/ texture for damaged camera lens/new texture for cross hairs for camera sights and laser pointer targeting

3. Figure out how to make the cypher use the laser targeting/ and set up the script to detect what is "painted"

4. moving to certain griddings on the map (which i have been given permision from MFCTI to use his script [huge huge thanks!] ; I just have to decode how he did it to make it work)

Thats about it for the first version of it. Later I would like to possibly create a "Cypher command vehicle" where the person controlling would sit in the cargo hold of a vehicle (tv screens and parts and such in the same cargo hold) and have it where it can refule and repair the cypher... and possibly have a range of how far it can remotely control the cypher.

Thanks, keep the ideas and help coming!

Bullz_eye smile.gif

Share this post


Link to post
Share on other sites

sounds great

Inq's loop sounds like it should work

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#Loop

?ForceAlt:Heli setpos [getpos Heli select 0,getpos Heli select 1, Z]

~0.01

goto "Loop"

<span id='postcolor'>

notice that if you remove line ?ForceAlt:Heli setpos [getpos Heli select 0,getpos Heli select 1, Z] then the script doesn't do anything

in other words, if not ForceAlt (aka ForceAlt = false), then the loop does nothing

in your dialog setup can you make a button(s) which will set ForceAlt to True/False?

also, I might suggest having Z as a variable (ie _fixalt, so the line would be like

setpos [getpos Heli select 0,getpos Heli select 1, _fixalt])

which could be defined when ForceAlt is set to True,    ie. click of True button somehow (been a while since I've played with dialogs wink.gif)execs:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_fixalt = getpos dronename select 2;

ForceAlt = true;

exit

<span id='postcolor'>

that way when forced altitude is enabled, it will store the present altitude into the variable... etc etc, you seem pretty smart so I'm gonna get back at my homework wink.gif

good luck

I never post in these good ol' forums; I'm just a watcher/info taker, but hey, boredom pushes man to new limits!

Share this post


Link to post
Share on other sites

haha....yep boredom can be a pretty good kick starter.

Thanks for the info! I think i can set up where i can use the same button for when its flying and at a certain speed will set the forcealt to true and direct the info to the other script made for the hovering height!

Thanks Homer! I'll get to work on that idea! biggrin.gif

Share this post


Link to post
Share on other sites

hey!! good news, the hovering height has been solved!! Dschulle has gone over my scripting and solved several parts of my problems.

He even updated his helmet cam script especially for the cypher, and created the camera where it acts like a turret. So now you can rotate the cypher and camera independently. He kept in the tilting of the camera up and down. Just so that when you move the cypher in different directions, if the directions aren't the same direction the camera is pointed in- then there is a "centering" button that centers the camera back to horizontal view and same heading as the cypher.

Share this post


Link to post
Share on other sites

Well, it's coming close to being done in the scripting department for this project.

With the help of Mark (that created the MFCTI Beta multiplayer missions) I have encorporated in the interface a place where you can designate a specific gridding for the cypher to move to on the map.

One problem is that. I'm using the command <cyhper domove>

It gets there to the right spot just fine, but it gets a mind of its own and takes off flying in circles around the area and flies 3 times faster than what it is designated to fly through the configure file.

Can the stop command work? or maybe make it set a waypoint and but "limit" in its speed?

Share this post


Link to post
Share on other sites

hey hey hey everyone!!!!!

i have to say, the scripting has taken a while, and is possibly done now (atleast for the first installment)

All that seems to be left is textures, I've asked several places for help, but haven't recieved any replies yet or interest to help texture.

If anyone knows anyone that can or you can yourself..... I really need help, because I can't create any textures at all.  

Anyways here is a couple of screen shots! One of the interface and the other of the model.

interface.jpg

cypher.jpg

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×