Jump to content
pencilcase27

CardGame inspired skill and battle system

Recommended Posts

You can try messing around with skill types in the class features and giving each actor a unique skill type by adding more of them in the terms -> skill types box. Then assign certain card skills with that required skill type. It will most likely still show that the actor can add the card into his/her deck, but when you're in battle, they won't be able to use those cards.

 

You can do the same with required weapons for the card skills.

 

Doesn't sound like your project is a 1 actor project, so I can't really help much since I don't use more than 1 actor for my main project, so most likely the new script calls I made for the script won't be much use here.

Edited by MHRob

Share this post


Link to post
Share on other sites

Hey don't know if OP is still around but maybe someone can help me. 

 

I'm wondering how to change the text/font size for card descriptions, there is very little space so descriptions have to be extremely brief.

Share this post


Link to post
Share on other sites

Yeah that's not really ideal. There must be a way to change the font size just in that specific area.

 

EDIT: Got it to work with this snippet from another thread if anyone else is wondering.

 

 

def reset_font_settings

    super # run's Window_Base's reset_font_settings
    contents.font.size = 12
  end
 
 
EDIT 2: There's a bit more to this- I'll share my code for anyone trying to do the same.
 
 
From about line 1093:
 
EDIT 3: Oops, need to reset the font again or it will draw all the text on the card small. Marked changes in blue.
 

 

def draw_card_text(item)
    create_contents
    self.padding = standard_padding
    id          = item.card_id.to_s
    draw_text_ex(148 - id.size * 10, height - 48, "#" + id)
    make_cost_text(item.mp_cost, item.tp_cost)
    set_background(item.damage ? item.damage.element_id : 0)
    name        = (CARD_NAME_UP ? item.name.upcase : item.name)
    icon        = "\\I[" + RARITY[item.rarity][0].to_s + "]"
    type        = TYPE[item.type]
    name_x      = 0.5 * width - padding - item.name.size * 5
    draw_all_lines
    draw_text_ex(name_x, 9, name)
    draw_text_ex(0,48, type)
    
    def reset_font_settings
      super # run's Window_Base's reset_font_settings
      contents.font.size = 16
    end
  
    draw_text_ex(0,83, item.description)
 
   def reset_font_settings
      super   
    end
 
    draw_text_ex(0, height - 48, icon)
  end

 

 

I went with size 16 but you could go even smaller.

 

This next part you'll want to tweak the default_max_chars value depending on the font size. 24, as below, fits perfectly with size 16. Smaller font and you'll want to increase max chars, bigger and you'll need to decrease it.

 

 

def wordwrap(desc_text, window = nil, default_max_chars = 24)

 

 

It should look something like this:

 

xLfGJ6A.png

 

 

You can fit five rows of text at this size which is good enough for me. Smaller and you could fit more but it gets hard to read.

Edited by DeepSix

Share this post


Link to post
Share on other sites

Hey!

I've been thinking about to use this, but i'd like to set who will handle a deck and who will use normal skills.

Is that possible? If it was possible, it'll be really, really interesting.

 

EDIT¹: I'd like to know if there's a way to insert/remove a card direct to a deck, instead of adding/removing to the collection.

 

EDIT²: I'm can't just use the draw card feature. How can I do it? Can anyone teach me, please?  :( 

Edited by Arkaik

Share this post


Link to post
Share on other sites

@DeepSix, I'm glad you were able to find what you were looking for.

 

@Arkaik, if you use this script, you'll only be able to use skills that are designated as cards. Trying to do it any other way is complicated and not recommended, especially with the author of the script gone for so long, so I highly doubt it's possible. You'll have to choose either having cards as skills or just having regular skills in your game. I don't see doing both being a possibility unless the author makes it so.

 

Not sure about your last edit, you'll have to provide more info on that.

 

As for inserting a card directly into a deck. Well, I did create such a script call for my personal use and I don't mind sharing it. The problem is, I have not figured out how to do it for other actors besides the main actor (Party lead, I guess).

 

You'll need to do a bit of modifying of the main card game script. Only do this if you're still interested in being able to do what you asked for regarding the card to deck action.

 

Script Call: add_card_deck(id)

 

In order to use that script call, go to the main card game script and ctrl+f and copy and paste this in: Game_Interpreter

 

Now somewhere inside there, add this bit of code in there.

def add_card_deck(*args)
    for id in args
      for actor in $game_party.members
        actor.deck += [$data_skills[id]]
      end
    end
  end

Now after doing so, use this script call.

add_card_deck(id)

ID is the Skill Id in the skill database. 

 

Somethings to note about this.

 

1.You can surpass your deck limit if you use this.

2.Not sure if it will work for other actors in the party, I mainly use one actor in my project so I never bothered going any further with this.

3.If you have a certain limit for any of your cards, you can also surpass that limit using this script call.

 

All in all, use responsibly, and you'll be fine. I hope that helps. Please report back if you still need help.

 

EDIT: Also, forgot to mention that each actor can have a deck assigned to them via the script. Use ctrl+f and add the keyword: Start Decks. Enter the skill ids in there for each actor. You don't need to use the script call above if you want starter decks for any of your actors but I understand wanting to be able to event it as well. Choose whatever works for you, I guess.

 

That's perfect!

Did you know how to remove cards direct from deck too?

I'm not a scripter, but i tried to edit this little code for add to remove too, but it just remove every specified ID card. :P

Do you have something like this?

 

About the "Card Draw", it's the function to "buy" cards during battle, through itens or card effects. I just don't know how to do it. Everytime i try to do it with just like the script says how to, it doesn't works. :(

Share this post


Link to post
Share on other sites

Sure, I actually made a few new script calls, and that is one of them.

 

Script Call:

remove_card_deck(id)

In order to make that work, go back to Game_Interpreter in the main card game script and add this bit of code somewhere in there.

def remove_card_deck(*args)
    for id in args
      for actor in $game_party.members
        actor.deck -= [$data_skills[id]]
      end
    end
  end

That should do what you asked. 

 

 

 

The removing code doesn't work properly. I did exactly the same (changing 'add' for 'remove', puting the minus symbol [-] instead of plus  symbol [+]) and it doesn't works because it removes all cards of the specified ID. For exemple, if i got 3 fireballs (ID:29) and use the command to remove - remove_card_deck(29) - it will remove all 3 fireballs, instead of just 1 as intended. Can you fix it to remove just 1 card instead of any card with the same ID?

 

 

Now, concerning the "Card Draw" thing. I don't want to assume to know what you're talking about, since I've never seen anything about buying cards in battle. If you meant to draw cards in battle, you'll have to create a card impact note tag effect and apply it to a skill. There is a section in the main card game script that allows you to add this affect.

 

Ctrl+F and look for Card Effects.

 

Try adding this in that section, just for testing purposes.

"draw2" => [:draw, 2, 100, :target],

Now, Make a new card, and in the notebox area, add this note tag.

 

<card impact: draw2>

 

Make sure the scope is either "One Ally" or "The user". No hp damage or any of that other stuff. Give it an mp cost or whatever if you want, then add it to your deck and try it out in a test battle. 

 

Let me know how it goes. I apologize if this is NOT what you were asking. Please provide more details if it isn't what you meant.

 

About the draw card function: that's it!

Now I realize it could be a problem with the skill ID. I just can buy cards too!

Thank you! :D

Edited by Arkaik

Share this post


Link to post
Share on other sites

Well, I tried and tried and tried, but no matter how much I edit it or look at the other existing code, I can't for the life of me figure out how to make it remove only 1 card. It's weird. I've never caught that before since I only used that script call for special circumstances, such as my destiny draw script call and what not. Adding a card to the deck works exactly how it should. Why it removes all cards of a given id when you try to remove a card, is beyond me.

 

Sorry dude, I really tried. All I kept getting were game crashes x.x

 

My advice would be to only use that to remove cards that you made a special exception for in the script that you can only have 1 of each per deck. Even then, I just noticed, when you do remove a card from the deck, it doesn't go back to the collection.... Yeah, not sure what I can do about it at this point. 

Share this post


Link to post
Share on other sites

Well, I tried and tried and tried, but no matter how much I edit it or look at the other existing code, I can't for the life of me figure out how to make it remove only 1 card. It's weird. I've never caught that before since I only used that script call for special circumstances, such as my destiny draw script call and what not. Adding a card to the deck works exactly how it should. Why it removes all cards of a given id when you try to remove a card, is beyond me.

 

Sorry dude, I really tried. All I kept getting were game crashes x.x

 

My advice would be to only use that to remove cards that you made a special exception for in the script that you can only have 1 of each per deck. Even then, I just noticed, when you do remove a card from the deck, it doesn't go back to the collection.... Yeah, not sure what I can do about it at this point. 

 

Well, no problem.

I really expect to remove the card even from collection, but if there's no way i'll try to figure out something to do.  :ph34r:

Btw, i'm really thankful for your help. Thank you very much!  :D

Share this post


Link to post
Share on other sites

Can someone please tell me how to disable certain class from using certain skill card? so Warrior class cannot add magic ability cards to their deck. (if you are a cardgame fan you probably have heard of hearthstone, and that is basically what i am trying to do. class cards.) It will make error sound as if the deck is full when you try to add the card. i found the max cards in a deck check, but i don't know how to add ability and class check.

 

currently, i have to use condition check for each actor index.id and skill_id to check. it works, but i don't want that. I want actor class and skill type (such as physical, magic, special, etc) check. please help.

Edited by wrathunleashed

Share this post


Link to post
Share on other sites

Can someone please tell me how to disable certain class from using certain skill card? so Warrior class cannot add magic ability cards to their deck. (if you are a cardgame fan you probably have heard of hearthstone, and that is basically what i am trying to do. class cards.) It will make error sound as if the deck is full when you try to add the card. i found the max cards in a deck check, but i don't know how to add ability and class check.

 

currently, i have to use condition check for each actor index.id and skill_id to check. it works, but i don't want that. I want actor class and skill type (such as physical, magic, special, etc) check. please help.

 

I was thinking about it, but there's just no way. All you can do is to set which kind of skill could be used by which actor class and then, when battle begin you couldn't use the skill card, but to set which class could equip the card isn't possible at this very moment. :/

 

EDIT: I hope the script writer reappears with a bunch of new features to this script. Yes, i hope. With all my heart, i hope. :')

Edited by Arkaik

Share this post


Link to post
Share on other sites

I'm interested in using this system, but adapted to WIXOSS-style gameplay.

 

So the idea is, certain cards would be limited to the main character, and other cards would be useable by their summoned allies. Cards would also be involved for the main character's HP - when they get hit, they lose a card and its effect triggers.

 

Are either of these possible?

Share this post


Link to post
Share on other sites

A few questions

  • Is it possible to make only certain characters/classes use the card system, while others could still use the default skill system? Or perhaps a skill type "Card" that would access the card functions.
  • How would I go about making another location that cards can go?  Such as a banished pile?
  • Can you have cards that are "In play"?  Such as a summon card that stays on the field until the summon is destroyed?
Edited by OverlyEpux

Share this post


Link to post
Share on other sites

 

A few questions

  • Is it possible to make only certain characters/classes use the card system, while others could still use the default skill system? Or perhaps a skill type "Card" that would access the card functions.
  • How would I go about making another location that cards can go?  Such as a banished pile?
  • Can you have cards that are "In play"?  Such as a summon card that stays on the field until the summon is destroyed?

 

 

Not wanting to necro this thread too much, but here's a few answers:

 

  • Not currently no, you can't split between actors using ccg and actors not as far as I know without some other script that I have not heard of.
  • I personally don't know how to create an "exile/banish" pile but I assume it's possible to be scripted.
  • Pencilcase was planning on making this but never got around to it.

 

On another note, I've begun my own project using this game. I'll eventually make a dedicated thread but for now here's a youtube video:

https://www.youtube.com/watch?time_continue=117&v=L7s25malYSI

 

I've modded the script somewhat to allow for Class restrictions, minimum deck size and a few other new ideas. 

Share this post


Link to post
Share on other sites

Hi, I'm probably just an idiot but I can't seem to create a physical card. I'm trying to create slash but it crashes the game when I try to use it.

 

Notetags:

<card id: 2>
<card type: 1>
<card rarity: 1>
<card cost: 2>
<card impact: Draw>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted