View unanswered posts | View active topics It is currently Wed Jan 08, 2025 10:28 pm



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

Joined: Fri Mar 02, 2007 6:59 am
Posts: 1726
Location: NSW, Australia
Reply with quote
Post Interesting and Useful Coding stuff - Tell us yours!
Hi all.

Occasionally, fairly experienced modders will start a thread either asking for other people's knowledge of coding stuff or reporting their own.

I figured it wouldn't be a bad idea to make a thread consisting of weird, wonderful or just plain useful coding tricks.
Please post the build it is in though, weird coding tricks can often change as the game develops.

To start:

1. B22 - InheritsVel = 1 or 0
fairly self-explanatory really, great when making explosives that aren't TDEs. the weird fact is it goes in the gib code rather than the object code. For example:

Code:
AddEffect = MOPixel
   InstanceName = Example
             InheritsVel = 1 or 0
   Mass = 0.0001
   LifeTime = 80


DOES NOT WORK!!
Instead, use
Code:
   AddGib = Gib
      GibParticle = MOSParticle
         CopyOf = Example
      Offset = Vector
         X = -2
         Y = -3
      Count = 50
      Spread = 10
      InheritsVel = 0   <---
      MinVelocity = 20
      MaxVelocity = 15


2. B22 - Attachables and armour piercing.
Bullets have the weird habit in this build of passing through some objects with no effect on either. This can mean attachable armour does squat. To get around this, make your armour heavier: It works much better, although really really heavy bullets will still do it occasionally.

3. B21* and any builds before it that allow attachables - Emitters on Devices
This is fairly well known, but it's worth putting down: If you put an emitter on a gun, and then put it in your backpack, the emitter slowly builds up: so when you take it out again, it will lag massively, sometimes crashing the game, and let loose all the particles it had saved up. Untill this is fixed, probably best not to put emitters on Devices.

Have fun, and PLEASE try to stay on topic!

*thanks for the update Azzuki!


Last edited by Exalion on Tue Dec 09, 2008 6:52 am, edited 1 time in total.



Mon Dec 08, 2008 5:22 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!
This will be a useful thread.
Very useful.


Mon Dec 08, 2008 5:28 am
Profile WWW
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!
some tidbits:
making a TDExplosive or simmilar not bounce off craft [useful for cannons that use these, and used in the darklone D7]
make the material used in the explosive itself bounce = -1
Code:
AtomGroup = AtomGroup
   AutoGenerate = 1
   Material = Material
      CopyOf = Metal
      PresetName = Bomb Metal
      Bounce = -1
   Depth = 0

more coming, cbf typing more code now..


Mon Dec 08, 2008 5:41 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!
Hmmmm....


Do not make a TDExplosive (or any object for that matter) explode into 2 of itself.

For spread:
Code:
Spread = 10

The maximum value it needs is 3.14 (pi). The spread is calculated like a circle, so the max is 3.14
If it is higher, it won't do anything different.


More to come. I need to look at some of my odd codes.


Mon Dec 08, 2008 5:51 am
Profile
User avatar

Joined: Fri Apr 27, 2007 4:55 pm
Posts: 1178
Location: America!
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
whitty wrote:
Hmmmm....


Do not make a TDExplosive (or any object for that matter) explode into 2 of itself.

For spread:
Code:
Spread = 10

The maximum value it needs is 3.14 (pi). The spread is calculated like a circle, so the max is 3.14
If it is higher, it won't do anything different.


More to come. I need to look at some of my odd codes.


Technically, if you used 4.71, it should (I have not tested this) spread twice as much in the up direction, and still also spread in the down direction.

If it works how I think it works.


Mon Dec 08, 2008 6:53 am
Profile
User avatar

Joined: Sat Nov 03, 2007 9:44 pm
Posts: 1916
Location: Flint Hills
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
Exalion wrote:
3. B22 and any builds before it that allow attachables - Emitters on Devices
This is fairly well known, but it's worth putting down: If you put an emitter on a gun, and then put it in your backpack, the emitter slowly builds up: so when you take it out again, it will lag massively, sometimes crashing the game, and let loose all the particles it had saved up. Untill this is fixed, probably best not to put emitters on Devices.
Actually I was just messing with tim's supergun and this has been fixed with B22.

-- ACrabs suffer no recoil from their turret's mounted weapon.

I'll be honest and tell you all that I've discovered several things that I'm keeping to myself for the time being and already have in Shadow Echelon. While I'm all for sharing information, I'd like to be the first to use some of my discoveries.


Last edited by Azukki on Mon Dec 08, 2008 11:47 pm, edited 1 time in total.



Mon Dec 08, 2008 11:40 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!
Azukki wrote:
-- ACrabs suffer no recoil from their turret's mounted weapon.

Really?

Engine launcher Crab, here I come.

My tip is that in Offsets, think of a grid, then reverse the y axis. - goes up, + goes down.

That is how it seems to work.
Most people probably already knew that.


Mon Dec 08, 2008 11:46 pm
Profile WWW
User avatar

Joined: Sat Nov 03, 2007 9:44 pm
Posts: 1916
Location: Flint Hills
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
crazyMLC wrote:
Azukki wrote:
-- ACrabs suffer no recoil from their turret's mounted weapon.

Really?


True story. I modified the dreadnought to fire bullets with the mass of a thousand suns at maximum velocity, and it didn't even flinch, as it instagibbed crafts and raped terrain.


Mon Dec 08, 2008 11:50 pm
Profile
User avatar

Joined: Wed Feb 14, 2007 5:37 am
Posts: 350
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
StartSegCount =

A snippet of code for walkpaths, it determines how many of the first AddSegments to skip when it doesn't need it. That way actors don't look like stomping morons but are still able to more or less climb steep hills/terrain. It not very useful unless you're devising custom walkpaths though.


Tue Dec 09, 2008 12:19 am
Profile WWW
User avatar

Joined: Mon Feb 11, 2008 3:42 pm
Posts: 259
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
Code:
CopyOf = Somename
    NewVar = Somenumber


This will copy the particle or whatever with variables different from the original (for example using vanilla grenade particles but changing the sharpness/mass)

You can also do

Code:
CopyOf = Somename
    InstanceName = NewName
<New Variables>


And then you can call this new instance later with a CopyOf:

Code:
CopyOf = NewName


However,
Code:
CopyOf = Somename
    PresetName

Does not work as far as I know, it causes wierd errors. Use InstanceName.

Also, when using the copy -> new variables method it is only able to replace variables that are naturally only used once in the original definition (ex. you can replace Sharpness' value and use AddGib to add new gibs, but you cannot take away gibs)


Tue Dec 09, 2008 2:53 am
Profile

Joined: Sat Jan 13, 2007 11:04 pm
Posts: 2932
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
Rocket's opening animation can be used to have deforming objects like doors for instance. Or large objects that shrink into small or opposite.

Shells do not produce recoil on guns. And if you set the shell velocity to negative, you can use it as an offensive particle or anything you like. It has a drawback that it aims slightly downwards.

Coalition.rte/Devices/Rifles/Sniper.ini (or what it was called again, dont remember) has a very cool piece of code. The coalition sniper fires a "launcher" aemitter that fires the actual round. You can bypass recoil, add as many particles and different particles as you wish. Study that code since it can be very useful when making advanced weapons.


Tue Dec 09, 2008 3:46 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
For less recoil, you don't need all those complicated AEmitters or TDE's. Just make the gun's Tracer Round have the same exact FireVelocity and exact Mass but negative, with a really low LifeTime. For example:

Code:
AddAmmo = Round
   PresetName = Round Really Heavy Bullet
   ParticleCount = 1
   Particle = MOPixel
      PresetName = Particle Really Heavy Bullet
      Mass = 1000                                                 // Note the Uber Mass
      RestThreshold = 500
      LifeTime = 1500
      Sharpness = 250
      HitsMOs = 1
      GetsHitByMOs = 0
      Color = Color
         R = 143
         G = 143
         B = 143
      Atom = Atom
         Material = Material
            CopyOf = Bullet Metal
         TrailColor = Color
            R = 155
            G = 155
            B = 155
         TrailLength = 25
   Shell = MOSParticle
      CopyOf = Casing
   FireVelocity = 1000
   ShellVelocity = 10
   Separation = 5

AddAmmo = Round
   PresetName = Tracer Round Really Heavy Bullet
   ParticleCount = 1
   Particle = MOPixel
      PresetName = Tracer Particle Really Heavy Bullet
      Mass = -1000                                                      // Note the Negatively Uber Mass
      RestThreshold = 500
      LifeTime = 1500
      Sharpness = 250
      HitsMOs = 1
      GetsHitByMOs = 0
      Color = Color
         R = 143
         G = 143
         B = 143
      Atom = Atom
         Material = Material
            CopyOf = Bullet Metal
         TrailColor = Color
            R = 155
            G = 155
            B = 155
         TrailLength = 25
   Shell = MOSParticle
      CopyOf = Casing
   FireVelocity = 1000
   ShellVelocity = 10
   Separation = 5

// Part of a Magazine Code
   RegularRound = Round
      CopyOf = Round Really Heavy Bullet
   TracerRound = Round
      CopyOf = Tracer Round Really Heavy Bullet


And that's it, much simpler than some other stuff.


Tue Dec 09, 2008 4:49 am
Profile
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!
...Unless the RTT ratio is not set to shoot the other round after one round is shot.


Tue Dec 09, 2008 4:51 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
whitty wrote:
...Unless the RTT ratio is not set to shoot the other round after one round is shot.


Yeah, don't forget to change that to 2. Or else you get a splatered actor.Unless it's a crab.


Tue Dec 09, 2008 4:54 am
Profile

Joined: Sat Jan 13, 2007 11:04 pm
Posts: 2932
Reply with quote
Post Re: Interesting and Useful Coding stuff - Tell us yours!
^The above method sucks because you DO get recoil. And you will use 2 shots from your gun and it works only on single shot and stream weapons. And you must have a really fast rate of fire to do it.

Use AEmitters instead.


Seperation on round's code can be used to make a shot wider by setting it to high values. You can also use Seperation to make a beam that phases through walls and objects. Use negative values to make it extend forth and positive to extend backwards.


Tue Dec 09, 2008 1:44 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 48 posts ]  Go to page 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.097s | 15 Queries | GZIP : Off ]