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

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

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

Post by Snipawolf »

1. Is it possible to have a metal extractor be able to make its own metal and extract it, but only work if its on a metal patch?


(By the way, if anyone has any questions, put them here.)
SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

Post by SpikedHelmet »

AFAIK no... something like that, I believe, is up to map-makers. They can determine how much metal is outputted over "normal" ground (as opposed to on actual metal patches). I may be wrong, though. Can anyone else stipulate?
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

The idea of a forum is already that you can ask questions... you don't really have to put them in one thread ;)

You can set a metal make and a metal extract value. The metal make will always work, and metal extract will only matter on metal spots.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

You could detect the metal extraction level in the script and use it to activate the building - switching on the metal making. I think.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Could I disable the ability to manually turn it on? What I am looking for is an extractor, that also produces bonus metal, but only can be turned on if its extracting..

Maybe I can script it or something, but I don't want people building mexes just for the free metal :?

(PS: I am forcefully taking over spring maps, I am hardly going to use the extractor for the metal, I am going to just make it make metal... But I need it to have to be made on a metal patch)

If any of that got through to you, thanks for your help..
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

Snipawolf wrote:Could I disable the ability to manually turn it on?
Onoffable=0; in the FBI.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

So then, I could use some fancy scripting, and make it to where it produces as much metal as I want, but only on a metal patch/when extracting?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

I have a different idea. You could use a huge extraction radius (visually) and then check inside of that radius by script if there's another extractor. If there is none, then the building activates and produces resources. It's independent from mex spots though and probably doesn't work quite out on smaller maps.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

That's an interesting idea..
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Hm one resource generator could cover 25% of an 8x8 (or 4x4) map, then it'd work out. This forces the player to expand as well because he needs territory.
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

Just go with the original idea of onoffable=0 and turn it on via script only if its on a metal patch.

The toher idea about checking forother extractors is much more expesnive and much more difficult and buggy.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Another one, and I am going to favorite this topic, I don't wanna lose it..

Q: I forgot how, but could someone supply me with a random burst script from 10-20 bullets?
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

Wouldn't a regular custom weapon with the appropriate accuracy and burst radius etc values work just fine?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Snipawolf wrote:Another one, and I am going to favorite this topic, I don't wanna lose it..

Q: I forgot how, but could someone supply me with a random burst script from 10-20 bullets?

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;
	}
}
Use a low reload time for that in the weapon tdf.

edit: Duh goddamn spammers :P
Last edited by rattle on 15 Oct 2006, 05:19, edited 5 times in total.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

yeah, but what connects the ammo to the TDF... I still dislike scripting X.x
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Nothing. You have to do random bursts by scripting.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

DUH, it makes sense... It fires weapon, using the ammo, eh?

Could this be used to make two burst fires in a row, say, 10 shots each time?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Edited. Should work, didn't test it though...
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

I'm probably going to remember that :P

Seems easy enough... I'll have scripting totally learned in a few weeks, when I start scripting..
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

I don't know how its supposed to be, but I know how it works..


We can fire weapons using scripts? We have dynamic blood..

Fire a weapon like 2 feet in front of the guy using a script, and the "Burnmark" on the ground can be a bloody splat?

Would dat work?
Locked

Return to “Game Development Tutorials & Resources”