• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Item Variable System

Status
Not open for further replies.
Level 7
Joined
Dec 8, 2005
Messages
319
ok well I know there are many save and load scripts out there and I am not looking to write a new one. (Just not that good)
But what I am hoping to do is get some ideas on which one that would be able to save alot of items as variables.

ok so I am looking to make a card game that is something you can grow and work to having a better deck and something that I can build on over time.

I am not sure how to make a "Deck of Cards" or a group of items set to variables. or how i should go about it.

I was hoping someone might help me with how to start this database and maybe have a suggestion on whos save system might benefit me the most.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
How does it matter what save/load system you use? You just save integers (some constant numbers that represent your cards OR the item id numbers, but I think you'd rather skip that since it gives you less freedom), item names, or anything else that you can represent your cards as.

And you can't do any "database" thingy since you can't touch files or anything with Jass.
 
Level 7
Joined
Dec 8, 2005
Messages
319
true a database is not the right word to use but I am not sure how to set each item to a variable and then set those cards to a deck. I have a general idea but It is not all coming together.
 
Level 4
Joined
Feb 2, 2009
Messages
71
I'm not quite sure what you're asking for.

Maybe something like this?:
JASS:
type Deck extends array integer

globals
     CardId[1] = Something1
     CardId[2] = Something2
     CardId[3] = Something3
     Deck array PlayerDeck[12]
endglobals

Creating the Deck.
Each player must probably have it's own deck, so the deck need to support multiple decks.

If I'm right, every Deck should now be an array of integers. And you can access different Decks by defining which player owns it. PlayerDeck[1] is player1's Deck. I'm not sure how to access each deck. I guess you'd have to use struct and create methods for Deck operations.
I have never used custom types before, but I think you should use them something like above.

I may be TOTALLY off here haha, let me know if I'm wrong.
 
Level 11
Joined
Nov 15, 2007
Messages
781
He needs decks to be savable through multiple sessions. Basically he's making a trading card game/role playing game. It seems possible but I wouldn't be the one to ask.
 
Level 7
Joined
Dec 8, 2005
Messages
319
Yes this is very much like an RPG as far as the needs for the codes and massive amounts of integers. but I think this might get into custom script and sadly I can do gui as above average and jass noobish. anyone that know gui/jass think it is on that level to were it would have to be in jass?
 
Level 7
Joined
Dec 8, 2005
Messages
319
ok well every deck should be an array from 0-99 but cards not sure if I should make one huge array and have the cards be pulled from the array or should you have every card set to there own variable and also when you draw a card from your deck, it should be random but after that it should remove that card or cards from the rest of the deck. So this is what I am unsure how to do or really how to start on, It's been a while and I'm rusty on this stuff. And thanks again for all the comments and help
 
Status
Not open for further replies.
Top