Page 3 of 59
Posted: 26 Oct 2006, 21:55
by PauloMorfeo
rattle wrote:Another question: Is it possible to make a high trajectory weapon fire in a lower arc? If so, how?
...
Can you change the speed of a projectile? If not, you only have 2 possible fire arcs, the high and the low ones.
Even though what i'm telling you is so basic that i'm thinking you might be asking something else...
Posted: 26 Oct 2006, 23:16
by Archangel of Death
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!

Posted: 28 Oct 2006, 03:34
by Snipawolf
Copying
Code: Select all
#define MAX_ROUNDS 2
#define RAND_AMMO rand(10,20)
#define TIME_BETWEEN_ROUNDS rand(100,500)
#define RELOAD_TIME 5000
#define SHOW_RELOAD_SYMBOL show reload_symbol;
#define HIDE_RELOAD_SYMBOL hide reload_symbol;
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..
Posted: 28 Oct 2006, 18:11
by Snipawolf
Code: Select all
piece base, turret, mg;
static-var restore_delay;
#define SIG_AIM1 2
#define SMOKEPIECE1 base
#define MAX_ROUNDS 2
#define RAND_AMMO rand(25,50)
#define TIME_BETWEEN_ROUNDS rand(1000,2500)
#define RELOAD_TIME 7000
#define SHOW_RELOAD_SYMBOL show reload_symbol;
#define HIDE_RELOAD_SYMBOL hide reload_symbol;
static-var ammo, rounds;
ammo = RAND_AMMO;
rounds = MAX_ROUNDS;
AimPrimary()
{
signal SIG_AIM1;
set-signal-mask SIG_AIM1;
turn turret to y-axis heading speed <75>;
turn turret to x-axis (0 - pitch) speed <50>;
wait-for-turn turret around y-axis;
wait-for-turn turret around x-axis;
if (!ammo OR !rounds) return FALSE;
}
FirePrimary()
{
if (ammo) --ammo;
else
{
if (rounds) --rounds;
else
{
sleep RELOAD_TIME;
rounds = MAX_ROUNDS;
}
sleep TIME_BETWEEN_ROUNDS;
ammo = RAND_AMMO;
}
}
Create()
{
restore_delay = 2000;
hide mg;
}
RestoreAfterDelay()
{
sleep 2000;
turn turret to y-axis 0 speed <100>;
wait-for-turn turret around y-axis;
return 0;
}
SweetSpot (piecenum)
{
piecenum = base;
}
QueryPrimary (piecenum)
{
piecenum = mg;
}
AimFromPrimary (piecenum)
{
piecenum = turret;
}
Edit: Says I need ")" on line 1.. Wtf..?
Error =
Code: Select all
Error (1): ')' expected [ C:\Program Files\TASpring\mods\Forgotten Chronicles\Mongoose.bos ]
Posted: 28 Oct 2006, 19:50
by rattle
piece base, turret, mg;
static-var restore_delay;
#define SIG_AIM1 2
#define SMOKEPIECE1 base
#define MAX_ROUNDS 2
#define RAND_AMMO rand(25,50)
#define TIME_BETWEEN_ROUNDS rand(1000,2500)
#define RELOAD_TIME 7000
#define SHOW_RELOAD_SYMBOL show reload_symbol;
#define HIDE_RELOAD_SYMBOL hide reload_symbol;
static-var ammo, rounds;
ammo = RAND_AMMO;
rounds = MAX_ROUNDS;
AimPrimary(heading, pitch)
{
signal SIG_AIM1;
set-signal-mask SIG_AIM1;
turn turret to y-axis heading speed <75>;
turn turret to x-axis (0 - pitch) speed <50>;
wait-for-turn turret around y-axis;
wait-for-turn turret around x-axis;
if (!ammo OR !rounds) return FALSE;
}
FirePrimary()
{
if (ammo) --ammo;
else
{
if (rounds) --rounds;
else
{
sleep RELOAD_TIME;
rounds = MAX_ROUNDS;
}
sleep TIME_BETWEEN_ROUNDS;
ammo = RAND_AMMO;
}
}
Create()
{
restore_delay = 2000;
hide mg;
}
RestoreAfterDelay()
{
sleep 2000;
turn turret to y-axis 0 speed <100>;
wait-for-turn turret around y-axis;
return 0;
}
SweetSpot (piecenum)
{
piecenum = base;
}
QueryPrimary (piecenum)
{
piecenum = mg;
}
AimFromPrimary (piecenum)
{
piecenum = turret;
}
Compiles fine for me except that you forgot to add the parameters to the AimWeapon function. Set scriptor to use TAK as well...
AimPrimary(heading, pitch)
I can't tell you if it works however,
Posted: 28 Oct 2006, 19:51
by rattle
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... :)
Posted: 28 Oct 2006, 19:54
by Snipawolf
Try again, I shall, hope it works...
It compiled! Thanks!
Can't wait to set my unit up, have 'em in game by tonight I bet

Posted: 04 Nov 2006, 02:13
by Snipawolf
Script questioning time...
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?
Posted: 05 Nov 2006, 12:06
by zwzsg
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)
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?
3: Is it possible to script "cutscenes?"
There would be so much and so difficult scripting involved that you don't want it.
Posted: 06 Nov 2006, 00:33
by Snipawolf
Okay, thanks for the info...
Of all the things I needed to check, this one didn't say I had a new post when it did

Posted: 07 Nov 2006, 22:55
by Snipawolf
Got a new question: How fast do the cursor animations play? I hope 100ms or so...
Never mind, they go as fast as frames...
Posted: 08 Nov 2006, 00:23
by rattle
Engine frames I assume which is unrelated to FPS.
Posted: 08 Nov 2006, 01:06
by Snipawolf
As long as it is similar to 100ms, I should be fine...
Posted: 10 Nov 2006, 12:50
by zwzsg
Both in TA & Spring a tick is 33.33ms, or 1/30 of a second if you prefer.
Actually I never remember if in Spring it's 30 or 33 ms, but who cares?
Posted: 10 Nov 2006, 13:01
by centurion-1
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...
Posted: 10 Nov 2006, 13:14
by Min3mat
Actually I never remember if in Spring it's 30 or 33 ms, but who cares?
33 and it makes a lot of difference with the resources ^^
Posted: 11 Dec 2006, 02:43
by Snipawolf
Hmm..
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.
Now: Imagine the exact same on the other side.
Would it look like a hand?
Posted: 11 Dec 2006, 03:19
by Maelstrom
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.
Posted: 11 Dec 2006, 03:23
by Snipawolf
Hmm, I got an idea, thanks for the answer.
Is there anyway to give it a 3D feel though? Like making those pieces of paper a lot fatter?
Posted: 11 Dec 2006, 03:28
by FLOZi
Model them?
