Page 7 of 59

Posted: 07 Apr 2007, 18:28
by Snipawolf
Okay, I'll try, thanks a million for the help.

PERFECT, IT WORKS! Thanks so much!

Edit: lol, I forgot about the main cannon, I wonder why it shoots 25 degrees off too, well, I know a bunch of new stuff, so lets give it a whirl, too! I don't feel like a newb anymore, I learned some important (very important) stuff... Somebody does indeed need to update the wiki...

Edit2: Fixed the cannon, Now I need a restore after delay (I deleted it a while ago cuz the thing fixed itself [For some weird reason] and I need it again :D)

Edit3: Okay, now I have another problem.. How do I make the unit rotate its full entity (block and everything) to attack a target? Just kill off the turn base? Cuz its reading that the enemy is infront of it, and the four mini turrets are aiming at it, but the big one makes it turn around, so it makes the little ones aim behind the unit to fire at something in front of it... O.o

Posted: 07 Apr 2007, 19:10
by rattle
You will have to restrict the turrets with the weapon main dir tag (it's somewhere in the wiki) properly.

Posted: 07 Apr 2007, 19:26
by Snipawolf
No, no, not that.

Let me explain.

With a picture...

Image


The first pic (on the left) is it aiming BEHIND itself. The second (on the right) is it aiming FORWARD

Posted: 07 Apr 2007, 22:46
by rattle
Did you turn the body in the script?

If you were doing that then the angles (heading, pitch) passed over to the AimWeapon functions need to be corrected. In this case heading only. You have to subtract the rotation of that body piece from heading.

Also, are the firepoints children of the guns?

Posted: 07 Apr 2007, 23:52
by Snipawolf
Yeah, the body does turn in the script. It turns to fire the main cannon, which I wanted to only go up and down, so it turns the whole body everytime it aims at something... So, I need EVERYTHING to turn. I need to find a way to make me not have to do it by scripting it.. It doesn't turn, the mesh does..

Hope you can understand that.

Yeah, the fire points are children of the guns.

Posted: 07 Apr 2007, 23:56
by Fanger
dont turn the body.. it will auto do that itself to aim that weapon when ordered to fire.. your screwing everything up by rotating the actual object in the script.. NEVER do that..

Posted: 08 Apr 2007, 00:04
by Snipawolf
I know that, by now...

How do i script it to do so, though?

Posted: 08 Apr 2007, 01:15
by rattle
You only need to aim the main cannon on the x-axis. Fang is right, the unit should turn itself automatically towards the target. Just stick to that, the other way is a bit more complicated...

Posted: 08 Apr 2007, 03:24
by Snipawolf
Ahh, that doesn't work. :(

Posted: 08 Apr 2007, 04:26
by rattle
Hmm... it could be that only turret lessweapons (turret=0) made a unit turn towards the target. AimWeapon won't be called for that weapon then though.

Posted: 08 Apr 2007, 08:50
by yuritch
Both turretless (turret=0 in weapon.tdf) and restricted (Weaponmaindir in unit.fbi) weapons make the unit turn to face the enemy. For anything with turrets restricted weapons are better since they call all the aiming scripts.
There is a problem with that and gunship aircraft, though (non hoverattack=1 aircraft are fine). While the aircraft probably will turn around Y axis (heading) to face the enemy, it won't turn around X axis (pitch), so if the firearc is too restricted, it won't fire.

Posted: 08 Apr 2007, 13:22
by Abokasee
I got a question

when I add some units in the SIDEDATA file instead of adding those units, it keeps the basic builder of that lab, but takes everything else out and adds the units from the next thing down this is what I writ or added to armap

}
[ARMAP]
{
canbuild1=armca;
canbuild2=armpeep;
canbuild3=armfig;
canbuild4=armthund;
canbuild5=armatlas;
canbuild6=armkam;
canbuild7=armzeus
canbuild8=armpw
canbuild9=armwar
canbuild10=armflash
canbuild11=armflea
canbuild12=armpincer
canbuild13=armrock
canbuild14=armstump
canbuild15=armjeth
canbuild16=armck
canbuild17=armcv
canbuild18=armshock
}

And this is what I get...

Image

clearly not what I wanted...

EDIT 1

oops! wrong links :<
here it is

Image

EDIT 2

Also the comm cant acually build the building :X

Posted: 08 Apr 2007, 15:18
by Peet
Semicolons are your friend.

Posted: 08 Apr 2007, 15:33
by Abokasee
P3374H wrote:Semicolons are your friend.
anychance you could explain that a bit better?

Posted: 08 Apr 2007, 15:36
by Peet
Look Verrrrrry carefully at the difference between the lines that were already there, and the lines you added :roll:

Posted: 08 Apr 2007, 15:38
by Guessmyname
you need to add a ';' on the end of each canbuild line

Or to put it another way:

[ARMAP]
{
canbuild1=armca;
canbuild2=armpeep;
canbuild3=armfig;
canbuild4=armthund;
canbuild5=armatlas;
canbuild6=armkam;
canbuild7=armzeus;
canbuild8=armpw;
canbuild9=armwar;
canbuild10=armflash;
canbuild11=armflea;
canbuild12=armpincer;
canbuild13=armrock;
canbuild14=armstump;
canbuild15=armjeth;
canbuild16=armck;
canbuild17=armcv;
canbuild18=armshock;
}

Posted: 08 Apr 2007, 17:27
by Abokasee
OHHHH, thanks

Posted: 08 Apr 2007, 17:43
by Snipawolf
Wait, what?...

So, I'll just restrict it in weaponmaindir and it should work?

because, for now, if I tell it to rotate along X, it puts the gun at a 90 degree angle (closest to the target) and fires... not even facing the direction.. It makes no try to turn its body... So, I set turret=0 and now it doesn't even shoot unless its right infront of it...

edit: LOL, I thought weaponmaindir would be hard... This is so easy its funny! I just need a way to find out how big my angles actually are... 90 Degrees sure as hell was NOT A CONE! Or my aiming is messed up >.>

Posted: 09 Apr 2007, 19:18
by Abokasee
Can you have a minus impulse attack like impulseboost -5.095? so it drags units toward it?

Posted: 11 Apr 2007, 22:44
by imbaczek
How to make a unit that hovers above a target and shoots a weapon straight down (see The Independence Day for examples, or even SupCom and that badass supersaucer)?

PS. the unit absolutely has to be able to attack ground, like artillery or bombers.