Scripting, matcen > action

For Descent, Descent II and Descent3 level editing and modification assistance.
Post Reply
LEON
DBB Ace
DBB Ace
Posts: 237
Joined: Mon Feb 09, 2004 3:01 am
Location: Oslo, Norway

Scripting, matcen > action

Post by LEON » Sat Sep 13, 2008 3:06 am

Sup folks

Im new to scripting. Have just made a few that works. Get a key to open a door, end level on either room enter or bot killed, and stuff.
What I can't figure though, is how to....like...when all bots from an matcen is spawned and killed---> open a door. Or, all matcen bots killed ---> end level.

Anyone?
Thanks

Leon
User avatar
Kyouryuu
DBB Alumni
DBB Alumni
Posts: 5775
Joined: Fri Apr 30, 1999 2:01 am
Location: Isla Nublar
Contact:

Post by Kyouryuu » Sun Sep 14, 2008 12:38 am

It's been a really long time since I touched DALLAS.

I'm not sure if what you are asking is possible. In order to track the death of a given robot or robots, you have to give them individual names if I remember correctly. The problem with the Matcen is that it is spawning robots on-the-fly and therefore you can't name them.
LEON
DBB Ace
DBB Ace
Posts: 237
Joined: Mon Feb 09, 2004 3:01 am
Location: Oslo, Norway

Post by LEON » Mon Sep 15, 2008 7:32 am

Ah, ok, thats some bad news.
Hmmm, I wanted to make a SP lvl where the main fokus was to fight bots. like, you enter a room, the door locks behind you, a matcen start to spawn bots, and when you have killed them all you get access to what ever you was looking for in that room, and the door opens again.
Maybe theres some other way around this, I dunno, if its possible to script the matcen (not the bots) so when its finish, then you get what ever effect you want.
User avatar
Kyouryuu
DBB Alumni
DBB Alumni
Posts: 5775
Joined: Fri Apr 30, 1999 2:01 am
Location: Isla Nublar
Contact:

Post by Kyouryuu » Mon Sep 15, 2008 11:30 am

Maybe don't rely on a Matcen to do it?

Maybe look at how Proving Grounds set this up in Descent 3. I think in those situations, the boss robot was just there already, waiting for your arrival. Another potential option is that you can hide robots until you are ready to use them, IIRC.
LEON
DBB Ace
DBB Ace
Posts: 237
Joined: Mon Feb 09, 2004 3:01 am
Location: Oslo, Norway

Post by LEON » Wed Sep 17, 2008 12:12 am

Matcens is kind a useless if you cant script them. They are just there.....but not part of the story!?

Yes, the bot can be there from the start, but I was thinking of a lot more than just one or even 2-3. More like 20, but fighting 20 bots at the same time is just over the top.
I can hide them you say? Does that mean I must script every single bots? Sound like an option, must be a lot of scripting, though.

If I can't figure a way to do this, I'll come up with another gameplay or story. Is just that I wanted a kind of \"anarchy\" feel on the mission. You advance from one area to the next one by killing all the bots. What I like about SP levels is the fighting. I don't mind pusles much, and the replay value is low as well.

Ok, I'll try somting
Thanks for your help Kyouryuu

Leon
User avatar
Foil
DBB Material Defender
DBB Material Defender
Posts: 4900
Joined: Tue Nov 23, 2004 3:31 pm
Location: Denver, Colorado, USA

Post by Foil » Wed Sep 17, 2008 8:23 am

I'm not sure it can be done through DALLAS (I'd have to go back and look), but it's certainly possible. After all, there's the scripting in the SP level where you have to kill all but a few of the troops.
User avatar
Duper
DBB Master
DBB Master
Posts: 9205
Joined: Thu Nov 22, 2001 3:01 am
Location: Beaverton, Oregon USA

Post by Duper » Wed Sep 17, 2008 12:49 pm

I think the problem would be in what you 're trying to do Leon, is that in order complete your script, you would have to ID each bot spawned so the script would know when to go to opening the door.

I'm not sure that the D3 engine allows for that kinda process. You can script metcens and there is also a tool within the editor that allows you to assign certain properties outside of scripting. (triggers and such) But assigning an ID or name to each bot as it is spawned? I'm not certain that, that is possible.
LEON
DBB Ace
DBB Ace
Posts: 237
Joined: Mon Feb 09, 2004 3:01 am
Location: Oslo, Norway

Post by LEON » Wed Sep 17, 2008 2:11 pm

Hey.

I'm really new to this, so my sugestions might sound stupid.
When I make a matcen I set maximum bots to produce, so d3 at least know how many bots the matcen will generate. Then it should be possible to script ' when matcen1 has produced 20 objects, open door1'
This script wouldn't be optimal though, cus you get and complete message before you have killed the last bot, kind a odd.
I haven't find out how to script matcen at all, so I dunno about this.

Edit, Or maybe its possible to set a timer on the matcen. Matcen will be active for.....lets say 5 min. and door opens after 5 min, as well.
User avatar
The Lion
DBB Ace
DBB Ace
Posts: 197
Joined: Mon Apr 17, 2006 2:13 pm
Location: The Netherlands

Post by The Lion » Wed Sep 17, 2008 2:33 pm

There's an event generated when a matcen spawns a bot, which can give you
its object handle.

Finding out when such newly generated bots are destroyed is another matter.
I'm pretty sure it can be done, but maybe not using just DALLAS since it only
lets you tie events to pre-existing objects.

You'd have to trap all \"Object destroyed\" events and compare the handles to
a list of spawned bots which you are maintaining.
User avatar
Kyouryuu
DBB Alumni
DBB Alumni
Posts: 5775
Joined: Fri Apr 30, 1999 2:01 am
Location: Isla Nublar
Contact:

Post by Kyouryuu » Wed Sep 17, 2008 6:38 pm

I don't have DALLAS installed, but maybe an if-then can do this? If you use an if-then, you may be able to capture the robot as the owner in the \"if\" clause, and then check against it in the \"then\" clause?
User avatar
Foil
DBB Material Defender
DBB Material Defender
Posts: 4900
Joined: Tue Nov 23, 2004 3:31 pm
Location: Denver, Colorado, USA

Re:

Post by Foil » Thu Sep 18, 2008 2:06 pm

The Lion wrote:I'm pretty sure it can be done, but maybe not using just DALLAS since it only
lets you tie events to pre-existing objects.
Agreed, it wouldn't be too hard to do using the D3 SDK C++ code.

But I think Leon is strictly using the DALLAS script editor... correct?
LEON
DBB Ace
DBB Ace
Posts: 237
Joined: Mon Feb 09, 2004 3:01 am
Location: Oslo, Norway

Re:

Post by LEON » Thu Sep 18, 2008 2:17 pm

Foil wrote:
The Lion wrote:I'm pretty sure it can be done, but maybe not using just DALLAS since it only
lets you tie events to pre-existing objects.
Agreed, it wouldn't be too hard to do using the D3 SDK C++ code.

But I think Leon is strictly using the DALLAS script editor... correct?
Correct!
User avatar
WillyP
DBB Ace
DBB Ace
Posts: 461
Joined: Sat Feb 11, 2006 9:57 pm
Location: NH
Contact:

Post by WillyP » Sun Oct 26, 2008 8:15 am

I think this can be done with DALLAS: There is an event 'Matcen Spawned' where the matcen id is specified and the spawned object becomes 'IT'.

Two ways I see it could done, either count the number of spawns and trigger when the last bot spawns... would open the door with one bot alive...

or: Make the last spawn of the matcen be a non robot object, like a power up, then the script could check for a non-robot spawn. (IT is (object type robot) = false) Then the player would be left with a power up and an unlocked door.

oops... sorry for the bump... and I see LEON has already released his level. :oops:
LEON
DBB Ace
DBB Ace
Posts: 237
Joined: Mon Feb 09, 2004 3:01 am
Location: Oslo, Norway

Post by LEON » Sun Oct 26, 2008 9:53 am

Thanks WillyP, I'll take a look at it.

As for my level, I droped the story and made a fight only level :)

Leon
LEON
DBB Ace
DBB Ace
Posts: 237
Joined: Mon Feb 09, 2004 3:01 am
Location: Oslo, Norway

Post by LEON » Sun Oct 26, 2008 3:20 pm

Ok, did some testing.

when matcen [matcen ID] has spawned an [IT]
IT is an powerup
Then open door 1

I made a matcen that spawned 4 robots first then last spew was an shield powerup.

And the door open up :)

Only thing i couldnt figure was to ID the matcen, since thers no matcen identification, as far as i know.
So if i have several matcen in a level, it would be
an problem, no?

Edit: Checked some more, matcen are named 'matcen1' 'matcen2' and so forth. I might use those ID's.
But i didn't find a way to set matcen ID in dallas.
Post Reply