Page 1 of 1

Factories?

Posted: 21 Nov 2007, 19:53
by rcdraco
This is either a fix request, or a free script request.

A few rules:

1. Can't use OTA content.

2. Can't use OTA headers.

3. Try not to use names similar to OTA.

Here is the script:

http://pastebin.ca/792670

Here is the model and texture.

http://www.unknown-files.net/spring/3790/euefac/

Here is the FBI:

Code: Select all

[UNITINFO]
	{
	Name=E-Factory;
	UnitName=euefac;
	BuildCostEnergy=100;
	BuildCostMetal=400;
	BuildTime=10;
	Buildpic=ehcraft.bmp;
	Category=FACTORY;
	Description=Light Factory;
	FootprintX=6;
	FootprintZ=6;
	MaxDamage=4500;
	ObjectName=euefac.s3o;
	Side=EUROPIAN;
	SoundCategory=SOUND;
	TEDClass=PLANT;
	SightDistance=625;
	MovementClass=TANK1;
	MaxSlope=30;
	Builder=1;
	WorkerTime=20;
	YardMap=occcco occcco occcco occcco occcco occcco;
	wpri_badTargetCategory=ANTILASER;
	wspe_badTargetCategory=VTOL;
	BadTargetCategory=ANTILASER;
	ExplodeAs=SMALL_BUILDINGEX;
	SelfDestructAs=SMALL_BUILDING;
	NoChaseCategory=ALL;
	LeaveTracks=0;
	MaxWaterDepth=35;
	SmoothAnim=0;
	idletime=400;
	idleautoheal=10;
	shownanospray=0;
	shownanoframe=0;
	firestandorders=1;
	mobilestandorders=1;
	standingfireorder=2;
	standingmoveorder=2;
	}


Posted: 21 Nov 2007, 19:59
by tombom
So what's the problem?

yea

Posted: 21 Nov 2007, 19:59
by rcdraco
Pretty much, the factory is open, but it will not build.

Posted: 21 Nov 2007, 20:02
by Forboding Angel
MY factory script dunno if it wikll help.

Code: Select all

#define TA			// This is a TA script

#include "sfxtype.h"
#include "exptype.h"

piece  factory, shield, nano1, nano2;

static-var  spray, unitviewer, statechg_DesiredState, statechg_StateChanging;

// Signal definitions
#define SIG_ACTIVATE			2



SmokeUnit(healthpercent, sleeptime, smoketype)
{
	while( get BUILD_PERCENT_LEFT )
	{
		sleep 400;
	}
	while( TRUE )
	{
		healthpercent = get HEALTH;
		if( healthpercent < 66 )
		{
			smoketype = 256 | 2;
			if( Rand( 1, 66 ) < healthpercent )
			{
				smoketype = 256 | 1;
			}
			emit-sfx smoketype from factory;
		}
		sleeptime = healthpercent * 50;
		if( sleeptime < 200 )
		{
			sleeptime = 200;
		}
		sleep sleeptime;
	}
}

OpenYard()
{
	set YARD_OPEN to 1;
	while( !get YARD_OPEN )
	{
		set BUGGER_OFF to 1;
		sleep 1500;
		set YARD_OPEN to 1;
	}
	set BUGGER_OFF to 0;
}

CloseYard()
{
	set YARD_OPEN to 0;
	while( get YARD_OPEN )
	{
		set BUGGER_OFF to 1;
		sleep 1500;
		set YARD_OPEN to 0;
	}
	set BUGGER_OFF to 0;
}

Go()
{
	call-script OpenYard();
	set INBUILDSTANCE to 1;
}

Stop()
{
	set INBUILDSTANCE to 0;
	call-script CloseYard();
}

InitState()
{
	statechg_DesiredState = TRUE;
	statechg_StateChanging = FALSE;
}

RequestState(requestedstate, currentstate)
{
	if( statechg_StateChanging )
	{
		statechg_DesiredState = requestedstate;
		return (0);
	}
	statechg_StateChanging = TRUE;
	currentstate = statechg_DesiredState;
	statechg_DesiredState = requestedstate;
	while( statechg_DesiredState != currentstate )
	{
		if( statechg_DesiredState == 0 )
		{
			call-script Go();
			currentstate = 0;
		}
		if( statechg_DesiredState == 1 )
		{
			call-script Stop();
			currentstate = 1;
		}
	}
	statechg_StateChanging = FALSE;
}

Create()
{
	unitviewer = FALSE;
	spray = factory;
	call-script InitState();
	start-script SmokeUnit();
}

QueryNanoPiece(piecenum)
{
	if( spray == 0 )
	{
		piecenum = nano1;
	}
	if( spray != 0 )
	{
		piecenum = nano2;
	}
	spray = !spray;
}

Demo()
{
	unitviewer = TRUE;
}

Activate()
{
	signal SIG_ACTIVATE;
	start-script RequestState(0);
}

Deactivate()
{
	signal SIG_ACTIVATE;
	set-signal-mask SIG_ACTIVATE;
	if( !unitviewer )
	{
		sleep 5000;
	}
	set-signal-mask 0;
	start-script RequestState(1);
}

StartBuilding()
{
}

StopBuilding()
{
}

QueryBuildInfo(piecenum)
{
	piecenum = shield;
}

SweetSpot(piecenum)
{
	piecenum = factory;
}

Killed(severity, corpsetype)
{
	if( severity <= 25 )
	{
		corpsetype = 1;
		explode factory type BITMAPONLY | BITMAP1;
		return (0);
	}
	if( severity <= 50 )
	{
		corpsetype = 2;
		explode factory type BITMAPONLY | BITMAP1;
		return (0);
	}
	if( severity <= 99 )
	{
		corpsetype = 3;
		explode factory type BITMAPONLY | BITMAP1;
		return (0);
	}
	corpsetype = 3;
	explode factory type BITMAPONLY | BITMAP1;

}

Posted: 21 Nov 2007, 20:03
by rcdraco
I said before, I want a free one, aparantely BUGGGER_OFF, and YARD_OPEN aren't used by spring.

Posted: 21 Nov 2007, 20:25
by KDR_11k
Ewww, statechg.h

I suggest you look into the Kernel Panic scripts.

really

Posted: 21 Nov 2007, 20:27
by rcdraco
I was asking more on the lines of a readible script, I'm making a factory, not a tarantula.

Posted: 21 Nov 2007, 20:30
by KDR_11k
Socket or Window.

Re: really

Posted: 21 Nov 2007, 20:31
by tombom
rcdraco wrote:I was asking more on the lines of a readible script, I'm making a factory, not a tarantula.
What are you talking about? :?

yea

Posted: 21 Nov 2007, 20:35
by rcdraco
KDR wins, window is super easy.

Posted: 21 Nov 2007, 20:44
by lurker
rcdraco wrote:This is either a fix request, or a free script request.

A few rules:

1. Can't use OTA content.

2. Can't use OTA headers.

3. Try not to use names similar to OTA.
Forboding Angel wrote:MY factory script dunno if it wikll help.

Code: Select all

#define TA			// This is a TA script

#include "sfxtype.h"
#include "exptype.h"

piece  factory, shield, nano1, nano2;

static-var  spray, unitviewer, statechg_DesiredState, statechg_StateChanging;

// Signal definitions
#define SIG_ACTIVATE			2


Demo()
{
	unitviewer = TRUE;
}
:? Is that in Evolution? I'm happy to do scripting for you.

no

Posted: 21 Nov 2007, 21:03
by rcdraco
now there's a new issue.


The factory will build units, but it has a pause and I can't queue up units...

Posted: 22 Nov 2007, 05:17
by Felix the Cat
This is in off-topic so I will post a picture that I hope will help you with your problem.

Image

Carry on.

yea

Posted: 22 Nov 2007, 06:08
by rcdraco
It's in off-topic so as not to flood the message boards. The problem has already been solved. Also, Felix, cease and desist, you want to be a jerk do it with PM.

Posted: 22 Nov 2007, 06:22
by Forboding Angel
lurker wrote:
rcdraco wrote:This is either a fix request, or a free script request.

A few rules:

1. Can't use OTA content.

2. Can't use OTA headers.

3. Try not to use names similar to OTA.
Forboding Angel wrote:MY factory script dunno if it wikll help.

Code: Select all

#define TA			// This is a TA script

#include "sfxtype.h"
#include "exptype.h"

piece  factory, shield, nano1, nano2;

static-var  spray, unitviewer, statechg_DesiredState, statechg_StateChanging;

// Signal definitions
#define SIG_ACTIVATE			2


Demo()
{
	unitviewer = TRUE;
}
:? Is that in Evolution? I'm happy to do scripting for you.
Yar it is. Due to large amounts of copypasta, things like demo and sweetspot tend to get overlooked.

My scripts generally are very not complicated, but if you want to do scripting for it you are welcome to. If you like, I'll give you an invite to svn, just pm me your email addy.

Re: yea

Posted: 22 Nov 2007, 07:33
by Felix the Cat
rcdraco wrote:It's in off-topic so as not to flood the message boards. The problem has already been solved. Also, Felix, cease and desist, you want to be a jerk do it with PM.
Should I choose to interpret that as an invitation to send large numbers of irrelevant pictures of a possibly pornographic nature via PM? :o

Also, lern2skript kthxBAI.

Re: yea

Posted: 22 Nov 2007, 16:03
by manored
Felix the Cat wrote:
rcdraco wrote:It's in off-topic so as not to flood the message boards. The problem has already been solved. Also, Felix, cease and desist, you want to be a jerk do it with PM.
Should I choose to interpret that as an invitation to send large numbers of irrelevant pictures of a possibly pornographic nature via PM? :o

Also, lern2skript kthxBAI.
I think he wanted you to interpret that as a invitation to stop anyoing people :)

Posted: 22 Nov 2007, 22:18
by Comp1337
is this thread moist

Posted: 23 Nov 2007, 00:15
by Neddie
Moist and locked. It has served the purpose it was crafted for.