Scripting bosses

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
Agentarrow
Posts: 1346
Joined: Thu Jun 28, 2007 4:34 pm
Location: Kyiv, Ukraine
Contact:

Scripting bosses

Post by Agentarrow »

Some of my bosses are stumping me. I can't script correctly in the first place so I think that is part of the problem.
(bosses taken from Terra Trooper in the Game Designs section)Zeth Black

Zeth isn’t as powerful as some of the enemies that you’ve faced, but he does have a special way you need to fight him. You can only hit him when he is on the ground, he can warp and even float in the air. If you see him freeze up, don’t bother firing, he’s already somewhere else and that’s only a leftover image. When he warps and stands on the ground, he’s about to unleash dark attack, where he sprouts two more arms and has a different gun in every hand. He fires them all at once. (The weapons are: handgun, shrapnel gun, shot gun and disk launcher, which is the most deadly since it fires explosive grenade-like disks. Just keep nailing him when he’s about to use dark attack and you’ll succeed against Zeth.

General Gorilla
The name doesn’t lie. This guy is huge. He can jump and clobber, however, his weapons are limited. He’s armored except for one spot on his head and one spot on his belly. These are the only two spots where you can shoot to hurt him. When he thrusts his arm into the air and roars, seek cover. You’ll get killed pretty quickly if you get nailed with that attack. Just return fire when possible, hitting him in the weak spots. Then, when you’ve got him down to half health, he’ll start shooting mini rockets. His armor will also begin to glow in some spots. Hit him in the glowing spots with your most powerful weapon until it busts. Once all his armor is gone, nail him twice to bring down gorilla
AgentArrow Home
The greater good is but a point of view...
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

set a var called attackable or sumthing like
if(attackable = true)
{
//Attack stuff
}

for warping u might need script points

for the arms you could use
SetWeapon(); command

for the general you could use bonelevel or pawns as his weak point
Herp derp.
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Post by Juutis »

How new are you to scripting, exactly? If you have no clue of how scripts are constructed, I'd suggest you to read the scripting section in the manual, as well as the section in the e-book (Making 3D Games with Reality Factory by Dan Valeo). If you don't have the e-book yet, download it here:
http://www.realityfactory.info/cms/inde ... umentation


I'm in kind of a rush right now, so I'll write more tomorrow or some other day when I have time.
Pain is only psychological.
User avatar
Agentarrow
Posts: 1346
Joined: Thu Jun 28, 2007 4:34 pm
Location: Kyiv, Ukraine
Contact:

Let's see...

Post by Agentarrow »

Scripting with VB: Veterain
Scripting with RF: Newbie
Isn't Dan's manual $12.95? I'm kinda hurting for cash, trying to buy a better computer and all.
AgentArrow Home
The greater good is but a point of view...
User avatar
Agentarrow
Posts: 1346
Joined: Thu Jun 28, 2007 4:34 pm
Location: Kyiv, Ukraine
Contact:

Post by Agentarrow »

Hmmm... maybe not,
I'm glad I didn't download it at the site I was at yesterday. They charge $12.95 for the manual.
AgentArrow Home
The greater good is but a point of view...
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Post by Juutis »

Agentarrow wrote:Hmmm... maybe not,
I'm glad I didn't download it at the site I was at yesterday. They charge $12.95 for the manual.
Whoa! The RF manual??!? :shock:
What site was it?

The manual should be included in your RF installation, and you can download the e-book for free here:
http://www.realityfactory.info/cms/inde ... umentation
Pain is only psychological.
User avatar
Agentarrow
Posts: 1346
Joined: Thu Jun 28, 2007 4:34 pm
Location: Kyiv, Ukraine
Contact:

Bookshock.com

Post by Agentarrow »

Not kidding! Dan Valeo's manual! $12.95! See!

Making 3D Games with Reality Factory
Making 3D Games with Reality Factory
By Dan Valeo
208 pages, illustrated.
ISBN - 0-9687185-4-X
$12.95 USD
2003 Bookshock Publications
AgentArrow Home
The greater good is but a point of view...
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

Post by darksmaster923 »

dan valeo made his book free exclusively for the rf community
Herp derp.
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: Scripting bosses

Post by Juutis »

Agentarrow wrote:Zeth isn’t as powerful as some of the enemies that you’ve faced, but he does have a special way you need to fight him. You can only hit him when he is on the ground, he can warp and even float in the air. If you see him freeze up, don’t bother firing, he’s already somewhere else and that’s only a leftover image. When he warps and stands on the ground, he’s about to unleash dark attack, where he sprouts two more arms and has a different gun in every hand. He fires them all at once. (The weapons are: handgun, shrapnel gun, shot gun and disk launcher, which is the most deadly since it fires explosive grenade-like disks. Just keep nailing him when he’s about to use dark attack and you’ll succeed against Zeth.
I'd give each of Zeth's actions an order of their own. Like floating in the air would be one order and standing on the ground would be one etc... That way it's easy to switch between different actions by simply going to another order. Also, then it's easy to make Zeth take damage only when he's on the ground, which I think is the trickiest part of the script.

You'll have to give him two attributes: The actual health that decreases only when he's on the ground and another health attribute that decreases always when he is hit. Let's call the first health and the other fakehealth. The idea is to make the player's weapons damage the fakehealth attribute, then the script can check if it has decreased and damage the health attribute depending on whether Zeth is on the ground or not. And when health goes to 0, Zeth dies. So, let's have a look at how this can be written with the scripting language.

First you'll need to add the two attributes. You should add something similar to this in the first order of your script:

Code: Select all

AddAttribute("health",0,500);
AddAttribute("fakehealth",0,1000);

SetAttribute("health",500);
SetAttribute("fakehealth",1000);
This gives him an attribute called health, with the lowest possible value of 0 and the highest of 500 (meaning his full hitpoints are 500) and sets the attribute to its maximum (500). The other attribute, fakehealth, ranges from 0 to 1000 because it must not reach 0. You can use fakehealth to read how much damage has been done to Zeth and then deal the same damage to health and if fakehealth reaches 0, some of the damage is lost.

Note: I'm making up all the values here, so feel free to use your own values.

Then it's time to write the part where you check if damage has been done:

Code: Select all

if(GetAttribute("fakehealth") < 1000)
{
     ModifyAttribute("health",1000 - GetAttribute("fakehealth");
     SetAttribute("fakehealth",1000);
}
This piece of script checks if fakehealth has decreased (= it is less than 1000) and then increases health by amount 1000 - fakehealth (which is actually negative, because fakehealth < 1000. So in fact health decreases). Then fakehealth is set back to 1000 to prevent any extra damage from being done to health.

So that part would go to an order where Zeth is on the ground and can be damaged. If Zeth is floating, you'll have to put the same piece of script but withouth the line 'ModifyAttribute("health",1000 - GetAttribute("fakehealth");' to prevent health from being damaged.


You can make him die by simply checking if health has reached 0.

Code: Select all

if(GetAttribute(health) = 0)
{
     //add commands you want to execute when he dies.
}
You'll probably want to go to a new order that has the all the stuff that's done when he dies, like playing the death animation and maybe set some triggers to play a cutscene or something.


I'll write more later. I hope I wasn't too confusing. And as usual, feel free to ask anything. :)
Sorry for being so slow.
Pain is only psychological.
User avatar
Agentarrow
Posts: 1346
Joined: Thu Jun 28, 2007 4:34 pm
Location: Kyiv, Ukraine
Contact:

nice, not confusing

Post by Agentarrow »

that's not confusing, but it is a great tutorial, ish thing. you seem to be pretty good at scripting, and Once I'm done with terra trooper, I hope to be able to know enough to help newer guys like you helped me.
AgentArrow Home
The greater good is but a point of view...
User avatar
Agentarrow
Posts: 1346
Joined: Thu Jun 28, 2007 4:34 pm
Location: Kyiv, Ukraine
Contact:

however...

Post by Agentarrow »

I'm gonna have to keep this one in my memories to come back here since RF got moved to my new computer and I can't log in yet on that computer.
AgentArrow Home
The greater good is but a point of view...
Post Reply