Random questions

Random questions

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
pin_
Posts: 49
Joined: 22 Jul 2006, 16:12

Random questions

Post by pin_ »

To avoid opening several threads I'll post all my questions in this thread and mark them with *solved* as they get answered.


[solved]How can I rescale units (i.e. tanks bigger, units smaller)?

[partially solved]Where can I found the sound management scripts? For instance I'd like to disable the sound made by PeeWee when I issue a move order. Ideally i'd like it make the sound once in a while but since I think that's not possible I'd like to have it disabled for now.

Thanks

_______________________________________________________________
_______________________________________________________________

I'm making my first TASpring mod. So far I've modified one unit: Zipper (known also as ARMFAST). If someone wants to help me (beta) test the mod you can get it here:
http://www.proimpact.ro/download/TACTICS.sdz
I'm trying to take a tactical/simulation aproach. Any thoughts ideas are welcome.
BTW: If you download the mod use the Total War camera (Ctrl+J) otherwise it'll get frustrating pretty fast
Last edited by pin_ on 02 Aug 2006, 10:59, edited 5 times in total.
User avatar
Foxomaniac
Posts: 691
Joined: 18 Jan 2006, 16:59

Post by Foxomaniac »

gamedata/sound.tdf
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

gamedata\sound.tdf

Find the class the Peewee uses (you can look that up in units\armpw.fbi).

You could make it only play once in a while (for start/stop sounds at least) by doing this in the script:

Code: Select all

StartMoving() {
	var blah;
	blah = rand(1,1000);
	if(blah > 10) {
		play-sound("startmovingsound",10);
	}
}
StopMoving() {
	var blah;
	blah = rand(1,1000);
	if(blah > 10) {
		play-sound("stopmovingsound",10);
	}
}
That would make the sounds play 10 times for every thousand, on average. Of course, this is also per-unit, so if you have 1000 peewees with this you'll probably get 10 doing. Laws of probability and stuff. In any case, you'll want to search the forum for my thread about the "play-sound" operator; I made a lengthy topic about it a while back explaining how it works.

One thing to note if you use this method, however, is that when a player FPS's a unit, StartMoving is called every frame, meaning it's very likely the sound would get played at annoying times. There's no way to avoid this atm.
User avatar
unpossible
Posts: 871
Joined: 10 May 2005, 19:24

Post by unpossible »

Gnome wrote: One thing to note if you use this method, however, is that when a player FPS's a unit, StartMoving is called every frame, meaning it's very likely the sound would get played at annoying times. There's no way to avoid this atm.
so can observers (eg spec/other players in a game) hear this drone? Does it lag like hell?
pin_
Posts: 49
Joined: 22 Jul 2006, 16:12

Post by pin_ »

Thanks!
Gnome wrote:gamedata\sound.tdf

Find the class the Peewee uses (you can look that up in units\armpw.fbi).

You could make it only play once in a while (for start/stop sounds at least) by doing this in the script:

Code: Select all

StartMoving() {
	var blah;
	blah = rand(1,1000);
	if(blah > 10) {
		play-sound("startmovingsound",10);
	}
}
StopMoving() {
	var blah;
	blah = rand(1,1000);
	if(blah > 10) {
		play-sound("stopmovingsound",10);
	}
}
That would make the sounds play 10 times for every thousand, on average. Of course, this is also per-unit, so if you have 1000 peewees with this you'll probably get 10 doing. Laws of probability and stuff. In any case, you'll want to search the forum for my thread about the "play-sound" operator; I made a lengthy topic about it a while back explaining how it works.

One thing to note if you use this method, however, is that when a player FPS's a unit, StartMoving is called every frame, meaning it's very likely the sound would get played at annoying times. There's no way to avoid this atm.
Gnome could you detail where should I pass that code for random sound or post a link to that topic you mentioned?

Am I supposed to put that code in the sound script for PeeWee?

Code: Select all

[ARMPW]
{
	select1=servtny2;
	ok1=servtny2;
	arrived1=servtny2;
	cant1=cantdo4;
	underattack=warning1;
	count5=count1;
	count4=count2;
	count3=count3;
	count2=count4;
	count1=count5;
	count0=count6;
	canceldestruct=cancel2;
}

[EDIT] After some research I'd guess that goes in the COB files.
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

As for scaling units, I'm not exactly sure. I haven't been press-ganged into service on any scripting that effects that - but as most of it is achieved through mutators, I assume it is achieved through scripting. Consult Fang or Aun, they seem to have solid knowledge of the subject.
User avatar
Felix the Cat
Posts: 2383
Joined: 15 Jun 2005, 17:30

Post by Felix the Cat »

Since this thread is "Random questions" and I have a random question... it is possible to SHOW/HIDE pieces based on unit damage. Is it possible to enable and disable individual weapons? How about changing the fire arc based on unit damage?

Basically, I'm looking at making a mod that has infantry squads as its base unit, with 10 or 12 soldiers per squad, and HIDEing soldiers as the squad is damaged, disabling their weapons.

One more question:
Assume the squad is laid out in a box like this, where each letter represents a "soldier", and each "soldier" has a weapon attached to it.

FRONT

Code: Select all

A B C D
E F G H
I J K L
M N O P
BACK

Now, if each soldier has a weapon that is arced toward the front, will all of the soldiers still be able to fire, despite the fact that IJKL and especially MNOP are firing through the majority of the squad? (Obviously I'm not concerned with graphics at the moment; squads will be small and bullets will be invisible, so it won't look too weird, hopefully.)
Hunter0000
Posts: 197
Joined: 04 Nov 2004, 00:33

Post by Hunter0000 »

Well, to my knowlage FF's cpaital ships get thier turrets blown off as they are damaged so I'd say yes. But not being a scripter I can't tell you how.

Second question.. not sure how all that works.
j5mello
Posts: 1189
Joined: 26 Aug 2005, 05:40

Post by j5mello »

Felix the Cat wrote:Since this thread is "Random questions" and I have a random question... it is possible to SHOW/HIDE pieces based on unit damage. Is it possible to enable and disable individual weapons? How about changing the fire arc based on unit damage?
these can be done, i think. i know specifically that the gundams lose their shields after losing a certain %age of health so the show/hide thing is possible. this was looked into for the Epic 40k Mod that fell thru but squads were dropped cause when turning they would look really odd.
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

Yes, it's part of the script, pin.

Oh, hell, didn't even notice the scaling bit before. No, you cannot scale pieces dynamically in game. The best you can do is copy-pasting the piece several times, then showing and hiding them in sequence.

Felix: As I answered in another topic recently, return FALSE; in a weapon's AimWeaponX() function to jam it. What the conditions for that jam are is up to you. Arcing like that shouldn't be a problem, I'm relatively sure units don't have a problem firing through themselves like that.

However, it's going to look like crap. The engine simply is not cut out for squad combat. It'll especially look bad if they ever get tossed into the air... They'll also all turn in a very unnatural fashion... imagine a tank with 16 spikes and how it would look when it turned.

And that's ignoring the massive amount of work which will be required to script this squad so they resemble humans at all...

[edit] much hate to you, j5 :P
j5mello
Posts: 1189
Joined: 26 Aug 2005, 05:40

Post by j5mello »

i return that hate with a large side of loathing :P
Post Reply

Return to “Game Development”