Page 2 of 2
Re: test
Posted: Wed Feb 09, 2005 8:05 am
by wacko
tltrude wrote:I think your problem is that you are not resetting the guns "pitch" and "roll", so it uses the old values. The old values can be read by printing the gun's "angles" when it is not in use. If you print the platform's "angles", The pitch and roll (first and last numbers) should be 0 all the time. The center number of "angles" is the yaw (left, right).
Sorry, don't get it

Isn't 'pitch' the angle determining whether it looks up or down and 'roll' umm for a plane when it's wings go up or down.
I do print the $mg.angle and additionally $mg.angles, like I did above, no value of angles is equal to angle. Have u tried the example map?
@Fungus, the yawcenter is in fact the only thing I CAN update properly, dunno why...
@Lizardkid, as angle[1] depend not just on the rotation but also on where I dropped the mg (which would give an offset) and as angles[0] depends on whether I hold the mg or where I aim to...
omg my brains start smokin... would u give it a try?
Posted: Sun Feb 13, 2005 1:17 pm
by wacko

no help here...
this makes a whole map idea die, too bad

tnx to those who tried, nevertheless
Posted: Sun Feb 13, 2005 1:46 pm
by jv_map
Don't give up so soon m8

who said you
have to use the buggy TurretGuns in mohaa? You could also just use a script_model or so and script it to aim with the player and fire when he's holding fire... just another option you might want to try

Posted: Sun Feb 13, 2005 2:03 pm
by wacko
sure, i'll try that. But it sounds like a huge task for a scripting noob like I am. Is there any map/script where I could study something similar? Doing it 'from scratch' seems impossible for me

Posted: Sun Feb 13, 2005 2:09 pm
by Rookie One.pl
How about bdbodger's 88s?
Posted: Sun Feb 13, 2005 3:38 pm
by wacko
Rookie One wrote:How about bdbodger's 88s?
if u were talking about his flakfire.scr, I'd be too stupid to adapt it
@jv, could u give me a little piece of a script i could play with? pleeease

Posted: Sun Feb 13, 2005 3:50 pm
by Rookie One.pl
Yeah, that's what I meant. Basically, what you need to do that is to trace what the player's looking at and fire while (local.player.fireheld).
<EDIT>Here's the piece of code I use in my artillery support mod (a bit altered from Bjarne's scout mod) - self is the player here:
Code: Select all
local.fwd_vec = angles_toforward self.viewangles
local.start = self gettagposition "Bip01 Head"
local.hit_location = trace (local.start + local.fwd_vec * 64) (local.start + local.fwd_vec * level.ffe_sight_max) 0
</EDIT>
Posted: Sun Feb 13, 2005 4:21 pm
by wacko
Thanks. I can see that this is somehow doing what I'd need, but I'm far from understanding how it does
Rookie One wrote:...what you need to do that is to trace what the player's looking at...
huh??? is this what ur piece of code does? and then, how can i make the script_model turn to that errrm location? and would a simple script_model with model:statweapons/mg42_gun.tik know about commands like startfiring? and so on...hundreds of questions... oooh, m8, this is way too much for my little brains

Posted: Sun Feb 13, 2005 4:55 pm
by lizardkid
$turret.angle = $player.angle
i think that would work. (how many times have i said this?)
oooh, m8, this is way too much for my little brains
nah, your little brains are too much for it, and they're getting bored because they're so underexerted

Posted: Sun Feb 13, 2005 5:19 pm
by wacko
lizardkid wrote:$turret.angle = $player.angle
what for should I use the whole vector stuff, then? if it was that simple
lizardkid wrote:nah, your little brains are too much for it, and they're getting bored because they're so underexerted

nice of u to say so, but in this case

Posted: Sun Feb 13, 2005 6:03 pm
by Rookie One.pl
That wouldn't work as it would only change the $turret.angles[1] value. And that's right, script_model doesn't know the startfiring command.
Come to think of it, I reckon it would be easier to sort it out the way you tried at first...
Posted: Sun Feb 13, 2005 8:29 pm
by wacko
Rookie One wrote:Come to think of it, I reckon it would be easier to sort it out the way you tried at first...
As u might have heard behind my wailing, I miserably failed in doing so. But if u gave it a try, this would be more than welcome
Posted: Sun Feb 13, 2005 9:10 pm
by Rookie One.pl
I sorted it out.

Well, kind of.

If you do it like this:
Code: Select all
prep:
$mg glue $bipod
$bipod bind $platform
$platform rotateY 5
end
The only problem is that it snaps into an upright position... But I guess that's better than having it fly everywhere around?
BTW I noticed that the MG seems to try to "reach" the platform in rotation, I mean, the more time you hold the MG the faster it will rotate when it snaps to the position. Kind of weird.
<EDIT>It's better to have a while loop setting the yawCenter of the MG because the player might slowly start slipping off the platform.

</EDIT>
Posted: Sun Feb 13, 2005 10:44 pm
by wacko
wahooooo

it's working perfectly, even in the map where I actually need it
imagining how much time i wasted because of binding instead of glueing that bastard makes me sick, but hey what the heck, it's working
thank you so much, m8. u'll get a plate of honor next to that mg in my crappy map
the problems u mentioned are no problems at all. upright position is perfect and the 'platform' isn't much rotating so that's fine, too.
hey, i'm feeling so much better now, u can't imagine

Posted: Mon Feb 14, 2005 12:48 pm
by Rookie One.pl
Wow...

Well, always glad to help.
