Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 12/09/07 17:12

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Gumby's First Real Script! (Machine Gun Mod)

Well..here it is ^_^

var int amrem;

func void main(void)
{
chr_teleport 0 7010
chr_giveweapon 0 w2_sap
amrem=1200
fork machine
} 

func machine
{
fork ammodisp
chr_wait_animtype 0 Autopistol_Recoil

if (amrem>29) {
if (chr_has_empty_weapon(0)) {
chr_giveweapon 0 w2_sap
amrem=amrem - 30
}
}
sleep 10
fork machine
}






func ammodisp
{
dmsg " "
dmsg " "
dmsg " "
if(amrem eq    0    ) dmsg "    0    "
if(amrem eq    30    ) dmsg "    30    "
if(amrem eq    60    ) dmsg "    60    "
if(amrem eq    90    ) dmsg "    90    "
if(amrem eq    120    ) dmsg "    120    "
if(amrem eq    150    ) dmsg "    150    "
if(amrem eq    180    ) dmsg "    180    "
if(amrem eq    210    ) dmsg "    210    "
if(amrem eq    240    ) dmsg "    240    "
if(amrem eq    270    ) dmsg "    270    "
if(amrem eq    300    ) dmsg "    300    "
if(amrem eq    330    ) dmsg "    330    "
if(amrem eq    360    ) dmsg "    360    "
if(amrem eq    390    ) dmsg "    390    "
if(amrem eq    420    ) dmsg "    420    "
if(amrem eq    450    ) dmsg "    450    "
if(amrem eq    480    ) dmsg "    480    "
if(amrem eq    510    ) dmsg "    510    "
if(amrem eq    540    ) dmsg "    540    "
if(amrem eq    570    ) dmsg "    570    "
if(amrem eq    600    ) dmsg "    600    "
if(amrem eq    630    ) dmsg "    630    "
if(amrem eq    660    ) dmsg "    660    "
if(amrem eq    690    ) dmsg "    690    "
if(amrem eq    720    ) dmsg "    720    "
if(amrem eq    750    ) dmsg "    750    "
if(amrem eq    780    ) dmsg "    780    "
if(amrem eq    810    ) dmsg "    810    "
if(amrem eq    840    ) dmsg "    840    "
if(amrem eq    870    ) dmsg "    870    "
if(amrem eq    900    ) dmsg "    900    "
if(amrem eq    930    ) dmsg "    930    "
if(amrem eq    960    ) dmsg "    960    "
if(amrem eq    990    ) dmsg "    990    "
if(amrem eq    1020    ) dmsg "    1020    "
if(amrem eq    1050    ) dmsg "    1050    "
if(amrem eq    1080    ) dmsg "    1080    "
if(amrem eq    1110    ) dmsg "    1110    "
if(amrem eq    1140    ) dmsg "    1140    "
if(amrem eq    1170    ) dmsg "    1170    "
if(amrem eq    1200    ) dmsg "    1200    "
if(amrem eq    1230    ) dmsg "    1230    "
if(amrem eq    1260    ) dmsg "    1260    "
if(amrem eq    1290    ) dmsg "    1290    "
if(amrem eq    1320    ) dmsg "    1320    "
if(amrem eq    1350    ) dmsg "    1350    "
if(amrem eq    1380    ) dmsg "    1380    "
if(amrem eq    1410    ) dmsg "    1410    "
if(amrem eq    1440    ) dmsg "    1440    "
if(amrem eq    1470    ) dmsg "    1470    "
if(amrem eq    1500    ) dmsg "    1500    "
if(amrem eq    1530    ) dmsg "    1530    "
if(amrem eq    1560    ) dmsg "    1560    "
if(amrem eq    1590    ) dmsg "    1590    "
if(amrem eq    1620    ) dmsg "    1620    "
if(amrem eq    1650    ) dmsg "    1650    "
if(amrem eq    1680    ) dmsg "    1680    "
if(amrem eq    1710    ) dmsg "    1710    "
if(amrem eq    1740    ) dmsg "    1740    "
if(amrem eq    1770    ) dmsg "    1770    "
if(amrem eq    1800    ) dmsg "    1800    "
if(amrem eq    1830    ) dmsg "    1830    "
if(amrem eq    1860    ) dmsg "    1860    "
if(amrem eq    1890    ) dmsg "    1890    "
if(amrem eq    1920    ) dmsg "    1920    "
if(amrem eq    1950    ) dmsg "    1950    "
if(amrem eq    1980    ) dmsg "    1980    "
if(amrem eq    2010    ) dmsg "    2010    "
if(amrem eq    2040    ) dmsg "    2040    "
if(amrem eq    2070    ) dmsg "    2070    "
if(amrem eq    2100    ) dmsg "    2100    "
if(amrem eq    2130    ) dmsg "    2130    "
if(amrem eq    2160    ) dmsg "    2160    "
if(amrem eq    2190    ) dmsg "    2190    "
if(amrem eq    2220    ) dmsg "    2220    "
if(amrem eq    2250    ) dmsg "    2250    "
if(amrem eq    2280    ) dmsg "    2280    "
if(amrem eq    2310    ) dmsg "    2310    "
if(amrem eq    2340    ) dmsg "    2340    "
if(amrem eq    2370    ) dmsg "    2370    "
if(amrem eq    2400    ) dmsg "    2400    "
if(amrem eq    2430    ) dmsg "    2430    "
if(amrem eq    2460    ) dmsg "    2460    "
if(amrem eq    2490    ) dmsg "    2490    "
if(amrem eq    2520    ) dmsg "    2520    "
if(amrem eq    2550    ) dmsg "    2550    "
if(amrem eq    2580    ) dmsg "    2580    "
if(amrem eq    2610    ) dmsg "    2610    "
if(amrem eq    2640    ) dmsg "    2640    "
if(amrem eq    2670    ) dmsg "    2670    "
if(amrem eq    2700    ) dmsg "    2700    "
if(amrem eq    2730    ) dmsg "    2730    "
if(amrem eq    2760    ) dmsg "    2760    "
if(amrem eq    2790    ) dmsg "    2790    "
if(amrem eq    2820    ) dmsg "    2820    "
if(amrem eq    2850    ) dmsg "    2850    "
if(amrem eq    2880    ) dmsg "    2880    "
if(amrem eq    2910    ) dmsg "    2910    "
if(amrem eq    2940    ) dmsg "    2940    "
if(amrem eq    2970    ) dmsg "    2970    "
if(amrem eq    3000    ) dmsg "    3000    "

}

Ehh, replace the scripts in your warehouse folder with that for a sec and try it out ^_^

---------------------------------------------------------------------------

Release Notes:

Machine Gun Mod v .8 for Oni

---

Instructions:

Replace the stuff in your Warehouse folder with this script

---

What does it do?!:

Basically, whenever you fire with a Pistol, it is like SuperAmmo is turned on, but you still have a limited amount of ammo

...Meaning you can fire as long as you have ammo without reloading!

---

Glitches:

After the gun resets itself you lose sound...might be fixable (geyser help!)

The pistols have different clip sizes, so...it will be like wasting ammo with the TCTF pistol...and I believe that when you "reload" it will switch you to the black adder

---

Things that would help gumby make this better:

A way to differenciate the two pistols

A way to detect firing, other than the recoil anim, as the recoil anim occurs more often then the shots fired...If this were possible, I could have it take from the ammo supply once per shot, instead of groups of 30

A sound fix...

The name of the modded gun that I don't remember the name of (it was in the video fo the rampaging mutant Shinatama) and a way to impliment this with it.

A way to detect amount of ammo held AND\OR when ammo is picked up\recieved
-This way I can have it just take away ammo clips instead of using an actual counter...if it is wanted...

---

The future:

More guns!

When you pick something up, you gain ammo!

A shinatama that follows you around with a gun with this mod applied (with 3000 ammo)!

A global version! (should be pretty easy)

Applying this to AI (not very likely...looks near impossible)

---------------------------------------

And gumby's superammo script! (v.99)

func machine
{
chr_wait_animtype 0 Autopistol_Recoil
if (chr_has_empty_weapon(0)) {
chr_giveweapon 0 w2_sap
}
sleep 10
fork machine
}

Last edited by Gumby (12/09/07 17:12)


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#2 12/09/07 18:12

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: Gumby's First Real Script! (Machine Gun Mod)

My second script...It shows the real potential of my superammo script (I prefer to stick this in my global folder and in dev mode "fork itstime"...is "fork" neccessary? probably not....)
Its very fun...try to guess what it does big_smile

func itstime
{
chr_giveweapon 0 w8_mbo

fork machine
} 

func machine
{
chr_wait_animtype 0 Mercury_Bow_Recoil

chr_giveweapon 0 w8_mbo

sleep 2
fork machine
}

I noticed in OTA, that shots start to "disappear" ie not get drawn...setting the sleep number to higher should fix this...but 2 is the lowest, at 1 it goes slower ;D

---

Also, on the wiki, it said something about each unit of sleep is 1/60 of a second...thats not enitierly true...I'm pretty sure each one is equal to a frame...correct me if im wrong

Last edited by Gumby (12/09/07 18:12)


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#3 12/09/07 18:12

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: Gumby's First Real Script! (Machine Gun Mod)

@ your first post:
You "fork ammodisp" while there is no "func ammodisp" anywhere.
I haven't tried it, but it's guaranteed to crash Oni, so please fix smile
As for your requests, there's a little bit too much to fix, I'm afraid.
I'd rather add a new, fully featured machine gun to the Edition wink
EDIT: Oh, it didn't crash for some reason. Just stopped parsing...
After I removed the offending line it ran OK. As for said glitches...
I definitely won't attempt to fix, e.g., the sound issue with scripts.
All the other issues are also irrelevant for the "proper" chaingun.
Actually, another guy had a hand at scripting this before you did.
I didn't get involved either, and that was before the chaingun wink

@ your second one:
I used to promote the use of a global "func pre" for OniMenu etc.
It's best not to fork it: http://wiki.oni2.net/IGMD/global#func_pre

@ frames:
What Oni calls frames or ticks are 60 Hz frames as far as I know.
It could be specific to my laptop, but it's been reported by others.
All of Oni's animations, for example, are sampled at 60 Hz, so...

Last edited by geyser (12/09/07 19:12)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#4 12/09/07 19:12

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: Gumby's First Real Script! (Machine Gun Mod)

Ahh, its in Code tags...scroll down!

@func pre

I read about that...maybe later I will do that ^_^ For now I don't care if its turned on in the beginning big_smile

@60

Its an average of 60 fps. One second it may be 58, the other 62, etc. If it fps lags, that 1\60 a second will no longer be true...


At least try the second code out...its much fun...and is more than just Superammo


---


I don't feel like editing in a func pre right now, soon though I will...unless you were nice and had it so your 7th anniversarry thing did it tongue

Last edited by Gumby (12/09/07 19:12)


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#5 12/09/07 19:12

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: Gumby's First Real Script! (Machine Gun Mod)

"Ahh, its in Code tags...scroll down!" Oh. Tired. Sorry. Works. Good scripting, dude. As good as it gets.
My advice, though: find another thing to emulate than machinegunfire. That's the "real" chaingun's job.
My respects again smile

"If it fps lags, that 1\60 a second will no longer be true..." On the average, it keeps ticking OK wink
You shouldn't confuse drawn frames and game ticks, which keep lining up to 60 Hz rather nicely.
I mean, if there's GFX lag and Oni doesn't have the time to draw a few frames, they'll be skipped.
So "sleep 60" will last very close to one second, as long as you don't get, say, 15 fps lag or worse.

"At least try the second code out...its much fun" Yeah. Sorta. roughjustice to the power seven, eh?
That kind of death ray is also something I'd definitely implement as a new gun, in binary. Sorry smile

"unless you were nice and had it so your 7th anniversarry thing did it" So the Edition did what, again?

EDIT: Sorry about the edits. Going to bed now. Re:tired.

Last edited by geyser (12/09/07 19:12)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#6 12/09/07 19:12

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: Gumby's First Real Script! (Machine Gun Mod)

ignore the 7th anniverary thing...

The second code might be better with the superball gun...it seems reckless though ^_^

I was just testing things out with the machinegun thing...I needed something to try...

---

I had a thought...eventually I might make a mod for Oni that is sort of points based...

With these points, you can buy ammo, guns, hypos, anything ^_^

Just for fun, you see, to see if I can do it tongue

I've already got the ammo system down...mostly big_smile

------

Superball spam isn't effective...neither is the scram cannon (too laggy, but like a swarm of gnats)

---

VDG=Funny, as it actually kills them (does anybody know why?)

NEVER use the Screaming Cannon with this...

Last edited by Gumby (12/09/07 20:12)


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#7 12/13/07 05:12

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: Gumby's First Real Script! (Machine Gun Mod)

"VDG=Funny, as it actually kills them (does anybody know why?)" One hit from the Van de Graaff pistol takes away 1 HP.


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#8 12/13/07 10:12

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: Gumby's First Real Script! (Machine Gun Mod)

Sounds painful ^_^


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#9 04/18/08 18:04

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: Gumby's First Real Script! (Machine Gun Mod)

Just uploading a .bsl version of this so lazy people can stick it in.

You will need to add "fork itstime" into the main function of whichever level you put this in.


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#10 04/21/08 08:04

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: Gumby's First Real Script! (Machine Gun Mod)

Cool, thanks, Gumby.


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

Board footer

Powered by FluxBB