Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

How to create extra rool via variables ?

ephix3232

Villager
Xy$
0.00
Hey there! :)

(No one did comment on my last thread, so I hope I will get some good advice/tips here)

I have tried to create variables there you can roll for an extra item drop after you have won some match.
And you can only have MAX 4 on you, and you can only buy 1x per week (depend on how fast time system you have).

But I can't get it to work.

I have upload images for my test project, and posted NPC events on my map;


◆Show Choices:Buy one, Later (Window, Right, #1, #2)
:When Buy one
◆Comment:Locked! ((You can only have 1x, wait next week))
◆If:Bonus Point_Count ≥ 1
◆Text:None, Window, Bottom
: :You have one already!
: :Come back next week.

:End
◆Comment:Unlocked! ((Will be locked after you got one Bonus Point))
◆If:Bonus Point_Count = 0
◆Comment:Will check if your Bonus Point is MAX or not...
◆If:Bonus Point ≥ 4
◆Text:None, Window, Bottom
: :You have already 4x extra Rolls!
: :Come back later when you have less than 4.

:Else
◆If:Bonus Point ≤ 3
◆If:Bonus Point ≥ 1
◆Comment:If all is OK;
◆Control Variables:#0034 Bonus Point -= 1
◆Control Variables:#0036 Bonus Point_Count += 1
◆Text:None, Window, Bottom
: :you have now one extra rolls!
: :Come back next week if you want more.
: :( Please remember: You can only have 4x at the time! )

:End

:End

:End

:End

:When Later

:End

◆Battle Processing:BETA
:If Win
◆Recover All:Entire Party
◆If:Bonus Point ≥ 1
◆Text:None, Dim, Bottom
: :Do you want to use your extra roll?
◆Show Choices:Yes, No (Window, Right, #1, #2)
:When Yes
◆Control Variables:#0009 Random = Random 1..2
◆If:Random = 1
◆Change Gold:+ 500
◆Text:None, Window, Bottom
: :You got 500g from your extra roll!
◆Control Variables:#0034 Bonus Point -= 1

:End
◆If:Random = 2
◆Change Gold:+ 5000
◆Text:None, Window, Bottom
: :You got 5000g from your extra roll!
◆Control Variables:#0034 Bonus Point -= 1

:End

:When No

:End

:Else

:End

:If Escape
◆Recover All:Entire Party

:If Lose
◆Recover All:Entire Party

:End
----------------------------------------------------------

Issue;

I got 4 instead of 1 that I did write, that way I did use self-switch to stop looping,
but the problem is that it's looping to 4 and stop :s
I need so you can only get "one" per 2week, and MAX 4.

I haven 't tested Bonus Point count yet, but it seems to work so far, maybe because I got 4
bonus point instantly, even if I did use one, I got 4 again.
.........................................................................................................................................

This is a just small project, was planning to use different of kind extra roll token, like boss token, special token etc...
But I need to get this to work before putting that into my game.

All Tips/answer are welcome! =)
 

Attachments

Last edited:

CT_Bolt

Global Moderator
Staff member
Resource Team
Xy$
0.02
Summary:
  • System that allows player to get a set number of "extra item drop chances" each week.
  • Allow the player to buy only 1 per week.
  • If they have an "extra item drop chance" then allow the player to choose whether to use one after they win a battle.

Have I got this correct so far? Did I miss anything?

PS. You have a typo in the topic title. "rool" should be "roll"
 

Zarsla

Villager
Xy$
0.00
Well one problem is your conditional branch for your week counter, it's set to work when you're week is equal to 2 not every 2 weeks.
In that event make a new variable called week counter.
Set week counter equal to variable week.
Then make it where week counter is set to mod/% 2.
Then change the conditinal branch "week = 2" to "week counter = 0"

What I did is make it where
the counter is the total amount of weeks.
And modding means what is the remainder when you divide by that number.
So 10%3 means what is the remainder of 10 ÷ 3 or 1 as the answer of 10÷3 is 3 remainder 1. Thus if the remainder is 0 it's can be divided by that number.
You said you wanted it to be every 2 weeks, so that means the total number of weeks are divisible by 2, thus when you divide by 2, you should get a remainder of 0, and thus every second week.
 
Top