View unanswered posts | View active topics It is currently Wed Jan 08, 2025 5:55 am



Reply to topic  [ 48 posts ]  Go to page Previous  1, 2, 3, 4  Next
 Interesting and Useful Coding stuff - Tell us yours! 
Author Message
User avatar

Joined: Tue Jul 03, 2007 12:33 am
Posts: 1275
Location: Elsewhere.
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
This thread is an awesome idea!

I have nothing to contribute, I haven't even tried modding on B22.
:(


Wed Dec 10, 2008 12:17 am
Profile
User avatar

Joined: Fri Oct 17, 2008 9:46 pm
Posts: 5212
Location: The Grills Locker.
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
I've discovered a little bug that allows any gun to use two different mags. This can be useful when making an superweapon that, after a few shots, "depletes" its energy reserves and becomes a normal weapon. Or whatever.
First, you code an .ini file with your weapon, with your mag, rounds, everything. (Weapon.ini, or anything)
Then, make a new .ini file, with your new mag and rounds. (let's call it NewMag.ini)
Now comes the trick: you have to give the mag in NewMag.ini the exact same name of the mag in Weapon.ini. (the reason for that is explained later)
Then, when writing the Index.ini, make sure that NewMag.ini is loaded AFTER Weapon.ini. That way, when the game loads the weapon ( when you buy it or place it with the bunker editor) it will use its original mag, but, when you reload the weapon, the mag in NewMag.ini takes place, and you can shoot something totally different! Useful, huh? :grin:


Wed Dec 10, 2008 12:51 am
Profile WWW
User avatar

Joined: Tue Jul 03, 2007 12:33 am
Posts: 1275
Location: Elsewhere.
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
Areku wrote:
I've discovered a little bug that allows any gun to use two different mags. This can be useful when making an superweapon that, after a few shots, "depletes" its energy reserves and becomes a normal weapon. Or whatever.
First, you code an .ini file with your weapon, with your mag, rounds, everything. (Weapon.ini, or anything)
Then, make a new .ini file, with your new mag and rounds. (let's call it NewMag.ini)
Now comes the trick: you have to give the mag in NewMag.ini the exact same name of the mag in Weapon.ini. (the reason for that is explained later)
Then, when writing the Index.ini, make sure that NewMag.ini is loaded AFTER Weapon.ini. That way, when the game loads the weapon ( when you buy it or place it with the bunker editor) it will use its original mag, but, when you reload the weapon, the mag in NewMag.ini takes place, and you can shoot something totally different! Useful, huh? :grin:

That's actually really really ♥♥♥♥ cool.
Well done!
Cookie4u


Wed Dec 10, 2008 5:27 am
Profile
User avatar

Joined: Mon Aug 04, 2008 9:37 pm
Posts: 12
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
By giving a self-propelling AEmitter an AirResistance value of 2 you can make it exist along a plane with a length proportional to the force of its thrust. By also removing its gravity (with GlobalAccScalar = 0) and giving it explosive particles for gibs you can essentially create a barrier that explodes when something passes through it.
I discovered this accidentally when messing around with a large rocket.
Image

In this case the AEmitter is seen at one extreme, emitting, just before appearing back at its other extreme where the other emission can be seen. Anything that passes between these two points causes the rocket to gib, massively. The speeds reached between these two points is amazing, causing light, un-sharp, and short-lived particles to dig deeply into terrain.


Thu Dec 11, 2008 9:41 pm
Profile
User avatar

Joined: Sun May 18, 2008 8:30 am
Posts: 732
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
Can you upload an example of that?


Thu Dec 11, 2008 10:48 pm
Profile
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
CandleJack wrote:
Can you upload an example of that?

Ditto.


Fri Dec 12, 2008 1:44 am
Profile WWW
User avatar

Joined: Sat Jun 16, 2007 2:31 am
Posts: 2982
Location: Texas
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
This needs to be stickied.


Fri Dec 12, 2008 2:44 am
Profile
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
I have no doubts that it will be.


Fri Dec 12, 2008 2:56 am
Profile WWW
User avatar

Joined: Sun May 18, 2008 8:30 am
Posts: 732
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
You can attach emitters to muzzle flashes.


Fri Dec 12, 2008 2:57 am
Profile
User avatar

Joined: Mon Aug 04, 2008 9:37 pm
Posts: 12
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
I'll try and whip up a better example after I finish with finals, but here's the rocket with which I first noticed it. It has a bit of spin from the added emissions, but other than that I believe it'd be fully possible to get it to behave more stably.


Fri Dec 12, 2008 3:32 am
Profile
User avatar

Joined: Sun May 18, 2008 8:30 am
Posts: 732
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
I flew in between them and this is what happened.
Image

Edit: If this is made into a stable weapon(well more stable then now), it should be called the phase acceleration field(PAF Gun).


Fri Dec 12, 2008 4:17 am
Profile
User avatar

Joined: Fri Mar 02, 2007 6:59 am
Posts: 1726
Location: NSW, Australia
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
Please get back ontopic guys, this thread's managed to stay on track so far.


Fri Dec 12, 2008 7:05 am
Profile
User avatar

Joined: Mon Jun 30, 2008 9:13 pm
Posts: 499
Location: Finland
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
You can make stuff gib itself. Just define the thing that gibs itself twice, second time it can be added to it's gibs. Should work with stuff emitting itself too. Or you can make a thing that emits a thing that emits the first thing and achieve an infinite circle of things. Pretty clear, is it not?


Fri Dec 12, 2008 1:00 pm
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
have you any idea how much lag that creates?
what piipu is trying to explain is the idea behind the phoenix bot. heres an example using the base.rte frag grenade:
Code:
AddDevice = TDExplosive
   CopyOf = Frag Grenade
   PresetName = Frag Loop
   Buyable = 0
AddDevice = TDExplosive
   CopyOf = Frag Grenade
   PresetName = Frag PlaceHolder
   Buyable = 0
AddDevice = TDExplosive
   CopyOf = Frag PlaceHolder
   PresetName = Frag Loop
   AddGib = Gib
      GibParticle = TDExplosive
         CopyOf = Frag Loop
   GibImpulseLimit = 1
   Buyable = 1

the original is just a copy to define a different name, as is the next, the second one makes a copy of the copied copy and defines it with the name of the first copy, except this time it gibs the first copy aswell (and this doesnt ♥♥♥♥ up as it has been defined previously.) we have to redefine names so changes are made to the copies, and to prevent the crash caused by naming a copyof the same presetname. (eg copyof = face presetname = face in the same definition causes a crash.)
anyway, thats an explanation, try putting that code in any .ini around, it should load you a grenade called "frag loop" that makes a mess of everything, and lag quite a bit. try editing the example to include a coalition heavy.
if anything above is wrong, or the code doesnt load, thats because its 1145 here.


Fri Dec 12, 2008 1:44 pm
Profile WWW
Banned

Joined: Tue Aug 26, 2008 6:09 pm
Posts: 432
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
The Wiki would be a vastly superior platform for this thread. Consider moving your code snippets to the wiki and perhaps posting links in this thread?


Fri Dec 12, 2008 2:02 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 48 posts ]  Go to page Previous  1, 2, 3, 4  Next

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.169s | 13 Queries | GZIP : Off ]