View topic - Mod Question Repository... Questions come in, answers go out



All times are UTC + 1 hour


Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 1168 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 59  Next
Author Message
 Post subject:
PostPosted: 26 Oct 2006, 20:55 
User avatar

Joined: 15 Dec 2004, 20:53
Location: London
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...


Top
 Offline Profile  
 
 Post subject:
PostPosted: 26 Oct 2006, 22:16 

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 8)) 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! :wink:


Top
 Offline Profile  
 
 Post subject:
PostPosted: 28 Oct 2006, 02:34 
Modeler
User avatar

Joined: 12 Dec 2005, 01:49
Copying

Code:
#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..


Top
 Offline Profile  
 
 Post subject:
PostPosted: 28 Oct 2006, 17:11 
Modeler
User avatar

Joined: 12 Dec 2005, 01:49
Code:
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:
Error (1): ')' expected    [ C:\Program Files\TASpring\mods\Forgotten Chronicles\Mongoose.bos ]


Top
 Offline Profile  
 
 Post subject:
PostPosted: 28 Oct 2006, 18:50 
Damned Developer
User avatar

Joined: 01 Jun 2006, 12:15
Location: Banned user for reason “Do not post pictures of people fucking cars”
Quote:
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...
Quote:
AimPrimary(heading, pitch)


I can't tell you if it works however,


Top
 Offline Profile  
 
 Post subject:
PostPosted: 28 Oct 2006, 18:51 
Damned Developer
User avatar

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 8)) 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! :wink:


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... :)


Top
 Offline Profile  
 
 Post subject:
PostPosted: 28 Oct 2006, 18:54 
Modeler
User avatar

Joined: 12 Dec 2005, 01:49
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 :mrgreen:


Top
 Offline Profile  
 
 Post subject:
PostPosted: 04 Nov 2006, 02:13 
Modeler
User avatar

Joined: 12 Dec 2005, 01:49
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?


Top
 Offline Profile  
 
 Post subject:
PostPosted: 05 Nov 2006, 12:06 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
Quote:
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.


Top
 Offline Profile  
 
 Post subject:
PostPosted: 06 Nov 2006, 00:33 
Modeler
User avatar

Joined: 12 Dec 2005, 01:49
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 :?


Top
 Offline Profile  
 
 Post subject:
PostPosted: 07 Nov 2006, 22:55 
Modeler
User avatar

Joined: 12 Dec 2005, 01:49
Got a new question: How fast do the cursor animations play? I hope 100ms or so...


Never mind, they go as fast as frames...


Top
 Offline Profile  
 
 Post subject:
PostPosted: 08 Nov 2006, 00:23 
Damned Developer
User avatar

Joined: 01 Jun 2006, 12:15
Location: Banned user for reason “Do not post pictures of people fucking cars”
Engine frames I assume which is unrelated to FPS.


Top
 Offline Profile  
 
 Post subject:
PostPosted: 08 Nov 2006, 01:06 
Modeler
User avatar

Joined: 12 Dec 2005, 01:49
As long as it is similar to 100ms, I should be fine...


Top
 Offline Profile  
 
 Post subject:
PostPosted: 10 Nov 2006, 12:50 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
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?


Top
 Offline Profile  
 
 Post subject:
PostPosted: 10 Nov 2006, 13:01 
User avatar

Joined: 31 Jan 2006, 20:53
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...


Top
 Offline Profile  
 
 Post subject:
PostPosted: 10 Nov 2006, 13:14 
User avatar

Joined: 17 Nov 2004, 20:19
Location: Behind You! :evil:
Quote:
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 ^^


Top
 Offline Profile  
 
 Post subject:
PostPosted: 11 Dec 2006, 02:43 
Modeler
User avatar

Joined: 12 Dec 2005, 01:49
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 :wink: )

Image

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?


Top
 Offline Profile  
 
 Post subject:
PostPosted: 11 Dec 2006, 03:19 
User avatar

Joined: 23 Jul 2005, 13:52
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.


Top
 Offline Profile  
 
 Post subject:
PostPosted: 11 Dec 2006, 03:23 
Modeler
User avatar

Joined: 12 Dec 2005, 01:49
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?


Top
 Offline Profile  
 
 Post subject:
PostPosted: 11 Dec 2006, 03:28 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
Model them? :lol:


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 1168 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 59  Next

All times are UTC + 1 hour


Who is online

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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.