xabileug

Veteran
Veteran
Joined
Jul 1, 2014
Messages
178
Reaction score
38
Is there any way to change the Picture ID? Im making a card game, and cards are discarded into the center, i'd like the last card to be on top of the discard pile every time.
The problem is i assign ID 1-7 for player 1, 8-14 for player 2, 15-21 for player 3, 22-28 for player 4.. So when Player 1 throws a card in the pile, it automatically goes to the bottom, because it has a lower picture ID
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,513
Reaction score
2,617
First Language
English
Primarily Uses
RMMZ
The pictures are stored in the _pictures array in $gameScreen, and the ID is just the array element the picture is at.

To do this, I would find the highest element in the array that has a Game_Picture in it (x), set the x+1th element of the array to be equal to the card thrown on the pile, and set the x one to "undefined" to avoid duplicating it.
 

xabileug

Veteran
Veteran
Joined
Jul 1, 2014
Messages
178
Reaction score
38
thanks i tried that duplicating, but it messes up the rotate animation i have. i could set an invisible pile cards, but it gets difficult since the first turn is selected at random every time.
if there was only a way to inherit the properties of one picture to another.. like the first thrown card is ID 24, then it can be inherited instantly by another picture with ID 31.. and so on so
24 : 31
25 : 32
26 : 33
27 : 34
28 : 35
1 : 36 <--- back to start
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
596
Reaction score
266
First Language
PT-BR
Primarily Uses
RM2k3
You need to use the same "Array" logic.

Example:
Player1 = 4,13,17,18,22,20,1
Picture 4 show face card 18
Player2 = 27,2,16,10,26,19,5
Player3 = 11,3,15,28,14,23,7
Picture 19 show face card 14
Player4 = 25,24,21,6,9,8,12

Picture 1 return card4

Trading -> Player 1 send Card pos 4 to Player 3
Trading -> Player 3 send Card pos 5to Player 1

After:
Player1 = 4,13,17,14,22,20,1
Picture 4 show face card 14
Player3 = 11,3,15,28,18,23,7
Picture 19 show face card 18
Player4 = 25,24,21,6,9,8,12
 

Latest Threads

Latest Posts

Latest Profile Posts

Add Smart Help Window Popup to Items and Skills | RPG Maker News #79

Is it unusual to think your own music is strange? xD I honestly don't know if I'm gonna use any of them :p
I've been keeping my cards fairly close to my chest, but Team Muxedo Task is proud to present the first offering for our contest entry: the title screen background.1624496085488.png
I love work placement programs. Part of it is to get a resume done by a "professional" even though I use a portfolio in my profession.

Forum statistics

Threads
112,511
Messages
1,068,810
Members
146,190
Latest member
Wesles
Top