Scripting, matcen > action
Scripting, matcen > action
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
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
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.
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.
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.
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.
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
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
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.
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.
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.
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.
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.
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.
- Foil
- DBB Material Defender
- Posts: 4900
- Joined: Tue Nov 23, 2004 3:31 pm
- Location: Denver, Colorado, USA
- Contact:
Re:
Agreed, it wouldn't be too hard to do using the D3 SDK C++ code.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.
But I think Leon is strictly using the DALLAS script editor... correct?
Re:
Correct!Foil wrote:Agreed, it wouldn't be too hard to do using the D3 SDK C++ code.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.
But I think Leon is strictly using the DALLAS script editor... correct?
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.
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.
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.
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.