Joined: 28 Jan 2005, 18:15 Location: Cockpit of a Dire Wolf.
rattle wrote:
Now I've got a question... it's like this:
I've got a unit with a burst weapon which fires twice each burst (dual rocket launcher). So the question is, is there any other function which gets called each time a weapon fires a burst shot? Both FireWeaponX and EndBurstX get only called at the end of a burst which is useless.
The only workaround I can think of is abusing RockUnit, because it's the only function which gets called for any shot fired. Though I don't know if it got called when the unit was hit by a weapon as well. I read somewhere that both RockUnit and HitByWeapon are called then...
All I want to do is distribute the two shots over two firepoints (AND spawning muzzle flashes and extra fancy stuff like exhaust smoke and fire ) without relying on scripted reload times or using two weapons and slaving the second to the first AND scripting a delay in. That's entirely possible but it's ugly. I'd rather have one manageable weapon for which I don't need to recompile the script each time I want to change the reload time.
FireWeaponX is called after the first shot of a burst. EndBurstX gets called after the last shot of a burst, but that is unimportant to what your asking. Thus FireWeaponX will switch the barrel for all shots after the first in a burst, and if you only have a two shot burst this works great, for just switching the barrel at least. To get the muzzle flash on the second shot you might try having the EndBurstX function as well.
static-var ammo, rounds; ammo = RAND_AMMO; rounds = MAX_ROUNDS;
AimWeaponX() { signal SIG_AIM_X; set-signal-mask SIG_AIM_X; if (!ammo OR !rounds) return FALSE; ... } FireWeaponX() { if (ammo) --ammo; else { if (rounds) --rounds; else { SHOW_RELOAD_SYMBOL sleep RELOAD_TIME; HIDE_RELOAD_SYMBOL rounds = MAX_ROUNDS; } sleep TIME_BETWEEN_ROUNDS; ammo = RAND_AMMO; } }
Straight into the script would work? Or would I need to change some stuff....
FINALLY, I just deleted the "start Script" and voila! It compiled!
Edit: Sig_Aim is the only one I know I need to change, I'll keep messing around 'til I am finished..
Joined: 01 Jun 2006, 12:15 Location: Banned user for reason “Do not post pictures of people fucking cars”
Archangel of Death wrote:
rattle wrote:
Now I've got a question... it's like this:
I've got a unit with a burst weapon which fires twice each burst (dual rocket launcher). So the question is, is there any other function which gets called each time a weapon fires a burst shot? Both FireWeaponX and EndBurstX get only called at the end of a burst which is useless.
The only workaround I can think of is abusing RockUnit, because it's the only function which gets called for any shot fired. Though I don't know if it got called when the unit was hit by a weapon as well. I read somewhere that both RockUnit and HitByWeapon are called then...
All I want to do is distribute the two shots over two firepoints (AND spawning muzzle flashes and extra fancy stuff like exhaust smoke and fire ) without relying on scripted reload times or using two weapons and slaving the second to the first AND scripting a delay in. That's entirely possible but it's ugly. I'd rather have one manageable weapon for which I don't need to recompile the script each time I want to change the reload time.
FireWeaponX is called after the first shot of a burst. EndBurstX gets called after the last shot of a burst, but that is unimportant to what your asking. Thus FireWeaponX will switch the barrel for all shots after the first in a burst, and if you only have a two shot burst this works great, for just switching the barrel at least. To get the muzzle flash on the second shot you might try having the EndBurstX function as well.
Worth a try at least!
I'm using two weapons now and unlock the second weapon when the first weapon calls it's FireWeapon function. Works just fine and is less complicated... :)
1: How do I set angles that the unit can only fire on?
2: What are the required parts of a script, only the required ones, and nano stuff?
3: Is it possible to script "cutscenes?"
My idea is to have the units all be part of the background, which will also be "the unit" and then make the cutscene start with on/off. With loads of scripting, of course.
Edit: Forgot one more, do SDD's work in the current build, or do I need SVN?
Edit Again:What is the safe number of tris for something that appears in groups of 100-200?
How do I set angles that the unit can only fire on?
Not with the script, but with the FBI. From 0.63b1 changelog: - Added new fbi tags WeaponMainDir<1-16> and MaxAngleDif<1-16>. WeaponMainDir is a vector and defines the center direction of a cone in which the weapon can aim while MaxAngleDif defines how broad the cone is. Default WeaponMainDir = 0 0 1; (forward) and MaxAngleDif=360; (can fire everywhere)
Quote:
2: What are the required parts of a script, only the required ones, and nano stuff?
In TA there is none. However this unit crashes Spring. Well, for a cons, I'd use Create(), QueryNanoPiece(p), and probably StartBuilding() & StopBuilding(). Have I already told you to read the bos section of this outdated TA modding doc?
Quote:
3: Is it possible to script "cutscenes?"
There would be so much and so difficult scripting involved that you don't want it.
I have a question:
How would I make a guided mortar type weapon?
It needs to be able to:
-Fire in a high angle like a mortar
-Fire beyond direct LOS (my current method of a missile weapon in trajectoryheight=1 fails at this)
-Track a target until splashdown
-Must be part of a diverse weaponssuit, ie unit tag trajectoryheight wont work
Ive really gone into a wall on this one, tried alot of approaches and none seem to help. MY current approach (see above) is ok but not that good as a support weapon...
Another question, I was about to make a new topic, but remembered this.
Let's say I got a cube. (Bah, I'm going make a quick image in paint with my pwnage paint skillz )
So, imagine that the grey is transparency.
Now, imagine this hand on some unit.
Now: The question: What would it look like if it looked like that? I have had no experience with transparency, I would like to know if it displayed the fingers correctly without messing anything up.
If the two faces where exactly on top of one another, but facing different directions, it would look like a hand, but completely flat. It would look like the hand had been cut out of paper and stuck on the end of someones arm.
Users browsing this forum: No registered users and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum