Battlestar Galactica - Page 3

Battlestar Galactica

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

daan 79

Re: Battlestar Galactica

Post by daan 79 »

zwzsg style mastery. oh well ther is magic,

YEt the hitsheres are borked but i made them anyway. YEs i was not forgeting you AF that was what i was trying to say. But Kovin and I were not sure to use it since they show up anywhere(unit). Anyway this is not going as planed and i like to discuss these matters but basicully we now just having a hard time getting fighters in. kamikazi and we want some live and kicking ones. gunships is by my saying no option but we gonna test two versions. The hitsheres: i am not gonna dephelop some hitshere since i have hard time dealing with bos. Seems i think i can think of one person htat could help me fiz bos. well we not going to png community, we desided to keep the big textures.

so say we all
Kovin
Posts: 28
Joined: 11 Feb 2006, 10:21

Re: Battlestar Galactica

Post by Kovin »

First I need to tell that bos/cob scripts *are* needed. You think unit like Battlestar does not have other weapons then fighters? Even then, you need at least basic cob with weapon slot you can fire, to create fake weapon drone script use to send attack command.
Second - for testing, I imported Final Frontier Core Ifrit fighter (fighter you send me has transparent texture, I was not aware that humans or cylons developed such advanced cloaking technology :( )
Third - Daan, you really need to get your svn running, at least then we can synchronise the project.
Fourth - look at the screenie how big Galactica is compared to fighter - I made a circle around it cause it's bit hard to see.
Fifth - You are lucky you don't see Galactica and Basestar in motion, believe me, it's much worse. Galactica is moving backward and Basestar to side - striking similarity with our mod developement efforts, don't you think?
screen006_2.JPG
OMD I am so lame... I don't even know how to make the screenie visible in forum and not add it as download content.
(207.56 KiB) Downloaded 94 times
daan 79

Re: Battlestar Galactica

Post by daan 79 »

i will work on those boses and cobs,
Maybe i should reconsider my scalings. And i got a fresh install i will run svn today. sorry about that texture must have been a screw up when i was experimentating with png. Soem how i manged to save it as tga. OR somthing dont know really. i was thinking about that picture you sure you dont use transparant texture :D.

daan
daan 79

Re: Battlestar Galactica

Post by daan 79 »

to keeps things going i started tto read some stuff about bos-files. Het is my first try for a cylon raider. This model has two places where it can shoot from in front called its primari weapon.(i am not sure if two empty pieces can funtion as one weapon). Than ther are soem fx effects comming from the pieces i put at the end of the model. This all made sence. Those fx i am not sure in what place they should be in the mod and where they should consist off. Than ther is this core lander i used to get this bos going has no weapons i believe so probelly no reload time script and fx script or bmp. I wunder what this bos misses so i could start trying to get laser beems(not like penetrator, but with pulses) with this model. Here is were i ended.

Oh and since this is for space i thought its a good thing the corpse not shows up when the unit crashes. But if i wanted to have a lilited unit that leaves a wreck how can that be done? i think i can remove the last lines almost intirely since they describe how the plain crashes. Maybe the 3 last lines will do the trick. i would like when units die they urn and explode like the commander ships in gundam



Base, LaserA, LaserB, ExhaustA, ExhaustB, ExhaustC;

static-var restore_delay,moving;

#define SIG_AIM 2

#include "StateChg.h"
#include "exptype.h"

#define ACTIVATECMD call-script activatescr();
#define DEACTIVATECMD call-script deactivatescr();
#include "StateChg.h"
Flamingass()
{
while(TRUE)
{
if (moving)
{
emit-sfx 0 from ExhaustA;
emit-sfx 0 from ExhaustB;
emit-sfx 0 from ExhaustC;
}
sleep 130;
}

}

StartMoving()
{
start-script Flamingass();
moving=0;
}

StopMoving()
{ moving=0; }

Create()
{ restore_delay=1000; }

FirePrimary()
{ sleep 120; }

AimFromPrimary(piecenum)
{ piecenum=LaserA, LaserB; }

SweetSpot(piecenum)
{ piecenum=Base; }

Killed( severity, corpsetype )
{
if (severity <= 25)
{
corpsetype = 1;
explode base type FALL | SMOKE | EXPLODE_ON_HIT | BITMAP5;
return( 0 );
}

if (severity <= 50)
{
corpsetype = 2;
explode base type FALL | SMOKE | EXPLODE_ON_HIT | BITMAP5;
return( 0 );
}

if (severity <= 99)
{
corpsetype = 3;
explode base type FALL | SMOKE | EXPLODE_ON_HIT | BITMAP5;
return( 0 );
}

corpsetype = 3;
explode base type SHATTER | EXPLODE_ON_HIT | BITMAP1;
return( 0 );
}
Kovin
Posts: 28
Joined: 11 Feb 2006, 10:21

Re: Bos/Cob

Post by Kovin »

Yes, one weapon can have several places where it shoots from - for example, TA battleships have several barrels and it uses them all. Or, Final Frontier unit Morningstar - it shoots plasma cannon from the holes on the left and right side. Longbow? It has 16 missile silos. It's still counted as one weapon. Look at it if you want.
I only hope I am not talking nonsense about the weapons, I am real noob in bos/cob, so if there is someone who can correct or confirm, please do so.

Well, corpses are defined somewhere else, but for example, no Final Frontier fighter has corpse - they are simply so small that when they are killed, there is nothing left. Look at some Final Frontier fighter like Wildcat or Bearcat if you want to see working bos scripts for fighters.
daan 79

Re: Battlestar Galactica

Post by daan 79 »

it gives an error when compiling

BUILD_PERCENT_LEFT

error 11 unknown identifier

here is the original bos file

piece Base, LaserA, LaserB, ExhaustA, ExhaustB, ExhaustC;

static-var restore_delay,moving;

static-var gun_1, Static_Var_2;

#define SIG_AIM 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 flare1;
}
sleeptime = healthpercent * 50;
if( sleeptime < 200 )
{
sleeptime = 200;
}
sleep sleeptime;
}
}

Create()
{
hide flare1;
hide flare2;
gun_1 = 0;
Static_Var_2 = 0;
start-script SmokeUnit();

}


#include "StateChg.h"
#include "exptype.h"

#define ACTIVATECMD call-script activatescr();
#define DEACTIVATECMD call-script deactivatescr();
#include "StateChg.h"
Flamingass()
{
while(TRUE)
{
if (moving)
{
emit-sfx 0 from ExhaustA;
emit-sfx 0 from ExhaustB;
emit-sfx 0 from ExhaustC;
}
sleep 130;
}

}

StartMoving()
{
start-script Flamingass();
moving=0;
}

StopMoving()
{ moving=0; }

Create()
{ restore_delay=1000; }

FirePrimary()
{ sleep 120; }

AimFromPrimary(piecenum)
{ piecenum=LaserA, LaserB; }
AimFromWeapon1(piecenum)
{
piecenum = LaserA, LaserB;
}

QueryWeapon1(piecenum)
{
if( gun_1 == 0 )
{
piecenum = LaserA;
}
if( gun_1 == 1 )
{
piecenum = LaserB;
}
if( gun_1 == 2 )
{
piecenum = LaserA;
}
if( gun_1 == 3 )
{
piecenum = LaserB;
}
if( gun_1 == 4 )
{
piecenum = LaserA;
}
if( gun_1 == 5 )
{
piecenum = LaserB;
}
if( gun_1 == 6 )
{
piecenum = LaserA;
}
if( gun_1 == 7 )
{
piecenum = LaserB;
}
}



SweetSpot(piecenum)
{ piecenum=Base; }



Killed( severity, corpsetype )
{
if (severity <= 25)
{
corpsetype = 1;
explode base type FALL | SMOKE | EXPLODE_ON_HIT | BITMAP5;
return( 0 );
}

if (severity <= 50)
{
corpsetype = 2;
explode base type FALL | SMOKE | EXPLODE_ON_HIT | BITMAP5;
return( 0 );
}

if (severity <= 99)
{
corpsetype = 3;
explode base type FALL | SMOKE | EXPLODE_ON_HIT | BITMAP5;
return( 0 );
}

corpsetype = 3;
explode base type SHATTER | EXPLODE_ON_HIT | BITMAP1;
return( 0 );
}

I not sure also where i need to put the fx files. I probelly will find some assfire stuff in a folder in smoth mod but thats not my biggest concern. I now understand a little what the script is telling spring but somhow i cant figure out how the files connect with eachother. When i make a fbi for this unit does it mean spring just finds it? and if i finally manage to cob script this file do i just put it in. Should someone make a list wich all get settled in the bos file. Like guns, fx, hit places, animations, bahaviour of animations, and sertain actions when sertain situations accure for instance. I think this list is much bigger but i cant seem to find it. I think i read a list like this for fbi somewher.
daan 79

Re: Battlestar Galactica

Post by daan 79 »

Than i thought i might add the first lines in the bos like the other files have. But now i still getting errors.

error!
i totally have no cleu why this is erroring and what i am doing wrong!




#define TA // This is a TA script

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

piece Base, LaserA, LaserB, ExhaustA, ExhaustB, ExhaustC;

static-var restore_delay,moving;

static-var gun_1, Static_Var_2;

#define SIG_AIM 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 LaserA;
}
sleeptime = healthpercent * 50;
if( sleeptime < 200 )
{
sleeptime = 200;
}
sleep sleeptime;
}

}


#include "StateChg.h"
#include "exptype.h"

#define ACTIVATECMD call-script activatescr();
#define DEACTIVATECMD call-script deactivatescr();
#include "StateChg.h"
Flamingass()
{
while(TRUE)
{
if (moving)
{
emit-sfx 0 from ExhaustA;
emit-sfx 0 from ExhaustB;
emit-sfx 0 from ExhaustC;
}
sleep 130;
}

}

StartMoving()
{
start-script Flamingass();
moving=0;
}

StopMoving()
{ moving=0; }

Create()
{ restore_delay=1000; }

FirePrimary()
{ sleep 120; }

AimFromPrimary(piecenum)
{ piecenum=LaserA, LaserB; }
AimFromWeapon1(piecenum)
{
piecenum = LaserA, LaserB;
}

QueryWeapon1(piecenum)
{
if( gun_1 == 0 )
{
piecenum = LaserA;
}
if( gun_1 == 1 )
{
piecenum = LaserB;
}
if( gun_1 == 2 )
{
piecenum = LaserA;
}
if( gun_1 == 3 )
{
piecenum = LaserB;
}
if( gun_1 == 4 )
{
piecenum = LaserA;
}
if( gun_1 == 5 )
{
piecenum = LaserB;
}
if( gun_1 == 6 )
{
piecenum = LaserA;
}
if( gun_1 == 7 )
{
piecenum = LaserB;
}
}



SweetSpot(piecenum)
{ piecenum=Base; }



Killed( severity, corpsetype )
{
if (severity <= 25)
{
corpsetype = 1;
explode base type FALL | SMOKE | EXPLODE_ON_HIT | BITMAP5;
return( 0 );
}

if (severity <= 50)
{
corpsetype = 2;
explode base type FALL | SMOKE | EXPLODE_ON_HIT | BITMAP5;
return( 0 );
}

if (severity <= 99)
{
corpsetype = 3;
explode base type FALL | SMOKE | EXPLODE_ON_HIT | BITMAP5;
return( 0 );
}

corpsetype = 3;
explode base type SHATTER | EXPLODE_ON_HIT | BITMAP1;
return( 0 );
}
Kovin
Posts: 28
Joined: 11 Feb 2006, 10:21

Re: Battlestar Galactica

Post by Kovin »

The easiest way is to ask in #moddev channel - you can show them the script through http://www.pastebin.com and ask them what is wrong. They really know bos/cob.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Battlestar Galactica

Post by Argh »

Um, or he could, y'know... read through P.U.R.E.'s BOS files, which contain examples of stuff using more than one gun barrel.

Or Gundam Annihilation, which has all the BOS files. Or maybe KDR's game. Oh, wait! NanoBlobs has all the BOS files included, too... :?
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Re: Battlestar Galactica

Post by Peet »

piecenum=LaserA, LaserB; is your problem, you can't a variable to two things at once ^_^;
SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

Re: Battlestar Galactica

Post by SpikedHelmet »

or you could do

if gun_1 == 1
piecenum = LaserA

if gun_1 != 1
piecenum = LaserB

I think.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: Battlestar Galactica

Post by rattle »

Or use a static-var and assign it a piece during weapon switching in FireWeaponX/ShotX.

Like

Code: Select all

static-var firepoint1, curWeapon;
...
QueryWeapon1(piecenum)
{
	piecenum = firepoint1;
}
Shot1()
{
	if (!curWeapon) {
		++curWeapon;
		firepoint1 = LaserA;
	}
	else {
		--curWeapon;
		firepoint1 = LaserB;
	}
}
...
Create()
{
	...
	firepoint1 = LaserA;
	curWeapon = 0;
	...
}
Archangel of Death
Posts: 854
Joined: 28 Jan 2005, 18:15

Re: Battlestar Galactica

Post by Archangel of Death »

Last I tried Scriptor at least didn't like trying to put a static-var's value into a piecenum. You've got me wanting to try again now though, wondering if maybe I just did it wrong. :?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: Battlestar Galactica

Post by rattle »

As long as you assign an actual piece to the static-var it works fine.
Above code works, been using it before.
Archangel of Death
Posts: 854
Joined: 28 Jan 2005, 18:15

Re: Battlestar Galactica

Post by Archangel of Death »

Ah, ok.
daan 79

Re: Battlestar Galactica

Post by daan 79 »

ehm argh yes i take advatage to use your files since they are very easy to read because of all the side info you put in them. :D I so waiting to play that pure mod. It really is very cool mod. And has the best bots i believe in spring. This is totally onexceptable that it dont get played. The files i working on now are more complete however i not knowing what file conflict what file wich is very confusing. i found out that while compiling ther should be 2 .h files be in same folder. Well i not sure if this file needs to consist out of some basic code or a standard code. Besides that i am trying to make fbi work but somehow ther is also lua posibilities so not sure i am doing extra work to start with fbi or go direct to lua fbi. Than I still wanna host pure if i could somebody plz host it its the best mod around for what i have seen now. I think i made a better bos now but still got bugs till i got those .h files in order i will test compiling. Oh and we starting to edit some textures. We will maintain somestuff to another plz after a couple of weeks. http://www.cuneiforme.nl/ since i fail at websides it might be weeks :P

greets
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Battlestar Galactica

Post by zwzsg »

Argh wrote:Um, or he could, y'know... read through P.U.R.E.'s BOS files, [...] NanoBlobs has all the BOS files included, too...
And get sued by WolfeGames? :wink:
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Battlestar Galactica

Post by Argh »

Daan sent me a PM indicating he was trying to just compile some of my code from P.U.R.E., and was mystified about all of the includes I use, etc.

Daan, here... use this stuff, instead. It's simple, it'll work, and it's a lot less work than backtracking through all the stuff I do in P.U.R.E., which I probably shouldn't have pointed you towards, given that it's not exactly newbie-friendly and well-commented yet...

To help you along, here is a complete scripted solution for a simple, 2-gun fighter, using a unified aiming arc. This would be suitable for, say, a fighter, like the fighters in Battlestar Galactica, where we don't care about moving parts, etc. It also includes code for a flare to be displayed, and for an explosion FX script to be run upon death (which I personally prefer, because then you can randomize the outcomes, but you armchair-coder people, feel free to whine, this was free advice, after all):

Hereby released, into Public Domain:

BOS CODE

This is really all the animation code you need, for something small that's tiny on-screen, and aims when its weapon's vector roughly matches a target. Oh, sure, you can make this fancier. But you don't have to, and this will work, right out of the box.

Code: Select all

//MyFighter Script, written by Argh.  Public Domain.


/*These defines basically just assign a number value to a string- whenever we use "GUNFLARE_FLASH", for example, the compiled version just reads "1024".  Technically, you don't even have to bother with this, but I find it makes scripts a lot easier to read, which is important when maintaining them...*/
#define GUNFLARE_FLASH 1024
#define EXPLOSION_FX 1024+1

/* Here are all the pieces in the .S3O.  Note that all pieces in the .S3O need to have the same names exactly- case must be the same (I always use lower-case).*/
piece base, flare_r, flare_l; 

/* Here's our single static variable, used to keep track of which gun we're firing.*/
static-var  gun;

AimFromWeapon1(piecenum)
{
	base;  /*We just use the base here, because the weapon never really aims, it just returns (1) if the aiming-arc is satisfied.   If using a turret or whatever, then you'd need to use something different here.*/
	return (0);
}

/*AimWeaponX(), where X = the weapon's number in the FBI, is how you call aiming conditions.  When the weapon's vector == the vector required by the target - the value of Tolerance in the weapon's TDF, the weapon will fire, in theory.*/

AimWeapon1(heading,pitch)
{
//Immediately return (1) to open fire, no motion is required
	return (1);
}

/*ShotX() is something KDR_11k added to the last version of Spring.  Very, very, very useful.  Basically, ShotX() is called right after AimWeaponX() returns TRUE.  It allows for stuff like global variables to be changed, so that weapons can change their firing-point in the middle of firing- previously impossible, due to Spring's weird volley code.  Very useful, and while you don't have to do this in ShotX(), I suggest it.  Also note that I'm doing the emit-sfx here, instead of doing it in FireWeapon().  I found that doing it here works just as well, and means that I can almost skip using FireWeapon entirely, for multi-point weapon systems.*/

Shot1(piecenum)
{
	if (gun == 0)
		{
		emit-sfx GUNFLARE_FLASH from flare_r;
		} else 
                {
		emit-sfx GUNFLARE_FLASH from flare_l;
		}		
	gun = !gun;
//Variable "gun" equals the logical-NOT of value of gun, i.e., either 1 or 0	
}	

/*QueryWeaponX() is what point the weapon actually comes out of.  It does not care whether this is "right" or not, so it had better be "right" by the time it gets here!*/

QueryWeapon1(piecenum)
{
	if (gun == 0)
		{
		piecenum = flare_r;		
		} else
		{
		piecenum = flare_l;		
		}	
}

/*FireWeaponX() is normally where we show stuff like flares, do animations, etc.  I have found that there aren't many advantages to doing it here instead of ShotX(), frankly.*/

FireWeapon1()
{
	return (0);  
/* Always include a return (0) here, or for some strange reason, Spring will run the Killed() script...*/
}

/*Create() is what happens when the Unit is put into the gameworld.  You can do lots of amazing stuff here- everything from move all of the pieces to preset positions (I do this a lot in P.U.R.E.) to starting scripts that have to run all of the time, until your Unit dies, to hiding stuff you need to include in the model, like flares, but which can work even if it's invisible, like flares.*/

Create()
{
hide flare_r;
hide flare_l;
}

/*Killed starts when Spring is informed that a Unit has less than 0 health remaining.  Killed scripts can call other scripts, to perform animations or do other tasks, but eventually all scripts need to return to the Killed() script, which needs to return (somevalue), which literally returns a value to Spring, which it can use to determine what Corpse should be shown.   Or the Unit needs to be removed from the gameworld via LUA, but that goes well outside the scope of this simple code example.*/

Killed()
{
hide base;
emit-sfx EXPLOSION_FX from base;
return (0);
}
FBI

This is a sample FBI for our simple fighter, just showing structure and a few basic tricks, including customized flight code parameters (safe ones, you can actually hack more of the flight code, if you're willing to put up with borked results).

Hereby released into Public Domain:

Code: Select all

[UNITINFO]
{
	//Internal settings 
	Name=MyFighter;
	UnitName=MyFighter;
	ObjectName=MyFighter.s3o;
	Description=:  A sample fighter.; 
	BuildPic=MyFighter.JPG; 
	Category=EVERYTHING;//Only needed if you need to call it by aiming conditions 

	//Unit limitations and properties 
	MaxDamage=2000; 
	SightDistance=512;
	SoundCategory=MyFighter;
	FootprintX=3;
	FootprintZ=3;

	//Energy and metal related
	BuildTime=1;
	BuildCostEnergy=1; 
	BuildCostMetal=1;

	//Abilities 
	CanGuard=1; 
	ArmorType=default;//CHANGE TO APPROPRIATE CATEGORY

	//Abilities new to Spring 
	iconType=MyFighter;//CHANGE TO MATCH ICONTYPE
	shownanoframe=1;
	nanocolor=0 0.7 1.0;// SEE WIKI

	//Weapons and related 
	ExplodeAs=NOWEAPON;//SEE "NOWEAPON" IN KDR_11k's WEAPON CATEGORY DOCUMENTATION IN MODS THREAD 
	SelfDestructAs=NOWEAPON; 
	SelfDestructCountdown=1;

	Weapon1=MYFIGHTER_GUN;
	weaponmaindir1=0 0 1;//FORWARD ARC
	maxangledif1=90;//90 DEGREE ARC FORWARD
	OnlyTargetCategory1=EVERYTHING;

///////////////////////////////////////////////////////////FLIGHT CODE
	collisionSphereScale=1.0;
	Upright=0;
	floater=0;
	canSubmerge=0;
	mass=100;
	CanMove=1;
	CanFly=1;
	loopbackAttack=1;
	HoverAttack=0;

	BrakeRate=0.6;
	Acceleration=4;
	MaxVelocity=17;
	turnRate=450;
	CruiseAlt=500;
	wantedHeight=500;
	maxHeightDif=400;

[SFXTypes]
	{
	explosiongenerator0=custom:GUNFLARE_FLASH;
	explosiongenerator1=custom:EXPLOSION_FX;

}
Now, you just need to have stuff all named appropriately, and to make some simple FX scripts for the gunflare and the explosion, and you're good to go.

Daan also asked about how I did the "rocket exhaust" flares, in P.U.R.E..

Tell ya what, Daan: get one of your fighters working, using this script and FBI, make a gunflare flash and an explosion, and I'll post the code for doing that, and explain how it works.

It's not complicated or anything, there are at least a dozen people here who know how to do this simple stuff. I just want you to put the work into making this work before I hand you more stuff- you have to walk before you can run, ok? Doing a simple script with a few FX is just a starting-place, for a project like yours- you're not really going to be doing a lot of fancy BOS animations, I'd think, given your content, so you need to sit down and learn how to work with Custom Explosion Generator code, to make it look really pretty- and just copy-pasting from other people's projects, while it'll help get you started, won't really help you get to where you want, and I don't have the time to help you a lot, if you won't help yourself ;)

So, get this stuff working, including some CEGs (that'll be the hardest part, probably)... then I'll show you how to do the rocket FX.

[EDIT]Tidied a few things that weren't done completely efficiently (removed two IFs, replace by ELSE, found a minor typo), added a lot more explanation.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Battlestar Galactica

Post by AF »

Has nobody heard of pastebins?!?! At least you didnt post as is in tiny tiny text, that would have been even worse...
daan 79

Re: Battlestar Galactica

Post by daan 79 »

Post Reply

Return to “Game Development”