General Category > Starward Rogue Mods & Modding

Adventures in modding

<< < (2/7) > >>

Cinth:
So basically have the system base one pattern and the other out of patterns?  I could use the same patternvars for this?

ptarth:
Guide to Weapon Modding

* Find source material
* In this case, we want the Raincannon.
* A quick search of file contents for raincannon tells us it is either in CMP_PlayerHulls.xml, Dayton_BUlletPatterns.xml, Dayton_PlayerAmmoSystems.xml, MainTutorial.xml, Dayton_ItemPickups.xml, or a_testChris.xml
* CMP_PlayerHulls.xml is the main definition of player mechs, so that is where it is attached to the white mech. That's not it.
* a_testChris.xml is a test chamber, its where Chris has setup the white mech for testing. That's not it.
* MainTutorial.xml is the Tutorial which uses the Rain Cannon. That's not it.
* Which leaves us with Dayton's files. Spoiler: That's where we want to go.
* Dayton_ItemPickups.xml is the weapon system when it is on the ground.
* Dayton_PlayerAmmoSystems.xml is the System specifications.
* Dayton_BulletPatterns.xml is the code for the bullet pattern. This is what we want.
* Setup the new pattern
* Open up Dayton_Bulletpatterns.xml in your text editor (Notepad++ is a common choice).
* Create your new Bulletpattern file, copy the Raincannon to it, and save it to StarwardRogue/Configuration/BulletPattern/. The same place the other Bullet patterns are.
* Do a find in your text editor looking for "Raincannon". We find it as the first entry in the file (in v1.0).
* Here is the code and what each line does:
--- Code: ---  <bullet_pattern name="RainCannonPattern"> -- defines the pattern and names it
    <bullet speed="1200" angle="0" shot_type="HexishellEmblazonedYellow"> --defines a new bullet with a speed (how fast it goes), angle (what direction it goes), and shot_type (color, hitbox).
       <wait time="0.35" /> --wait for 350 miliseconds
        <spawn> -- create a new bullet patttern
          <bullet_pattern> --specify the new bullet_pattern to use
            $CircleRung_Terrain A=0 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0 SCALE=0.66 --use a predefined bullet pattern CircleRung_Terrain with the variables listed. I'll talk about this below.
            $CircleRung_Terrain A=15 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.001 SCALE=0.66
            $CircleRung_Terrain A=30 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.002 SCALE=0.66
            $CircleRung_Terrain A=45 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.003 SCALE=0.66
            $CircleRung_Terrain A=60 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.004 SCALE=0.66
            $CircleRung_Terrain A=75 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.005 SCALE=0.66
            $CircleRung_Terrain A=90 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.006 SCALE=0.66
            $CircleRung_Terrain A=105 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.007 SCALE=0.66
            $CircleRung_Terrain A=120 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.008 SCALE=0.66
            $CircleRung_Terrain A=135 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.009 SCALE=0.66
            $CircleRung_Terrain A=150 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.01 SCALE=0.66
            $CircleRung_Terrain A=165 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.011 SCALE=0.66
            $CircleRung_Terrain A=180 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.012 SCALE=0.66
            $CircleRung_Terrain A=195 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.013 SCALE=0.66
            $CircleRung_Terrain A=210 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.014 SCALE=0.66
            $CircleRung_Terrain A=225 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.015 SCALE=0.66
            $CircleRung_Terrain A=240 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.016 SCALE=0.66
            $CircleRung_Terrain A=255 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.017 SCALE=0.66
            $CircleRung_Terrain A=270 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.018 SCALE=0.66
            $CircleRung_Terrain A=285 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.019 SCALE=0.66
            $CircleRung_Terrain A=300 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.02 SCALE=0.66
            $CircleRung_Terrain A=315 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.021 SCALE=0.66
            $CircleRung_Terrain A=330 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.022 SCALE=0.66
            $CircleRung_Terrain A=345 SHOT_TYPE=SpikeYellow SPEED=800 TIME=1 DELAY=0.023 SCALE=0.66
          </bullet_pattern> --close the bullet pattern
         </spawn> --close the spawn
        <die sounds_to_pick_from_when_action_starts="AnyWeapons/HeavyElectricEnergy1,AnyWeapons/HeavyElectricEnergy2"/> --add a sound effect to killing things
    </bullet> -- close the bullet
  </bullet_pattern> -- close the bullet pattern

--- End code ---

* $CircleRung_Terrain is a Bullet Pattern Variable found in the /Configuration/BulletPatternVariables directory. They are use to reduce the amount of duplication and are essentially objects that can be reused.
* Do a search for "CircleRung_Terrain" and find it is in Dayton_BulletPatternVars.xml.
* Create your own BulletPatternVars.xml file and copy and paste the CircleRung_Terrain code there.
* Don't forget the <root> & </root> entries at the top and bottom of your xml files.
* The xml interpreter is somewhat variable when it comes to giving helpful analysis of what went wrong. Most of the time, change one little bit, save, test it in game. If it works, great, if not, undo what you did, test to make sure it still works,  and figure out what you did wrong.
* Here is the CircleRung_Terrain code and what it does.
--- Code: ---    <var name="CircleRung_Terrain">  --create a bullet variable definition
    <bullet angle="0" speed="0" shot_type="Invisible" damage_mult="0" never_collides_with_terrain="false"> --start with a bullet definition, shot_type in
      <wait time="[DELAY]"/>
      <die />
      <spawn>
        <bullet_pattern>
          <bullet angle="[A]" speed="[SPEED]" shot_type="[SHOT_TYPE]" damage_mult="0.5" never_collides_with_terrain="false">
            <wait time="[TIME]"/>
            <die />
          </bullet>
        </bullet_pattern>
      </spawn>
    </bullet>
  </var>

--- End code ---

WIP saving, hold wait.


Wait, what? I need to figure out what's going on here, because this is just weird. Just a minute.
Okay. I figured out how the code works. But I'm not sure why. If someone else wants to finish this off go for it. Otherwise I'll just skip to the answer below.

Misery:
There's a variety of ways to do it, really.   It just depends on what works best for you.

The way I'm thinking of wouldnt use the bullet_pattern or bullet_vars files at all.  Just the enemy and system files.  But, the lack of actual bullet code could make it a little confusing to figure out the method of making it work.  It took awhile for me to grasp the ideas there.   The boss Vestige really is the best example of this.  At least I think it's Vestige.  If I recall correctly, that boss doesnt use the patterns/vars files whatsoever.

Or, you can do it in the manner that Ptarth is showing, which is more of a traditional way, and which may be less confusing. 

Really, the whole system is VERY open-ended.  There's so many ways to approach it.

Cinth:
Laugh at this... Everything I have done so far has been done in notepad :D

ptarth:  I've gotten that much and actually have a functional rain canon on the mech (as a regular weapon not an ammo).  I kinda get what's going on with the normal setup there, it's how to get a pattern form a pattern  :-\

Cinth:
Fusillade has given me an idea to try.  Off to the grindstone...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version