Author Topic: [LD] Combat Animation  (Read 2329 times)

Offline The Bigfoot

Re: [LD] Combat Animation
« Reply #15 on: June 07, 2016, 04:04:27 pm »
Thats strange, it's in the master LD code on github and when I reinstalled a week or so ago it had it... Its possible the game hasen't patched properly I suppose?
I make spaceships! - http://innomenpro.com/forums/index.php?topic=1366.0
Massive Modding tutorial here: http://innomenpro.com/forums/index.php?topic=1251.0
New Award: John Titor [Sep 17, 2015, 10:16:07 PM]:   BigFoot is the official Evil Genius fro mteh forum

Offline Void

Re: [LD] Combat Animation
« Reply #16 on: June 08, 2016, 07:32:06 am »
Thats strange, it's in the master LD code on github and when I reinstalled a week or so ago it had it... Its possible the game hasen't patched properly I suppose?

I dunno I just downloaded it from the official forums where Samu-kun posted the link.

So, what codes do I need to put in to make this work?

Or better yet, maybe there's something else I need to download? I dunno.

Updated: June 07, 2016, 05:04:11 pm
Oookay... I just realized something.

It seems that the v3.00 I have is incomplete. I think I might have downloaded the wrong thing or something, I dunno.

All this manual patching is really hurting my head. It seems my v3.00 have missing files in it. For one thing I seem to be missing the RETurn.rpy or whatever file it's, along with maybe other files I'm not aware of.

P.S. I don't use steam nor do I have it because steam likes to screw with me.

Updated: June 07, 2016, 05:12:27 pm
Oookay, it seems the update isn't on Denpa yet or something.

The thing I got was an uncensored patch. Damn.

Updated: June 08, 2016, 07:31:40 am
Finally got the full v3.00 with all those files & thingies.

Now, back to the matter at hand, anything I need to do to make the mods work?

Updated: June 08, 2016, 12:25:35 pm
Just tried the codes you gave me, they didn't work.

Seraphim & Bianca still uses the standard railgun sound, & also Bianca's shots still uses the kinetic rounds.
« Last Edit: June 08, 2016, 12:25:35 pm by Void »
The only way to truly hurt a man, is to take everything that he valued and degrade it and remind him of it everyday of his life. But by doing this, you also create a monster, and you will regret ever harming that man, because he will be your greatest horror.

Offline The Bigfoot

Re: [LD] Combat Animation
« Reply #17 on: June 10, 2016, 01:44:44 am »
The working image part is here, have it on other forums as well. Will do sound later

Code: (Setup code: put it in its own rpy file) [Select]
init 6 python:
    for weapon in storeweps:
        weapon.bullet = None # give weapons the .bullet attribute
        weapon.display_count = weapon().shot_count
   
    class BulletSprite(MissileSprite):
        def __init__(self,parent,target,weapon):
            MissileSprite.__init__(self,parent,target,weapon)
            if weapon.bullet != None and self.type != "Laser":
                self.lbl = im.Rotozoom(weapon.bullet[0], self.angle,weapon.bullet[1])
            else:
                if self.type == "Pulse":
                    self.lbl = im.Rotozoom('Battle UI/pulse map.png',self.angle,2.0)
                elif self.type == "Kinetic":
                    self.lbl = im.Rotozoom('Battle UI/kinetic_round map.png',self.angle,1.5)
                elif self.type == "Assault":
                    self.lbl = im.Rotozoom('Battle UI/flakbullet map.png',self.angle,1.5)
                elif self.type == "Melee":
                    self.lbl = im.Rotozoom('Battle UI/melee_map.png',self.angle-135,1.5) 
            self.shot_count = weapon.display_count

Code: (Set weapon attributes) [Select]
init 6 python:
    # weapon.bullet = [image, angle modifier]
    # weapon.display_count = int
    # angle modifier is 2.0 for pulse and 1.5 for others with default images
    # for example

    BiancaAssault.bullet = ["Battle UI/flakbullet map.png", 1.5]
    BiancaAssault.display_count = 10
I make spaceships! - http://innomenpro.com/forums/index.php?topic=1366.0
Massive Modding tutorial here: http://innomenpro.com/forums/index.php?topic=1251.0
New Award: John Titor [Sep 17, 2015, 10:16:07 PM]:   BigFoot is the official Evil Genius fro mteh forum

Offline Void

Re: [LD] Combat Animation
« Reply #18 on: June 10, 2016, 10:52:43 am »
The working image part is here, have it on other forums as well. Will do sound later

Code: (Setup code: put it in its own rpy file) [Select]
init 6 python:
    for weapon in storeweps:
        weapon.bullet = None # give weapons the .bullet attribute
        weapon.display_count = weapon().shot_count
   
    class BulletSprite(MissileSprite):
        def __init__(self,parent,target,weapon):
            MissileSprite.__init__(self,parent,target,weapon)
            if weapon.bullet != None and self.type != "Laser":
                self.lbl = im.Rotozoom(weapon.bullet[0], self.angle,weapon.bullet[1])
            else:
                if self.type == "Pulse":
                    self.lbl = im.Rotozoom('Battle UI/pulse map.png',self.angle,2.0)
                elif self.type == "Kinetic":
                    self.lbl = im.Rotozoom('Battle UI/kinetic_round map.png',self.angle,1.5)
                elif self.type == "Assault":
                    self.lbl = im.Rotozoom('Battle UI/flakbullet map.png',self.angle,1.5)
                elif self.type == "Melee":
                    self.lbl = im.Rotozoom('Battle UI/melee_map.png',self.angle-135,1.5) 
            self.shot_count = weapon.display_count

Code: (Set weapon attributes) [Select]
init 6 python:
    # weapon.bullet = [image, angle modifier]
    # weapon.display_count = int
    # angle modifier is 2.0 for pulse and 1.5 for others with default images
    # for example

    BiancaAssault.bullet = ["Battle UI/flakbullet map.png", 1.5]
    BiancaAssault.display_count = 10

What should I name the new rpy file?

Also, where do I put the 2nd code?
The only way to truly hurt a man, is to take everything that he valued and degrade it and remind him of it everyday of his life. But by doing this, you also create a monster, and you will regret ever harming that man, because he will be your greatest horror.

Offline The Bigfoot

Re: [LD] Combat Animation
« Reply #19 on: June 10, 2016, 12:19:36 pm »
You can name it anything you want, it really dosent matter

The second code can likewise be put anywhere, the init code tells the game in what order to load it, as long as it loads after the 1st bit, it dosent matter

Updated: June 10, 2016, 07:04:47 pm
/Facepalm

I need to learn to read... Just set weapon.fire_sound to what you want to hear
« Last Edit: June 10, 2016, 07:04:47 pm by The Bigfoot »
I make spaceships! - http://innomenpro.com/forums/index.php?topic=1366.0
Massive Modding tutorial here: http://innomenpro.com/forums/index.php?topic=1251.0
New Award: John Titor [Sep 17, 2015, 10:16:07 PM]:   BigFoot is the official Evil Genius fro mteh forum

Offline Void

Re: [LD] Combat Animation
« Reply #20 on: June 11, 2016, 11:49:14 am »
You can name it anything you want, it really dosent matter

The second code can likewise be put anywhere, the init code tells the game in what order to load it, as long as it loads after the 1st bit, it dosent matter

Updated: June 10, 2016, 07:04:47 pm
/Facepalm

I need to learn to read... Just set weapon.fire_sound to what you want to hear

Ah, okay.

So, how to use the weapon.fire_sound? Do I set it like SeraphimKinetic.fire_sound = 'Sola Sniper.ogg'?

Also, any way to set her animation apart from the normal kinetics? I want hers to have a short delay before firing if possible. Thanks.
The only way to truly hurt a man, is to take everything that he valued and degrade it and remind him of it everyday of his life. But by doing this, you also create a monster, and you will regret ever harming that man, because he will be your greatest horror.

Offline The Bigfoot

Re: [LD] Combat Animation
« Reply #21 on: June 11, 2016, 08:31:48 pm »
Ah, okay.

So, how to use the weapon.fire_sound? Do I set it like SeraphimKinetic.fire_sound = 'Sola Sniper.ogg'?

Also, any way to set her animation apart from the normal kinetics? I want hers to have a short delay before firing if possible. Thanks.

fire_sound is the sound of the weapon fireing, not her commenting on it, you need the file path (starting from game) so

SeraphimKinetic.fire_sound = 'sound\beep.ogg'

would change the fireing sound to a beep but her spoken lines would still stay the same
I make spaceships! - http://innomenpro.com/forums/index.php?topic=1366.0
Massive Modding tutorial here: http://innomenpro.com/forums/index.php?topic=1251.0
New Award: John Titor [Sep 17, 2015, 10:16:07 PM]:   BigFoot is the official Evil Genius fro mteh forum

Offline Void

Re: [LD] Combat Animation
« Reply #22 on: June 12, 2016, 03:52:18 am »
Ah, okay.

So, how to use the weapon.fire_sound? Do I set it like SeraphimKinetic.fire_sound = 'Sola Sniper.ogg'?

Also, any way to set her animation apart from the normal kinetics? I want hers to have a short delay before firing if possible. Thanks.

fire_sound is the sound of the weapon fireing, not her commenting on it, you need the file path (starting from game) so

SeraphimKinetic.fire_sound = 'sound\beep.ogg'

would change the fireing sound to a beep but her spoken lines would still stay the same

Okay so... this happened when I put in the codes for the bullet sprite & the sound

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/Attack_Animation_Mod_LD.rpy", line 1, in script
    init 6 python:
  File "game/Attack_Animation_Mod_LD.rpy", line 4, in <module>
    weapon.display_count = weapon().shot_count
  File "game/classes.rpy", line 3893, in __init__
    self.drone = PortableShieldDrone()
  File "game/classes.rpy", line 3871, in __init__
    BM.drones.append(self)
NameError: global name 'BM' is not defined

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "D:\Novel Collection\Novel\Visual Novels\Sunrider\Sunrider Liberation Day v3.00\renpy\bootstrap.py", line 281, in bootstrap
    renpy.main.main()
  File "D:\Novel Collection\Novel\Visual Novels\Sunrider\Sunrider Liberation Day v3.00\renpy\main.py", line 401, in main
    game.context().run(node)
  File "game/Attack_Animation_Mod_LD.rpy", line 1, in script
    init 6 python:
  File "D:\Novel Collection\Novel\Visual Novels\Sunrider\Sunrider Liberation Day v3.00\renpy\ast.py", line 805, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "D:\Novel Collection\Novel\Visual Novels\Sunrider\Sunrider Liberation Day v3.00\renpy\python.py", line 1461, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/Attack_Animation_Mod_LD.rpy", line 4, in <module>
    weapon.display_count = weapon().shot_count
  File "game/classes.rpy", line 3893, in __init__
    self.drone = PortableShieldDrone()
  File "game/classes.rpy", line 3871, in __init__
    BM.drones.append(self)
NameError: global name 'BM' is not defined

Windows-7-6.1.7601-SP1
Ren'Py 6.99.8.959
Release 3.00

The codes are like this:

Code: [Select]
init 6 python:
    for weapon in storeweps:
        weapon.bullet = None # give weapons the .bullet attribute
        weapon.display_count = weapon().shot_count
   
    class BulletSprite(MissileSprite):
        def __init__(self,parent,target,weapon):
            MissileSprite.__init__(self,parent,target,weapon)
            if weapon.bullet != None and self.type != "Laser":
                self.lbl = im.Rotozoom(weapon.bullet[0], self.angle,weapon.bullet[1])
            else:
                if self.type == "Pulse":
                    self.lbl = im.Rotozoom('Battle UI/pulse map.png',self.angle,2.0)
                elif self.type == "Kinetic":
                    self.lbl = im.Rotozoom('Battle UI/kinetic_round map.png',self.angle,1.5)
                elif self.type == "Assault":
                    self.lbl = im.Rotozoom('Battle UI/flakbullet map.png',self.angle,1.5)
                elif self.type == "Melee":
                    self.lbl = im.Rotozoom('Battle UI/melee_map.png',self.angle-135,1.5) 
            self.shot_count = weapon.display_count

init 6 python:
    # weapon.bullet = [image, angle modifier]
    # weapon.display_count = int
    # angle modifier is 2.0 for pulse and 1.5 for others with default images
    # for example

    BiancaAssault.bullet = ["Battle UI/flakbullet map.png", 1.5]
    BiancaAssault.display_count = 20
   
init 6 python:
    for ship in storeships:
        ship.fire_sounds = {}
           
init 6 python:
    SeraphimKinetic.fire_sounds = 'sound/Sola Sniper.ogg'
    SeraphimEnemyKinetic.fire_sounds = 'sound/Sola Sniper.ogg'
    BiancaAssault.fire_sounds = 'sound/shotgun.ogg'
    AllianceBattleshipCannon.fire_sounds = 'sound/cannon.ogg'

Plus I name the file Attack_Animation_Mod_LD
« Last Edit: June 12, 2016, 03:55:10 am by Void »
The only way to truly hurt a man, is to take everything that he valued and degrade it and remind him of it everyday of his life. But by doing this, you also create a monster, and you will regret ever harming that man, because he will be your greatest horror.

Offline The Bigfoot

Re: [LD] Combat Animation
« Reply #23 on: June 12, 2016, 02:15:43 pm »
It was working perfectly for me, Will look into it when I get home in a couple of hours.
I make spaceships! - http://innomenpro.com/forums/index.php?topic=1366.0
Massive Modding tutorial here: http://innomenpro.com/forums/index.php?topic=1251.0
New Award: John Titor [Sep 17, 2015, 10:16:07 PM]:   BigFoot is the official Evil Genius fro mteh forum

Offline The Bigfoot

Re: [LD] Combat Animation
« Reply #24 on: June 13, 2016, 08:50:35 pm »
Right! I tracked it down after reinstalling, apparantly drones inherit from the grav gun, which is included in the filter for weapons in storeweps...

Thats perfectly fine and wont cause problems on its own, except you need to call the weapon as an instance to get the fire count and drones auto-place themselves in BM.drones, which happens before BM is created from Battle.

You can get around it by doing:

Code: [Select]
init 6 python:
    for weapon in storeweps:
        weapon.bullet = None # give weapons the .bullet attribute
        try:
            weapon.display_count = weapon().shot_count
        except:
            pass

You could also create BM by doing BM = Battle() before this, it woulden't matter because it would get overwritten anyway
I make spaceships! - http://innomenpro.com/forums/index.php?topic=1366.0
Massive Modding tutorial here: http://innomenpro.com/forums/index.php?topic=1251.0
New Award: John Titor [Sep 17, 2015, 10:16:07 PM]:   BigFoot is the official Evil Genius fro mteh forum

Offline Void

Re: [LD] Combat Animation
« Reply #25 on: June 14, 2016, 10:38:18 am »
Right! I tracked it down after reinstalling, apparantly drones inherit from the grav gun, which is included in the filter for weapons in storeweps...

Thats perfectly fine and wont cause problems on its own, except you need to call the weapon as an instance to get the fire count and drones auto-place themselves in BM.drones, which happens before BM is created from Battle.

You can get around it by doing:

Code: [Select]
init 6 python:
    for weapon in storeweps:
        weapon.bullet = None # give weapons the .bullet attribute
        try:
            weapon.display_count = weapon().shot_count
        except:
            pass

You could also create BM by doing BM = Battle() before this, it wouldn't matter because it would get overwritten anyway

It works! Finally! XD

But the firing sound is still the original, anyway to get around this?

Codes:

Code: [Select]
init 6 python:
    for ship in storeships:
        ship.fire_sounds = {}
           
init 6 python:
    SeraphimKinetic.fire_sounds = 'sound/Sola Sniper.ogg'
    BiancaAssault.fire_sounds = 'sound/shotgun.ogg'
    AllianceBattleshipCannon.fire_sounds = 'sound/cannon.ogg'

Also, regarding attack animations, Sola still uses the normal one for kinetics, I followed the codes, is this right?

Code: [Select]
##show other types of bullets moving
        if not BM.shooting == False:
            $ bullet = BM.shooting
            if bullet.parent.location is not None and bullet.target.location is not None: #failsafes
                $xposition = dispx(bullet.parent.location[0], bullet.parent.location[1],zoomlevel,0.50 * ADJX) + int(zoomlevel * MOVX)
                $yposition = dispy(bullet.parent.location[0], bullet.parent.location[1],zoomlevel,0.25 * ADJY) + int(zoomlevel * MOVY)
                $next_xposition = dispx(bullet.target.location[0],bullet.target.location[1],zoomlevel,0.50 * ADJX) + int(zoomlevel * MOVX)
                $next_yposition = dispy(bullet.target.location[0],bullet.target.location[1],zoomlevel,0.25 * ADJY) + int(zoomlevel * MOVY)
           
                $adjacent = next_xposition - xposition
                $opposite = next_yposition - yposition
                $angle = math.degrees( math.atan2(adjacent,opposite) )
           
                if bullet.type == 'Laser':
                    add "Battle UI/laserhit map.png":
                        xpos xposition
                        ypos yposition
                        yanchor 0.5
                        xanchor 0.0
                        rotate (360-angle)+90
                        transform_anchor True
                        # at tr_explosion
           
                elif bullet.type == 'Melee':
                    add bullet.lbl:
                        at tr_melee_animation
                        pos (next_xposition,next_yposition)
                        yanchor 0.5
                        xanchor 0.5
                        # rotate (360-angle)-135
                        # transform_anchor True
                        zoom 0.2
               
                elif bullet.type == 'Kinetic':
                    $wait = 0
                    for a in range(bullet.shot_count):
                        $x_fudging = renpy.random.randint(-25,25)
                        $y_fudging = renpy.random.randint(-20,20)
                       
                        $ travel_time = get_ship_distance(bullet.parent,bullet.target)*0.1
                        add bullet.lbl:
                            at move_bullet(xposition,yposition,next_xposition+x_fudging,next_yposition+y_fudging,travel_time,wait)
                            xanchor 0.5
                            yanchor 0.5
                            zoom (zoomlevel/3.0)
               
                elif BM.attacker == Seraphim:
                    $wait = 2.0
                    for a in range(bullet.shot_count):
                        $x_fudging = renpy.random.randint(-25,25)
                        $y_fudging = renpy.random.randint(-20,20)
                       
                        $ travel_time = get_ship_distance(bullet.parent,bullet.target)*0.02
                        add bullet.lbl:
                            at move_bullet(xposition,yposition,next_xposition+x_fudging,next_yposition+y_fudging,travel_time,wait)
                            xanchor 0.5
                            yanchor 0.5
                            zoom (zoomlevel/3.0)
               
                else:
                    $wait = 0
                    for a in range(bullet.shot_count):
                        $x_fudging = renpy.random.randint(-25,25)
                        $y_fudging = renpy.random.randint(-20,20)
                        $wait += 0.02
                       
                        $ travel_time = get_ship_distance(bullet.parent,bullet.target)*0.1
                        add bullet.lbl:
                            at move_bullet(xposition,yposition,next_xposition+x_fudging,next_yposition+y_fudging,travel_time,wait)
                            xanchor 0.5
                            yanchor 0.5
                            zoom (zoomlevel/3.0)
                       
« Last Edit: June 14, 2016, 10:41:35 am by Void »
The only way to truly hurt a man, is to take everything that he valued and degrade it and remind him of it everyday of his life. But by doing this, you also create a monster, and you will regret ever harming that man, because he will be your greatest horror.