Mod Question Repository... Questions come in, answers go out - Page 7

Mod Question Repository... Questions come in, answers go out

Resources to get you going on your new project, or to help you over some emergent problems during your development cycle.

Moderator: Moderators

Locked
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post 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
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

You will have to restrict the turrets with the weapon main dir tag (it's somewhere in the wiki) properly.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post 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
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post 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?
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post 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.
User avatar
Fanger
Expand & Exterminate Developer
Posts: 1509
Joined: 22 Nov 2005, 22:58

Post 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..
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

I know that, by now...

How do i script it to do so, though?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post 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...
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Ahh, that doesn't work. :(
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post 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.
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Post 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.
User avatar
Abokasee
Posts: 222
Joined: 03 Nov 2006, 21:51

Post 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
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Post by Peet »

Semicolons are your friend.
User avatar
Abokasee
Posts: 222
Joined: 03 Nov 2006, 21:51

Post by Abokasee »

P3374H wrote:Semicolons are your friend.
anychance you could explain that a bit better?
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Post by Peet »

Look Verrrrrry carefully at the difference between the lines that were already there, and the lines you added :roll:
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post 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;
}
User avatar
Abokasee
Posts: 222
Joined: 03 Nov 2006, 21:51

Post by Abokasee »

OHHHH, thanks
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post 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 >.>
User avatar
Abokasee
Posts: 222
Joined: 03 Nov 2006, 21:51

Post by Abokasee »

Can you have a minus impulse attack like impulseboost -5.095? so it drags units toward it?
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post 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.
Locked

Return to “Game Development Tutorials & Resources”