Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Amaster

Railgun projectile

Recommended Posts

Can I spawn the railgun projectile in ZDoom using projectile_spawn? What is it's number?

Share this post


Link to post

I don't think the railgun actually spawns a projectile, but is a hitscan weapon.

Share this post


Link to post

The closest thing to a railgun projectile is the mage's Sapphire Wand in Hexen or the powered up Dragon Claw in Heretic. Maybe you could use one of these.

Share this post


Link to post

the railgun codepointer for monsters is MonsterRail so you can make any thing fire it, but there's no way to fire it with projectile_spawn since it's not really a projectile. Not sure if it'd work, but you could attach that codeptr to a single frame of a thing (the brains or one of the pillars) and deactivate it, then activate said thing when you want the railgun to go off, but like I said, I have no clue if that would work at all heh.

Share this post


Link to post
Cyb said:

the railgun codepointer for monsters is MonsterRail so you can make any thing fire it, but there's no way to fire it with projectile_spawn since it's not really a projectile. Not sure if it'd work, but you could attach that codeptr to a single frame of a thing (the brains or one of the pillars) and deactivate it, then activate said thing when you want the railgun to go off, but like I said, I have no clue if that would work at all heh.

Just for testing purposes, I gave that code pointer to a barrel. It stood silently at first. I shot it and it unleashed a barrage of railgun shots at me. Definetely interesting. I didnt know the barrel would actually target me. This could have some really interesting applications.
Anyway, looks like I can get this to work, with some tweaking. Thanks for the help.

Oh and just for laughs, try giving the same code pointer to the imps attack frame. When the imp tosses a fireball, the fireball itself will begin firing railgun shots at the imp. Funniest thing I've ever seen.

Share this post


Link to post

That'd be great if you could make it so that when a creature dies, it damages you with projectiles.

Share this post


Link to post
Cyb said:

the railgun codepointer for monsters is MonsterRail so you can make any thing fire it, but there's no way to fire it with projectile_spawn since it's not really a projectile. Not sure if it'd work, but you could attach that codeptr to a single frame of a thing (the brains or one of the pillars) and deactivate it, then activate said thing when you want the railgun to go off, but like I said, I have no clue if that would work at all heh.


Sounds useful, maybe I can add yet another new monster to my mod.
Just out of interest, are there any similar code pointers for the other weapons (eg. MonsterPlasma, MonsterBFG) so I can make monsters fire BFG's at me?

Job said:

That'd be great if you could make it so that when a creature dies, it damages you with projectiles.


You can do this with scripting - set up a script that fires projectiles in various directions using the monster's tid as the mapspot tid, and make it run when you kill the monster.

Share this post


Link to post
Ultimate DooMer said:

Sounds useful, maybe I can add yet another new monster to my mod.
Just out of interest, are there any similar code pointers for the other weapons (eg. MonsterPlasma, MonsterBFG) so I can make monsters fire BFG's at me?



Unfortunately not. All monster attack code pointers are hard coded to their specific projectile. If you don't need a monster with a lot of hit points you can try using a Scripted Marine with the attack you need and change its sprite with the ACS-command SetMarineSprite. Unfortunately scripted Marines don't count toward the statistics.

Share this post


Link to post

I believe if you for instance change the imp fireball sprites to the bfg sprites it will then act like a bfg (in fact I'm nearly 100% certain, this was how a the early doombots, per-source release were made) but then you lose the imp fireballs, so one way or another you'll have to sacrifice a fireball. You could also do what Graf said, which would have been my first suggestion had he not said it first

Share this post


Link to post
Graf Zahl said:

Unfortunately not. All monster attack code pointers are hard coded to their specific projectile. If you don't need a monster with a lot of hit points you can try using a Scripted Marine with the attack you need and change its sprite with the ACS-command SetMarineSprite. Unfortunately scripted Marines don't count toward the statistics.


So the SetMarineSprite can make a scripted marine look like any monster in the game?

(It doesn't bother me about them not counting towards the kill count, as I'm gonna use a load of them anyway)

Share this post


Link to post
Ultimate DooMer said:

So the SetMarineSprite can make a scripted marine look like any monster in the game?

(It doesn't bother me about them not counting towards the kill count, as I'm gonna use a load of them anyway)



Theoretically yes, but the frames have to match the player's . That is, the attack sequence has to use frames E and F, the pain sequence frame G and so on.

Share this post


Link to post
Ultimate DooMer said:

(It doesn't bother me about them not counting towards the kill count, as I'm gonna use a load of them anyway)


You could always setup an extra line in a script to kill a monster in a dummy sector when a marine is killed. That way you could "simulate" the death of the marine counting toward your killcount.

Share this post


Link to post
Nanami said:

You could always setup an extra line in a script to kill a monster in a dummy sector when a marine is killed. That way you could "simulate" the death of the marine counting toward your killcount.


You might have a point there - they've all got scripts attached to them anyway (so they drop their weapons when killed) and I'll probably be careful with their use (as they're experimental enemies), so there might not be too many in each map. Good point, thanks.

Share this post


Link to post

I am teh clevar.

Sometimes.

EDIT: Oh, plus, if they all drop the same weapon (shotgun or so) you could make them all activate one script, but kill different monsters. Let's see:

Give each one an arg (1, 2, 3, 4, 5, let's say) but they all activate script 255. Now script 255 is:

script 255 (int who)
so that the arg is stored as the variable "who." Then you have:
switch (who)
{
 case 1:
 ...
}
You get the idea. That way you can prevent having one script per marine. Have case 1 kill the monster you have it pointed at.

ANOTHER EDIT: And even if they don't drop the same weapon:
script 255 (int weap, int who)
That way you can have switch statements to tell what weapon to drop and one to tell what monster to kill.

Maybe that helps shorten the code some. You could use 1 script to control all the marines in your whole level, if used correctly.

YET ANOTHER EDIT: Actually, KillThing(who) or whatever it is, maybe Thing_Damage(who,0) would work better than that switch statement.

THAT'S A LOT OF EDITS: Gah, I've edited this like twelve times.

Share this post


Link to post
Ichor said:

The closest thing to a railgun projectile is the mage's Sapphire Wand in Hexen or the powered up Dragon Claw in Heretic. Maybe you could use one of these.



All hail Ichor the god of every thing HeXeN and Heretic.

Share this post


Link to post
Nanami said:

scripting stuff with 12 edits


There is an easier way, and that is to use the special args:

script 1 (int arg0)

{
Thing_SpawnNoFog (arg0, T_SHOTGUN, 0);
}
Then, for each monster, give them a tid and this special:

ACS_Execute (1, 0, tid, 0, 0);

which means that arg0 will be the tid of the monster.

(I think that's right as I've only just found out about special arg use, and I've not tested it so someone correct me if I'm wrong)

Share this post


Link to post
Cyb said:

I believe if you for instance change the imp fireball sprites to the bfg sprites it will then act like a bfg (in fact I'm nearly 100% certain, this was how a the early doombots, per-source release were made) but then you lose the imp fireballs, so one way or another you'll have to sacrifice a fireball. You could also do what Graf said, which would have been my first suggestion had he not said it first

I don't think that's true. The codepointer that spawns the 'spray' is set in the third frame of the BFG main explosion.

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
×