Melee Lasers?

Post » Tue May 17, 2011 1:22 am

Well I was messing around with the GECK today and couldn't think of anything interesting to do when suddenly an idea came to me. Wouldn't it be great if you could swing a sword and fire an archimedes orbital laser from it!

Far be it from me to decline such a project I immediately began tinkering with the idea, but I've yet to find a reasonable method to accomplish my desired result.

My question to you all is, obviously, can such a thing in fact be done with the GECK? I'm not entirely sure but it seems like it would be as simple as finding a way to attach the laser projectile to the sword so that it uses the attack animation as a trigger to fire.

Any thoughts?
User avatar
Jimmie Allen
 
Posts: 3358
Joined: Sun Oct 14, 2007 6:39 am

Post » Tue May 17, 2011 5:49 am

OnFire blocks might work in melee weapon scripts? If not, you can detect attack animations using the following code. I've got it working in Fallout 3 http://www.youtube.com/watch?v=c2885r6Vya8
ref contshort activeshort animbegin onequipset cont to getcontainerset active to 1endbegin onunequipset active to 0endbegin ondropset cont to 0endbegin gamemodeif(cont)	if(active)		if(cont.GetAnimAction == 2 && anim == 0)			set anim to 1		elseif(cont.getanimaction != 2 && anim == 1)			;WEAPON FIRED			set anim to 0			cont.fireweapon WHATEVER		endif	endifelse	set cont to getcontainer	if(cont)		if(cont.getequipped THISWEAPON)			set active to 1		endif	endifendifend

User avatar
john palmer
 
Posts: 3410
Joined: Fri Jun 22, 2007 8:07 pm

Post » Tue May 17, 2011 11:00 am

Well I was messing around with the GECK today and couldn't think of anything interesting to do when suddenly an idea came to me. Wouldn't it be great if you could swing a sword and fire an archimedes orbital laser from it!

Far be it from me to decline such a project I immediately began tinkering with the idea, but I've yet to find a reasonable method to accomplish my desired result.

My question to you all is, obviously, can such a thing in fact be done with the GECK? I'm not entirely sure but it seems like it would be as simple as finding a way to attach the laser projectile to the sword so that it uses the attack animation as a trigger to fire.

Any thoughts?


possible -> yes

Scripting Scripting GetAnimAction Scripting blah blah -> FireWeapon.

Very easy god weapon.
User avatar
Lisa Robb
 
Posts: 3542
Joined: Mon Nov 27, 2006 9:13 pm

Post » Tue May 17, 2011 3:55 am

Ah, I see. That bat is just the sort of thing I'm looking to make, a melee weapon that becomes a ranged weapon when you put up a guard. That's certainly a confirmation that it can be done, thanks for that.

Forgive my ignorance though, but I'm absolutely horrible with GECK scripting. Using that script you just supplied, am I correct in assuming that afterward I'd just need to change the projectile field of the weapon to whatever I fancied and set up an ammo feed so it would have a source to fire from?
User avatar
james kite
 
Posts: 3460
Joined: Sun Jul 22, 2007 8:52 am

Post » Tue May 17, 2011 1:13 pm

Nope. You'd need to put a weapon with whatever projectile you wanted in the "Cont.FireWeapon WHATEVER" bit. It would, however, consume the ammo the main weapon had specified but wouldn't actually require ammo to fire unless you put it into the script. Calling FireWeapon on an actor who already has a weapon equipped behaves oddly.
User avatar
Robert DeLarosa
 
Posts: 3415
Joined: Tue Sep 04, 2007 3:43 pm

Post » Tue May 17, 2011 9:11 am

Aha. Well, in that case what weapon did you use for that field Toaster? If I recall, the only weapon that could fire baseballs in F3 was the Rock-It Launcher. Or did you just make another custom weapon that used baseballs and use that?
User avatar
[ becca ]
 
Posts: 3514
Joined: Wed Jun 21, 2006 12:59 pm

Post » Tue May 17, 2011 3:50 am

The latter, although there is an existing baseball-firing weapon (the pitching machine trap) and rock-it launchers don't behave in such a way that firing them through script is very useful (as they fire things from the ammo you loaded into them, which you can't set through script).
User avatar
мistrєss
 
Posts: 3168
Joined: Thu Dec 14, 2006 3:13 am

Post » Tue May 17, 2011 12:47 am

Ah, I thought as much. Well, I think I understand the script more or less then, but for some reason it's not letting me save it after I replace the fields you pointed out with the proper weapon ID's. Any idea why?

Again, pardon my ignorance. Despite being accustomed to the GECK interface I haven't actually required custom scripting for any of my projects before so I'm a bit uneducated in this field.
User avatar
Christina Trayler
 
Posts: 3434
Joined: Tue Nov 07, 2006 3:27 am

Post » Tue May 17, 2011 12:02 pm

Use http://www.newvegasnexus.com/downloads/file.php?id=36290 so you get error messages telling you what the problems are, they're inexplicably turned off by default.
User avatar
Pete Schmitzer
 
Posts: 3387
Joined: Fri Sep 14, 2007 8:20 am

Post » Tue May 17, 2011 7:53 am

Much thanks. After a few simple fixes I've gotten the script stable. If you'll permit me a rather simplistic question though, after a custom script is saved how can it be accessed for use with the object? I can't seem to find it on the dropdown menu even though it is listed when I go into the script window and click open then scroll through the available scripts.

Like I said, I've never actually worked with custom scripts in GECK before so as awkward as it is I just really do not know how to use a saved script.
User avatar
Caroline flitcroft
 
Posts: 3412
Joined: Sat Nov 25, 2006 7:05 am

Post » Tue May 17, 2011 12:19 am

the script you saved must be an object script (choosabel at the upper right in the script window) or else you cant select it in the items script dropdown list
User avatar
P PoLlo
 
Posts: 3408
Joined: Wed Oct 31, 2007 10:05 am

Post » Tue May 17, 2011 9:38 am

Ah, it was just an oversight on my part. I got the script to work now, thanks for all the help folks. Oh, and good job with that sword mod Jay. I just installed it earlier tonight and it works wonderfully.

One last thing, does anyone know what the projectile for the Archimedes II is? The Archimedes I just fires a strange 2d beam that doesn't hit anything unless it impacts the ground. Certainly a far cry from the gigantic laser of doom.
User avatar
Justin Hankins
 
Posts: 3348
Joined: Fri Oct 26, 2007 12:36 pm

Post » Tue May 17, 2011 2:30 pm

There is no projectile. The placement of the Archimedes explosion is determined by a godload of scripting, and the laser beam is part of the explosion.

You'll want to clone an already existing melee weapon like the Machete for instance, and then give it a projectile. I'd clone a Rocket projectile, make it Hitscan and increase its speed and range to about 30000. Then set its explosion to be a EuclidExplosion.

Note that you can't make the laser fire out of the sword or anything like that, only come down from the sky.
User avatar
Laura Shipley
 
Posts: 3564
Joined: Thu Oct 26, 2006 4:47 am

Post » Tue May 17, 2011 1:53 am

well that laser is a static mesh actually so you could make it part of that explosion too and setangle x to have it rotate sideways firing horizontally id assume, but changing a laser beams colour might be easer to achieve... theres a tutorial on FO3nexus btw explaining how to build an orbital strike weapon, author is me, just search my profile for articles too lazy atm to look it up :P
if you tweak it a lil (meaning simplyify it) you can have the target beam get fired from a weapon like euclid does, and you could have it fire a laser of doom instead of the napalm bombs i use...
User avatar
Fam Mughal
 
Posts: 3468
Joined: Sat May 26, 2007 3:18 am


Return to Fallout: New Vegas