[SOLVED]Is possible make more than 1 base class for enemies in a RPG frame how to make it?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
leoxhurt
Regular
Posts: 34
Joined: Fri Aug 04, 2017 6:25 pm
Contact:

[SOLVED]Is possible make more than 1 base class for enemies in a RPG frame how to make it?

#1 Post by leoxhurt »

i want to put a RPG frame in my VN, but the demo file of classes only have 1 base class for enemy, how to make more?
Last edited by leoxhurt on Mon Aug 21, 2017 10:57 am, edited 1 time in total.

TheChatotMaestro
Regular
Posts: 91
Joined: Mon Jul 31, 2017 8:33 am
Deviantart: LedianWithACamera
Contact:

Re: Is possible make more than 1 base class for enemies in a RPG frame how to make it?

#2 Post by TheChatotMaestro »

I have no idea what code we're working with here, since you didn't provide any example or anything, but I think all you have to do is copy and paste the base class and then change what you want!

Say the code looked like this:
*defines class* "name"
*info*
*info*
*info*

You could just ctrl-c;ctrl-v and then change the name and any of the info inside! That's what I do when I need to make lots of one thing, like messages in a message framework or DSE events.

User avatar
SuperbowserX
Veteran
Posts: 270
Joined: Sat Jan 07, 2017 3:09 pm
Contact:

Re: Is possible make more than 1 base class for enemies in a RPG frame how to make it?

#3 Post by SuperbowserX »

Can't you do object oriented programming in Ren'Py using Python? Is that what you are suggesting Maestro

leoxhurt
Regular
Posts: 34
Joined: Fri Aug 04, 2017 6:25 pm
Contact:

Re: Is possible make more than 1 base class for enemies in a RPG frame how to make it?

#4 Post by leoxhurt »

TheChatotMaestro wrote: Sun Aug 20, 2017 11:34 am I have no idea what code we're working with here, since you didn't provide any example or anything, but I think all you have to do is copy and paste the base class and then change what you want!

Say the code looked like this:
*defines class* "name"
*info*
*info*
*info*

You could just ctrl-c;ctrl-v and then change the name and any of the info inside! That's what I do when I need to make lots of one thing, like messages in a message framework or DSE events.
i was using this code found in coobook

Code: Select all

#Library developed by http://wholetonegames.blogspot.com/
#You may use this in your game for commercial or non-commercial purposes.
#Credits: If you post a link to my blogspot I'd appreciate it. Thanks!
init python:
    import random, math, time

##########################################################
#base class
##########################################################
    class Combatant:
        def __init__(self, name="enemy", HP=10, attack=12, defense=5):
            self.name = name
            self.HP = int(HP)
            self.attack = int(attack)
            self.defense = int(defense)
            self.attackBuff = 0
            self.defenseBuff = 0
            self.maxHP = int(HP)
            self.XP = int(math.ceil( (HP + attack + defense) / 2 ) )
            self.defending = False
            self.damageTotal = 0
            self.level = None
            self.inventory = []

        @property
        def refillHP(self):
            self.HP = int(self.maxHP)

        def attacked(self, heroAttack):
            if self.defense is 0:
                self.defense = 1
            addedDefense = self.defense + self.defenseBuff
            if self.defending:
                addedDefense *= 2
            self.damageTotal = int( math.ceil(heroAttack / addedDefense ) )
            self.HP -= self.damageTotal
            if self.HP < 0:
                self.HP = 0
            self.defending = False
                
        @property
        def damage(self):
            return self.damageTotal

        @property
        def attacking(self):
            addedAttack = self.attack + self.attackBuff
            minAtk= addedAttack / 2
            maxAtk= addedAttack + minAtk
            strength = random.randint(minAtk,maxAtk)
            if strength is 0:
                strength = 1
            return int( math.ceil( strength * addedAttack / minAtk ) )
        
        @property
        def KO(self):
            return True if self.HP <= 0 else False
                
        def addItems(self, itemArray):
            for item in itemArray:
                self.inventory.append(item)
        
        @property
        def listItems(self):
            countedItemsList = []
            countedItemsString = ''
            for item in self.inventory:
                if item not in countedItemsList:
                    numberOfItems = str(self.inventory.count(item))
                    countedItemsString += numberOfItems + 'x ' + item + ', '
                    countedItemsList.append(item)
            countedItemsString = countedItemsString[:-2]
            return countedItemsString
        
        @property
        def isInventoryNonEmpty(self):
            inv_len = len(self.inventory) > 0
            return inv_len
            
##########################################################
#player character extends base class
##########################################################
    class Player(Combatant):
        def __init__(self, name="hero", level=1, modifierLarge=3, modifierSmall=2):
            self.name = name
            self.level = level
            self.modA = modifierLarge
            self.modB = modifierSmall
            self.modSum = modifierLarge + modifierSmall
            self.XP = 0
            self.HP=0
            self.attack = 0
            self.defense = 0
            self.attackBuff = 0
            self.defenseBuff = 0
            self.maxHP = 0
            self.defending = False
            self.inventory = []
            self.weapon_bonus=0
            self.set_stats()

        def gainXP(self, addedXP):
            self.XP += addedXP
            XP_goal = self.XP_Goal_check()
            while self.XP >= XP_goal:
                self.level += 1
                XP_goal = self.XP_Goal_check()
                self.set_stats()
                
        @staticmethod
        def XP_level_calculator(level):
            return int(math.pow(level,2) / 0.25)

        def XP_Goal_check(self):
            next_level = self.level + 1
            XP_needed_for_level_up = self.XP_level_calculator(next_level)
            XP_needed_for_current_level = self.XP_level_calculator(self.level)
            return XP_needed_for_current_level + XP_needed_for_level_up

        def set_stats(self):
            self.maxHP = int(math.pow(self.level, 2) + self.modSum + self.modB )
            self.HP = int(self.maxHP) # replenishes HP when levelling up
            self.attack = int(self.level * self.modA + self.modSum )
            self.defense = int(self.level * self.modB + self.modSum )
   
##########################################################
#global helper functions
##########################################################
    class Combat:
        def __init__(self, player, enemy, next_label,defeat_label):
            self.game_over = defeat_label
            self.next_label = next_label
            self.player = player
            self.enemy = enemy
            
        choice_attack = 'attack'
        choice_attackBonus = 'attackBonus'
        choice_refillHP = 'refillHP'
        choice_defend = 'defend'

        enum_player = 0
        enum_enemy = 1
        
        def random_battle(self):
            is_battle = random.randint(0,1) == 1
            if is_battle:
                self.combat()
            else:
                renpy.jump(self.next_label)
        
        @staticmethod
        def turn_announcer(combatant):
            txt = "{}'s turn".format(combatant.name)
            renpy.say(None, txt)
        
        @staticmethod
        def set_battle_option():
            renpy.show_screen('battle_menu')
            battle_choice = ui.interact()
            renpy.hide_screen('battle_menu')
            return battle_choice
        
        @staticmethod
        def attack_strike(attacker, defender):
            previous_HP = defender.HP
            defender.attacked(attacker.attacking)
            no_damage = defender.damage == 0
            if no_damage:
                txt = "{} attacks but {} receives no damage".format(attacker.name, defender.name)
            else:
                critical_hit = defender.damage > previous_HP
                if critical_hit:
                    txt = "{} attacks and {} is fatally wounded".format(attacker.name, defender.name)
                else:
                    txt = "{} attacks and {} receives {} damage".format(attacker.name, defender.name, defender.damage)
            renpy.say(None, txt)
          
        @staticmethod
        def start_combat_screen(value):
            _game_menu_screen = enable_saving(False)
            if value:
                renpy.show_screen('hero_stats')
                renpy.show_screen('enemy_stats')
            else:
                renpy.hide_screen('hero_stats')
                renpy.hide_screen('enemy_stats')
        
        def next_round(self):
            if self.enemy.KO:
                _game_menu_screen = enable_saving(True)
                self.enemy_defeated()
            elif self.player.KO:
                _game_menu_screen = enable_saving(True)
                renpy.jump(self.game_over)
            else:
                self.combat()
           
        def check_KO(self):
            if self.enemy.KO or self.player.KO:
                self.end_of_round()
        
        def enemy_defeated(self):
            old_level = self.player.level
            txt = "YOU WIN {} XP!".format(self.enemy.XP)
            renpy.say(None, txt)
            if self.enemy.isInventoryNonEmpty:
                booty = self.enemy.listItems
                txt = "{} dropped: \n{}".format(self.enemy.name, booty)
                renpy.say(None, txt)
            self.player.gainXP(self.enemy.XP)
            self.player.addItems(self.enemy.inventory)
            if self.player.level > old_level:
                txt = "YOUR LEVEL: {}".format(self.player.level)
                renpy.say(None, txt)
            renpy.jump(self.next_label)
                
        def battle_action(self, battle_choice):
            if battle_choice is Combat.choice_attack:
                    Combat.attack_strike(self.player, self.enemy)
                    
            elif battle_choice is Combat.choice_attackBonus:
                self.player.attackBuff = self.player.weapon_bonus
                Combat.attack_strike(self.player, self.enemy)
                self.player.attackBuff = 0
                
            elif battle_choice is Combat.choice_refillHP:
                self.player.refillHP
                txt = "{}'s HP refilled".format(self.player.name)
                renpy.say(None, txt)
                
            elif battle_choice is Combat.choice_defend:
                self.player.defending = True
                txt = "{} defends".format(self.player.name)
                renpy.say(None, txt)
                
        def turn_decider(self):
            if self.enemy.attack > self.player.attack:
                return Combat.enum_enemy
            else:
                return Combat.enum_player
        
        def next_turn(self, whose_turn, first_turn):
            if whose_turn is None:
                if first_turn is Combat.enum_player:
                    self.player_turn(first_turn)
                else:
                    self.enemy_turn(first_turn)
            else:
                if whose_turn == Combat.enum_player:
                    if first_turn is Combat.enum_player:
                        self.enemy_turn(first_turn)
                    else:
                        self.end_of_round()
                else:
                    if first_turn is Combat.enum_player:
                        self.end_of_round()
                    else:
                        self.player_turn(first_turn)
        
        def combat(self):
            Combat.start_combat_screen(True)
            first_turn = self.turn_decider()
            self.next_turn(None, first_turn)

        def player_turn(self, first_turn):
            Combat.turn_announcer(self.player)
            
            battle_choice = Combat.set_battle_option()
            self.battle_action(battle_choice)
            self.check_KO()
            self.next_turn(Combat.enum_player, first_turn)
            
        def enemy_turn(self, first_turn):
            Combat.turn_announcer(self.enemy)
            Combat.attack_strike(self.enemy, self.player)
            self.check_KO()
            self.next_turn(Combat.enum_enemy, first_turn)

        def end_of_round(self):
            Combat.start_combat_screen(False)
            self.next_round()
      
      



##########################################################
#global variables
##########################################################
    wtg_first_turn=None
    
##########################################################
#screens showing HP
##########################################################
    
    def stats_frame(charaObj, **properties):

        ui.frame(xfill=False, yminimum=None, **properties)

        ui.hbox() # (name, "HP", bar) from (level, hp, maxhp)
        ui.vbox() # name from ("HP", bar)

        ui.text(charaObj.name, size=20)

        ui.hbox() # "HP" from bar
        ui.text("HP", size=20)
        ui.bar(charaObj.maxHP, charaObj.HP,
               xmaximum=150)

        ui.close()
        ui.close()

        ui.vbox() # Level from (hp/maxhp)
        if charaObj.level is not None:
            ui.text("Lv. %d" % charaObj.level, xalign=0.5, size=20)
        ui.text("%d/%d" % (charaObj.HP, charaObj.maxHP), xalign=0.5, size=20)

        ui.close()
        ui.close()

    def hero_battle_menu( **properties):
        ui.frame(xfill=True, yminimum=None, **properties)
        
        ui.vbox()
        ui.text("[wtg_player.name]'s menu", size=20)
        
        ui.hbox()
        ui.textbutton("{color=#FFFFFF}attack [wtg_enemy.name]{/color}", clicked=ui.returns(Combat.choice_attack))
        ui.textbutton("{color=#FFFFFF}attack with + [wtg_player.weapon_bonus] weapon{/color}", clicked=ui.returns(Combat.choice_attackBonus))
        ui.textbutton("{color=#FFFFFF}defend{/color}", clicked=ui.returns(Combat.choice_defend))
        ui.close()
        
        ui.close()

#This label controls Enemy and Player stats' screen
screen hero_stats:
    $ stats_frame(wtg_player, xalign=.02, yalign=.6)

screen enemy_stats:        
    $ stats_frame(wtg_enemy, xalign=.98, yalign=.6)

screen battle_menu:
    $ hero_battle_menu( xalign=.0, yalign=0.7)
    
and i want to know if i can have onde more class tham "Combatant i tried to copy and only change name but the renpy give me a error

leoxhurt
Regular
Posts: 34
Joined: Fri Aug 04, 2017 6:25 pm
Contact:

Re: Is possible make more than 1 base class for enemies in a RPG frame how to make it?

#5 Post by leoxhurt »

leoxhurt wrote: Mon Aug 21, 2017 10:41 am
TheChatotMaestro wrote: Sun Aug 20, 2017 11:34 am I have no idea what code we're working with here, since you didn't provide any example or anything, but I think all you have to do is copy and paste the base class and then change what you want!

Say the code looked like this:
*defines class* "name"
*info*
*info*
*info*

You could just ctrl-c;ctrl-v and then change the name and any of the info inside! That's what I do when I need to make lots of one thing, like messages in a message framework or DSE events.
i was using this code found in coobook

Code: Select all

#Library developed by http://wholetonegames.blogspot.com/
#You may use this in your game for commercial or non-commercial purposes.
#Credits: If you post a link to my blogspot I'd appreciate it. Thanks!
init python:
    import random, math, time

##########################################################
#base class
##########################################################
    class Combatant:
        def __init__(self, name="enemy", HP=10, attack=12, defense=5):
            self.name = name
            self.HP = int(HP)
            self.attack = int(attack)
            self.defense = int(defense)
            self.attackBuff = 0
            self.defenseBuff = 0
            self.maxHP = int(HP)
            self.XP = int(math.ceil( (HP + attack + defense) / 2 ) )
            self.defending = False
            self.damageTotal = 0
            self.level = None
            self.inventory = []

        @property
        def refillHP(self):
            self.HP = int(self.maxHP)

        def attacked(self, heroAttack):
            if self.defense is 0:
                self.defense = 1
            addedDefense = self.defense + self.defenseBuff
            if self.defending:
                addedDefense *= 2
            self.damageTotal = int( math.ceil(heroAttack / addedDefense ) )
            self.HP -= self.damageTotal
            if self.HP < 0:
                self.HP = 0
            self.defending = False
                
        @property
        def damage(self):
            return self.damageTotal

        @property
        def attacking(self):
            addedAttack = self.attack + self.attackBuff
            minAtk= addedAttack / 2
            maxAtk= addedAttack + minAtk
            strength = random.randint(minAtk,maxAtk)
            if strength is 0:
                strength = 1
            return int( math.ceil( strength * addedAttack / minAtk ) )
        
        @property
        def KO(self):
            return True if self.HP <= 0 else False
                
        def addItems(self, itemArray):
            for item in itemArray:
                self.inventory.append(item)
        
        @property
        def listItems(self):
            countedItemsList = []
            countedItemsString = ''
            for item in self.inventory:
                if item not in countedItemsList:
                    numberOfItems = str(self.inventory.count(item))
                    countedItemsString += numberOfItems + 'x ' + item + ', '
                    countedItemsList.append(item)
            countedItemsString = countedItemsString[:-2]
            return countedItemsString
        
        @property
        def isInventoryNonEmpty(self):
            inv_len = len(self.inventory) > 0
            return inv_len
            
##########################################################
#player character extends base class
##########################################################
    class Player(Combatant):
        def __init__(self, name="hero", level=1, modifierLarge=3, modifierSmall=2):
            self.name = name
            self.level = level
            self.modA = modifierLarge
            self.modB = modifierSmall
            self.modSum = modifierLarge + modifierSmall
            self.XP = 0
            self.HP=0
            self.attack = 0
            self.defense = 0
            self.attackBuff = 0
            self.defenseBuff = 0
            self.maxHP = 0
            self.defending = False
            self.inventory = []
            self.weapon_bonus=0
            self.set_stats()

        def gainXP(self, addedXP):
            self.XP += addedXP
            XP_goal = self.XP_Goal_check()
            while self.XP >= XP_goal:
                self.level += 1
                XP_goal = self.XP_Goal_check()
                self.set_stats()
                
        @staticmethod
        def XP_level_calculator(level):
            return int(math.pow(level,2) / 0.25)

        def XP_Goal_check(self):
            next_level = self.level + 1
            XP_needed_for_level_up = self.XP_level_calculator(next_level)
            XP_needed_for_current_level = self.XP_level_calculator(self.level)
            return XP_needed_for_current_level + XP_needed_for_level_up

        def set_stats(self):
            self.maxHP = int(math.pow(self.level, 2) + self.modSum + self.modB )
            self.HP = int(self.maxHP) # replenishes HP when levelling up
            self.attack = int(self.level * self.modA + self.modSum )
            self.defense = int(self.level * self.modB + self.modSum )
   
##########################################################
#global helper functions
##########################################################
    class Combat:
        def __init__(self, player, enemy, next_label,defeat_label):
            self.game_over = defeat_label
            self.next_label = next_label
            self.player = player
            self.enemy = enemy
            
        choice_attack = 'attack'
        choice_attackBonus = 'attackBonus'
        choice_refillHP = 'refillHP'
        choice_defend = 'defend'

        enum_player = 0
        enum_enemy = 1
        
        def random_battle(self):
            is_battle = random.randint(0,1) == 1
            if is_battle:
                self.combat()
            else:
                renpy.jump(self.next_label)
        
        @staticmethod
        def turn_announcer(combatant):
            txt = "{}'s turn".format(combatant.name)
            renpy.say(None, txt)
        
        @staticmethod
        def set_battle_option():
            renpy.show_screen('battle_menu')
            battle_choice = ui.interact()
            renpy.hide_screen('battle_menu')
            return battle_choice
        
        @staticmethod
        def attack_strike(attacker, defender):
            previous_HP = defender.HP
            defender.attacked(attacker.attacking)
            no_damage = defender.damage == 0
            if no_damage:
                txt = "{} attacks but {} receives no damage".format(attacker.name, defender.name)
            else:
                critical_hit = defender.damage > previous_HP
                if critical_hit:
                    txt = "{} attacks and {} is fatally wounded".format(attacker.name, defender.name)
                else:
                    txt = "{} attacks and {} receives {} damage".format(attacker.name, defender.name, defender.damage)
            renpy.say(None, txt)
          
        @staticmethod
        def start_combat_screen(value):
            _game_menu_screen = enable_saving(False)
            if value:
                renpy.show_screen('hero_stats')
                renpy.show_screen('enemy_stats')
            else:
                renpy.hide_screen('hero_stats')
                renpy.hide_screen('enemy_stats')
        
        def next_round(self):
            if self.enemy.KO:
                _game_menu_screen = enable_saving(True)
                self.enemy_defeated()
            elif self.player.KO:
                _game_menu_screen = enable_saving(True)
                renpy.jump(self.game_over)
            else:
                self.combat()
           
        def check_KO(self):
            if self.enemy.KO or self.player.KO:
                self.end_of_round()
        
        def enemy_defeated(self):
            old_level = self.player.level
            txt = "YOU WIN {} XP!".format(self.enemy.XP)
            renpy.say(None, txt)
            if self.enemy.isInventoryNonEmpty:
                booty = self.enemy.listItems
                txt = "{} dropped: \n{}".format(self.enemy.name, booty)
                renpy.say(None, txt)
            self.player.gainXP(self.enemy.XP)
            self.player.addItems(self.enemy.inventory)
            if self.player.level > old_level:
                txt = "YOUR LEVEL: {}".format(self.player.level)
                renpy.say(None, txt)
            renpy.jump(self.next_label)
                
        def battle_action(self, battle_choice):
            if battle_choice is Combat.choice_attack:
                    Combat.attack_strike(self.player, self.enemy)
                    
            elif battle_choice is Combat.choice_attackBonus:
                self.player.attackBuff = self.player.weapon_bonus
                Combat.attack_strike(self.player, self.enemy)
                self.player.attackBuff = 0
                
            elif battle_choice is Combat.choice_refillHP:
                self.player.refillHP
                txt = "{}'s HP refilled".format(self.player.name)
                renpy.say(None, txt)
                
            elif battle_choice is Combat.choice_defend:
                self.player.defending = True
                txt = "{} defends".format(self.player.name)
                renpy.say(None, txt)
                
        def turn_decider(self):
            if self.enemy.attack > self.player.attack:
                return Combat.enum_enemy
            else:
                return Combat.enum_player
        
        def next_turn(self, whose_turn, first_turn):
            if whose_turn is None:
                if first_turn is Combat.enum_player:
                    self.player_turn(first_turn)
                else:
                    self.enemy_turn(first_turn)
            else:
                if whose_turn == Combat.enum_player:
                    if first_turn is Combat.enum_player:
                        self.enemy_turn(first_turn)
                    else:
                        self.end_of_round()
                else:
                    if first_turn is Combat.enum_player:
                        self.end_of_round()
                    else:
                        self.player_turn(first_turn)
        
        def combat(self):
            Combat.start_combat_screen(True)
            first_turn = self.turn_decider()
            self.next_turn(None, first_turn)

        def player_turn(self, first_turn):
            Combat.turn_announcer(self.player)
            
            battle_choice = Combat.set_battle_option()
            self.battle_action(battle_choice)
            self.check_KO()
            self.next_turn(Combat.enum_player, first_turn)
            
        def enemy_turn(self, first_turn):
            Combat.turn_announcer(self.enemy)
            Combat.attack_strike(self.enemy, self.player)
            self.check_KO()
            self.next_turn(Combat.enum_enemy, first_turn)

        def end_of_round(self):
            Combat.start_combat_screen(False)
            self.next_round()
      
      



##########################################################
#global variables
##########################################################
    wtg_first_turn=None
    
##########################################################
#screens showing HP
##########################################################
    
    def stats_frame(charaObj, **properties):

        ui.frame(xfill=False, yminimum=None, **properties)

        ui.hbox() # (name, "HP", bar) from (level, hp, maxhp)
        ui.vbox() # name from ("HP", bar)

        ui.text(charaObj.name, size=20)

        ui.hbox() # "HP" from bar
        ui.text("HP", size=20)
        ui.bar(charaObj.maxHP, charaObj.HP,
               xmaximum=150)

        ui.close()
        ui.close()

        ui.vbox() # Level from (hp/maxhp)
        if charaObj.level is not None:
            ui.text("Lv. %d" % charaObj.level, xalign=0.5, size=20)
        ui.text("%d/%d" % (charaObj.HP, charaObj.maxHP), xalign=0.5, size=20)

        ui.close()
        ui.close()

    def hero_battle_menu( **properties):
        ui.frame(xfill=True, yminimum=None, **properties)
        
        ui.vbox()
        ui.text("[wtg_player.name]'s menu", size=20)
        
        ui.hbox()
        ui.textbutton("{color=#FFFFFF}attack [wtg_enemy.name]{/color}", clicked=ui.returns(Combat.choice_attack))
        ui.textbutton("{color=#FFFFFF}attack with + [wtg_player.weapon_bonus] weapon{/color}", clicked=ui.returns(Combat.choice_attackBonus))
        ui.textbutton("{color=#FFFFFF}defend{/color}", clicked=ui.returns(Combat.choice_defend))
        ui.close()
        
        ui.close()

#This label controls Enemy and Player stats' screen
screen hero_stats:
    $ stats_frame(wtg_player, xalign=.02, yalign=.6)

screen enemy_stats:        
    $ stats_frame(wtg_enemy, xalign=.98, yalign=.6)

screen battle_menu:
    $ hero_battle_menu( xalign=.0, yalign=0.7)
    
and i want to know if i can have onde more class tham "Combatant" for enemies i tried to copy and only change name but the renpy give me a error

leoxhurt
Regular
Posts: 34
Joined: Fri Aug 04, 2017 6:25 pm
Contact:

Re: Is possible make more than 1 base class for enemies in a RPG frame how to make it?

#6 Post by leoxhurt »

leoxhurt wrote: Mon Aug 21, 2017 10:42 am
leoxhurt wrote: Mon Aug 21, 2017 10:41 am
TheChatotMaestro wrote: Sun Aug 20, 2017 11:34 am I have no idea what code we're working with here, since you didn't provide any example or anything, but I think all you have to do is copy and paste the base class and then change what you want!

Say the code looked like this:
*defines class* "name"
*info*
*info*
*info*

You could just ctrl-c;ctrl-v and then change the name and any of the info inside! That's what I do when I need to make lots of one thing, like messages in a message framework or DSE events.



and i want to know if i can have onde more class tham "Combatant" for enemies i tried to copy and only change name but the renpy give me a error "global error: 'warrior' is not defined
Last edited by leoxhurt on Mon Aug 21, 2017 10:56 am, edited 1 time in total.

leoxhurt
Regular
Posts: 34
Joined: Fri Aug 04, 2017 6:25 pm
Contact:

Re: Is possible make more than 1 base class for enemies in a RPG frame how to make it?

#7 Post by leoxhurt »

i solved the problem there was some small erros in code that i copied thks for the help anyway

Post Reply

Who is online

Users browsing this forum: No registered users