Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
DooMBoy

ZDooMHeXen Scripted Marines

Recommended Posts

Right now I'm doing a remake of Map01 for ZDoom, and I want there to be big honkin' fight scene at the start, with lots of scripted marines fighting the demons along with me. Does anyone know how to program the scripted marine to do this sort of thing?

Share this post


Link to post

I don't think scripted marines will attack anything by default, and I don't think Thing_Hate will work because I don't think scripted marines even have a weapon to fire. However, this may have changed since I last heard about it...

Share this post


Link to post

If you can make monsters that hate other monsters, just use Dehacked/BEX to make a "marine" that's really just a monster with the marine sprites.

Share this post


Link to post
Linguica said:

If you can make monsters that hate other monsters, just use Dehacked/BEX to make a "marine" that's really just a monster with the marine sprites.

Or if you don't want the sprites, u can just have a really hideous marine partner.

Share this post


Link to post

Brilliant, Ling. Here I was thinking of how to do it purely in ACS, and you come up with a hybrid solution that'll work even better for the time being.</brown nose>

Oh wait -- one problem: For the player to be part of the battle, the enemy forces will have to be fully able to destroy all the fake-allies, or else they'll turn on the player after they kill what they were supposed to.

I do expect that Randy should be adding more functionality to the scripted marines, though.

DooMBoy: You aren't the first to consider this, by the way.

Ooh... thinking DSM's fanfic now... the battle at the starport... this would be sweet to reproduce in ZDoom...

Share this post


Link to post
DooMBoy said:

Right now I'm doing a remake of Map01 for ZDoom, and I want there to be big honkin' fight scene at the start, with lots of scripted marines fighting the demons along with me. Does anyone know how to program the scripted marine to do this sort of thing?


Scripted marines behave just like monsters, only without weapons. So you could just put a load of 'em in with a load of monsters and watch 'em get slaughtered...

Share this post


Link to post
Ultraviolet said:

Oh wait -- one problem: For the player to be part of the battle, the enemy forces will have to be fully able to destroy all the fake-allies, or else they'll turn on the player after they kill what they were supposed to.


that could work for what I want. check the story I had written for the original hex2.wad.

VileSlay said:

THE STORY SO FAR :

You are currently stationed at UAC's proving grounds, where experimental weapons, chemical, and vehicles are tested before being sold to the military. You don't like this post, but who said you have to.

You have a bad feeling about the big hush-hush project being tested today. It's called the High Energy Tranfer system, or H.E.X. for short. The H.E.X. breaks an object down in to sub-atomic particles, sends them to another location, where they are them reassembled in perfect order. At least thats the goal.

As the hour for the first human test approaches, you recall the rumors that you heard about the success and failures of the animal tests. Some of them just weren't pretty. The only thing you can do is feel sorry for the poor slob that has to step in to that lab.

The test begins. You can hear the hum of the huge generators that power the H.E.X. A funny feeling comes over you, like the one you had when your squad was ambushed three years ago. The lab alarm goeas off and you know it's bad. Grab your shotgun and rush towards the lab complex. Thats when the monsters start to appear.

You and your comrades are taken aback by the green flashes of energy and the monsters that appear in their wake. Some hurl balls of fire, others just gorge themselves on human flesh. You are being overwhelmed. Your freinds fall around you. You lose your shotgun to a fireball.

The lab is near. You don't have much of a choice. You look back at the carnage when you reach the door. You watch in horror as the dead that aren't being eaten rise and start taking shots at you. The corpse
of your best friend shambles toward you. You take him out, then enter the complex.

"I'm the last one," you think as the door closes and locks behind you. All is earily quiet. Maybe you can find a better weapon in here. Maybe there are survivors. maybe, just maybe, you can fire up the H.E.X. and use it to ge out of this hell-hole. You just have to get to it first, and hope it doesn't reduce you to a pile of gibs.

Share this post


Link to post

Here are my 2 cents:

Make it scripted so that when the monsters die, all the marines die. This way they won't turn on you, but you need some kind of plot as to why they all died... :)

Also, you can give the nazi's marine sprites and make them the marines, then have them hate the monsters.

Does any of this make sense?

Share this post


Link to post

When all the monsters are dead you could use ACS to just "freeze" the marines in place so they can't attack you.

Of course, there should be enough monsters to kill all the marines anyway :P

Share this post


Link to post

Place a shootable objects in another room and make the remaining monsters to hate it and they will go out of room or roam aimlessly if they cant.

Share this post


Link to post

But by the time all the monsters are dead, you will have marines that have already killed the targets they were assigned to, so they will STILL have turned on the player by that point.

Sphagne's suggestion might work... but having a marine just walk away after he has made one kill is a bit... odd.

Meh. So:
Marine is set to hate (target). For that target's death-special, set thing_hate again for that marine to go to the next target... You'll have to have several functions running all at once for this. The scripts will probably look pretty messy.

OK, so I've got this sorted out in my own mind, combining all Ling & Sphagne's suggestions and having all this going on simultaneously... it's a good thing ACS follows C and not BASIC. :P

Share this post


Link to post

Wait, with MBF there's a Dehacked bit to make monsters "friendly" to you and hostile to other monsters. Doesn't ZDoom support this?

Share this post


Link to post
Linguica said:

Wait, with MBF there's a Dehacked bit to make monsters "friendly" to you and hostile to other monsters. Doesn't ZDoom support this?

No, I'm pretty sure ZDoom doesn't support "friendly" monsters.

Share this post


Link to post

Well, if it's in MBF, maybe it wouldn't be too hard to implement in ZDoom... maybe...

Or maybe Randy could creat a DEH/BEX flag that makes monsters use bot (co-op) behavior, eh? I remember back in 1.22 when bots actually COULD co-op. Now they only fire when fired upon. See, they SHOULD follow the player, and they SHOULD strafe when necessary, and they SHOULD fire when they see something to fire upon, not just wait until they are fired upon. Meh.

Share this post


Link to post

how many enemies can you assign to a "marine"? the idea of having them walk away might not be bad. I could have them walk into the lab complex and use a monster only telport to get rid of them as they cross the threshold.

Share this post


Link to post

if you place a shootable object in a room and give it a tid and use Thing_Hate to make monsters of a specific tid to hate it they will go for it and ignore other targets, I have made many scripted scenes this way and it works great, especially if you put the target behind the walls to force monster(s) to walk to the wall and use playes pushes flag to let them activate a switch or run another script as they pass a linedef...

Share this post


Link to post

this is getting a little confusing. so, how does it work? as an example, lets say I turn the ss guard into marines. can I make him "hate" more than one thing, or only one monster type? BTW, where can I find the thing ids?

Share this post


Link to post

You can force the monsters of tid1 to hate shootable objects (monsters) of tid2 tag them and use them. ;-)

Share this post


Link to post

sorry to be a pain in the ass, sphagne, but do you think you could make a quick example wad of that? or could you post a sample script for an ss guard vs. a cacodemon? I'm not very familiar with scripts yet and don't really know what it should look like.

you can email me at RyZakDVL@aol.com

Share this post


Link to post

You have to wait a few days till my demo level completes, just a few days. It will be full of new zdoom features! ;-)

Share this post


Link to post

I tried to put together a script using with xwe, but when I compiled it there was an error.

error #48: identifier has not been declared
identifier: thinghate

I tried using thing_hate, and even thin-hate, but I still got the same error.

Share this post


Link to post

Make sure you are using the latest acc, and then add the following to your zspecial.acs file

177:Thing_Hate(2),

Share this post


Link to post
Enjay said:

Make sure you are using the latest acc, and then add the following to your zspecial.acs file

177:Thing_Hate(2),


I'm not sure what the latest version is, but I got v.1.13. does it matter where I put it in the file?

as far as the structure of the script goes, should it be open or void? should each enemy have their own script or should they all be lumped in to one?

Share this post


Link to post

For the script:

Open if you want them to start that way, void if you want them to hate something after a specific event.

Share this post


Link to post
VileSlay said:

I'm not sure what the latest version is, but I got v.1.13. does it matter where I put it in the file?

as far as the structure of the script goes, should it be open or void? should each enemy have their own script or should they all be lumped in to one?


I think the latest version is something like 1.25 but I'm using an older version, and most of the time I use DeePsea's internal compiler which worked fine when adding the above.

As far as where to put it goes, it should be obvious once you open the file. There are a whole bunch of specials defined in numeric order. Just stick it in where 177 would fit in the sequence. That's simply to make it easier to find again. I don't think the actual order matters.

As far as using it goes, I've used it in both an open and a void script. I have used it to make a lot of enemies (all with the same tid) "hate" one enemy or for one on one fights. One thing that I did was I wanted to set up a cutscene that looked like the invasion of a building, so I made a whole bunch of enemies hate a dormant enemy inside the building. The attacking enemies could see the dormant one, but the player camera couldn't so it looked like the enemies were going into the building all guns blazing.

Share this post


Link to post

okay here is how I'm testing it. I have an ss soldier, an imp, and a caco. I want the ss to hate both the imp and the caco, and for them to hate him. the ss is thing 1, caco thing 2, and imp thing 3. do I put thing_hate(1,2) or thing_hate(84,3005) for the ss/caco fight? keep in mind that I'm pretty new to scripting and don't know all the lingo. tid=? :(

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×