RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[Resolved and working] VX:Plants Grows and Bank interests?

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 66
RMRK Junior
Hello. I have copyed and modified some Bank Event, and i was wondering...
When you leave the map in witch the event is, you still continue to get the interests?
I'm trying to make 2 different Common Event, one allowing me to get interests from the bank, and another one, to make Grow Plants where i'm away from the place i've planted them.

My Code is: For the bank in a normal Event called Bank:

Quote
NPC: Priority-As Player, Trigger-Action Button
Call Common Event: Bank

Common Event Bank:
Control Variable: [0087 Deposit]= Variable [0082 Gold in Bank]
Control Variable: [0081 Gold in Inventory]= Gold
Control Variable: [0083 Give to Bank]=0
Control Variable: [0084 Take from Bank]=0
Show Choice: [Deposit some Gold, Withdraw some Gold, How much i have?,Nothing...]
 When:[Deposit some Gold]
   Text: How much you will Give to the Bank to take care of?
     Input Number:[0083 Give to Bank] 8 digits
       Conditional Branch: Variable: [0083 Give to Bank] =< [0081 Gold in Inventory]
         Control Variable: [0082 Gold in Bank] +[0083 Give to Bank]
         Change Gold: -Variable: [0083 Give to Bank]
         Text: Tanks, we will take care of your \v[0083] Gold.
         Control Switches: [0092 Gain] =On
         Control Variable: [0083 Give to Bank]=0
         Else Text: Sorry, you dont have that much Gold, sir...
         Control Variable: [0083 Give to Bank]=0
         Branch End
  When: [Withdraw some Gold]
    Text: How much will you take back?
    Input Number:[0084 Take from Bank] 8 digits
      Conditional Branch: Variable: [0084 Withdraw from Bank] =< [0082 Gold in Bank]
         Control Variable: [0082 Gold in Bank] -[0084 Withdraw from Bank]
         Change Gold: +Variable: [0084 Withdraw from Bank]
         Text: Here there are your \v[0084] Gold, Sir.
         Control Variable: [0084 Withdraw from Bank]=0
         Else Text: Sorry, you dont have that much Gold, sir...
         Control Variable: [0084 Withdraw from Bank]=0
         Branch End
When: [How much i have?]
  Text: You have \v[0082] Gold within our Bank, sir.
   Branch End 

The Interests Common Event is like this: Interest: Parallel Process

Quote
Label: Start
 Control Variable: [0086 Interests Rate] = Variable [0082 Gold in Bank]
 Control Variable: [0085 Interests] = +1
 Wait 60 frames
 Conditional Branch: Variable [0085 Interests] = = 60
   Control Variable: [0086 Interests Rate] / = 100
   Control Variable [0082 Gold in Bank] + [0086 Interests Rate]
   Control Variable Variable [0085 Interests] = 0
   Jump to Label: Start
 Else
Branch End

Now...it give around 1% of Bank deposit Gold every 60 seconds, if i stay on the same map of the bank. What if i leave and go around?
When i'm back after 10 minutes, i didnt have 10% more money...
if i put the Common Event in every single map of the game, it seems to work...
But it is so that i must do? Or there is another easyest way to do it?

For the Plant, the Code-Event is similar

An event in a place: Same as Bank, like this:

Event Name: Tree 1
The first page of event show the picture of a hole in the terrain:
Priority-Below Player, Trigger-Action Button

Quote
  Text: Did you wish to plant a Tree there Milord? It will cost you 2000 Gold.
    Show Choice: [yes, no,]
    When: [yes]
    Conditional Branch: Gold 2000 or more
     Text: Good Milord, now i will take care of the plant when tou are away.
             Come back some time later to see if it is ready to be used.
     Self Switch: A= on
     Change Gold: -2000
    Else: Text: Sorry Milord, you dont have enought money...
   Branch End
  When: [no]
  When Cancel:
Branch End

The second page of the same event is a Little Plant picture:
Priority-Same as Player, Trigger-Action Button, self switch A is on
Quote
Label: Tree 1
 Wait: 600 frames (About 10 seconds)
  Control Variable [0053 Trees Growt] = +1
  Conditional Branch:[0053 Tree Growt 1] >= 60 (so it grows in ten minutes)
  Control Variable [0053 Trees Growt] = -60
  Control Self Switch: A = off
  Control Self Switch: B = on
 Else:
  Jump to Label: Tree 1
End Branch:

The Third page of the same event is a Full Growt tree:
Priority-Same as Player, Trigger-Action Button, self switch B is on
(The Woodcutter Axe it is actually a weapon)
Quote
Conditional Branch:[Woodcutter Axe] is in Inventory, Include Equipment
  Text: This Tree could be cut to give me some Wood...
   Show Choice: [ok i will cut it, No i will do it later...]
    When [ok i will cut it]
    Control Variable [0051 Woodcutter Practice] = +1
    Conditional Branch:[0051 Woodcutter Practice] >= 25
      Control Variable [0050 Woodcutter Skill] = +1
      Else:
      Branch End:
    Control Variable [0041 Cutting a Tree] = Random no (1...5)
    Control Variable [0041 Cutting a Tree] + Variable [0050 Woodcutter Skill]
    Set Move Route: Player:
         Turn 90° Right
         Wait 30 frames
         Turn 90° Left
         Wait 30 frames
     Play SE: 'Slash 10' 80, 110
       Set Move Route: Player:
         Turn 90° Right
         Wait 30 frames
         Turn 90° Left
         Wait 30 frames
     Play SE: 'Slash 10' 80, 110
     Conditional Branch:[0041 Cutting a Tree] >= 6
      Control Variable [0052 Wood Gain] = Random no (1...5)
      Control Variable [0052 Wood Gain] + Variable [0050 Woodcutter Skill]
      Text: Good! I Chopped v\[0052] Trunks! Now i just need for the plant to grows
              again to cut more...
      Change Items: [Trunks] + Variable [0052 Wood Gain]
      Control Self Switch: B = off
      Control Self Switch: C = on
      Else:
      Play ME: 'Gag' ,100,75
      Show Balloon Icon: Player, Esclamation
      Text: Damn...i've broke my Axe!
      Change Weapon: [Woodcutter Axe] -1, Include Equipment
      Branch End:
    When: [no, ill do later]
    When Cancel:
    Branch End
  Else:
Branch End

Wow...almost done...

The last page of this event show a cutted trunk half-grow from terrain
Priority-Same as Player, Trigger-Action Button, self switch C is on

Quote
Label: Tree 1A
 Wait: 600 frames (About 10 seconds)
  Control Variable [0053 Trees Growt] = +1
  Conditional Branch:[0053 Tree Growt 1] >= 60 (so it grows in ten minutes)
  Control Variable [0053 Trees Growt] = -60
  Control Self Switch: C = off
  Control Self Switch: B = on
 Else:
  Jump to Label: Tree 1A
End Branch:

Thats all...but as for the bank, if i leave the place where the event is, it didnt grow at all!

Have you Experts some idea as to make the bank give interests and the trees growt if i'm away?

also i noticed that if i copy-past the tree event and call it something like Tree 2 and all the Label i modified in Tree 2, but still use the same Variable for all, Variable [0053 Trees Growt], they do growth, but after i cut them, the game freeze.
Also if i replace the event on the last page like this:

Quote
Label: Tree 1A
   Conditional Branch:[0053 Tree Growt 1] >= 60 (so it grows in ten minutes)
  Control Variable [0053 Trees Growt] = -60
  Control Self Switch: C = off
  Control Self Switch: B = on
 Else:
  Jump to Label: Tree 1A
End Branch:

in that case i have a common event called [Tree Grows] that start as Parallel and say just:
Quote

 Wait: 600 frames (About 10 seconds)
  Control Variable [0053 Trees Growt] = +1

Any idea? I know my event is a bit complex, and be aware that i'm italian so i have translated as best as i can the name of variables and text XD
I hope someone can help ^^ i'm a bit in truble eheheh


   
« Last Edit: September 08, 2011, 06:52:16 PM by fenicearcana »

**
Rep:
Level 66
RMRK Junior
The More i Try...the more i found i'm a Noob...
I've found a easy way for the plant, at least...using general switc and not self-switch, so i can call the growt of plants with a common event.
So just one problem i cannot solve...
If i'm away from the maps where bank and plant are, how i can set them to work properly? i need bank to cumulate money when i'm away and plant to grow.
Setting a Transparent parallel event on each single map of the game is the only solution?

Oh...for the plant... is just a minor change, but it work. And if you dont want all the plant to "spawn" at the same time, give them at least 10-12 seconds of difference in growing time.

Quote
Text: Did you wish to plant a Tree there Milord? It will cost you 2000 Gold.
    Show Choice: [yes, no,]
    When: [yes]
    Conditional Branch: Gold 2000 or more
     Text: Good Milord, now i will take care of the plant when tou are away.
             Come back some time later to see if it is ready to be used.
     Self Switch: A= on Control Switch: [0101: 1rst Tree Planted] = ON
     Change Gold: -2000
    Else: Text: Sorry Milord, you dont have enought money...
   Branch End
  When: [no]
  When Cancel:
Branch End

The second page self witch: A = ON replace with Switch: [0101: 1rst Tree Planted] = ON

Quote
Label: Tree 1
 Wait: 600 frames (About 10 seconds)
  Control Variable [0041: 1rst Tree Planted] = +1
  Conditional Branch:[0041: 1rst Tree Planted] >= 60 (so it grows in ten minutes)
  Control Variable [0041: 1rst Tree Planted] = 60
  Control Self Switch: A = off Control Switch:[0101: 1rst Tree Planted] = Off 
  Control Self Switch: B = on Control Switch: [0102: 1rst Tree Growed] = On
 Else:
  Jump to Label: Tree 1
End Branch:

For the 3rd page Self Switch B = on is no more used.
use instead: Switch: [0102: 1rst Tree Growed] = On
The only part we need to chenge here is this in Glowing Red:

Quote
      Text: Good! I Chopped v\[0052] Trunks! Now i just need for the plant to grows
              again to cut more...
      Change Items: [Trunks] + Variable [0052 Wood Gain]
      Control Self Switch: B = off
      Control Switch:[0102: 1rst Tree Growed] = Off

      Control Self Switch: C = on
      Control Switch:[0103: 1rst Tree Cutted] = On

      Else:
      Play ME: 'Gag' ,100,75

The last page well...erase all the commands, leave just the picture showing a cutted tree and use Switch:[0103: 1rst Tree Cutted] = On

Then you can make the common event and start it in parallel.
the common event is just as easy as this...

Quote
Label got it
    wait: 600 frames (10 seconds)
      Conditional Branch: Variable [0041: 1rst Tree Planted] = 60
      Control Variable: [0043: Growing 1rst Tree] = +1
         Conditional Branch: Variable [0043: Growing 1rst Tree] = 60
         Control Switch:[0102: 1rst Tree Growed] = On
         Control Switch:[0103: 1rst Tree Cutted] = Off
      Else
      Branch End
    Else
    Branch End

The boring part is add to the common event the entire list, with each his own switches, to avoid the game crash if you whant more than 1 growing tree XD

Well some ideas to upgrade this to use in each part of the game without ever need to paste the "call common event"?

Thanks for your time ^^

**
Rep: +0/-0Level 73
I cant see from here but I smell your fear
this is for the plant event if I understand what your trying to do is have the plant  to grow while the player is not on the map where it is planted if that is right then keep reading if not then dont bother reading anymore


The way you have your game check how long the plant is in the dirt happens on the map where it is planted which will only update on that map what you need is a parallel common event that handles that  im not very good at explain things clearly so i made a quick demo of how i did this

~~~~~~ http://www.mediafire.com/?bvm1aaxbdcm9nak ~~~~      if you play with the settings it might work for the bank event as well  hope this helps you
 

**
Rep:
Level 66
RMRK Junior
Yes Sir Reaven thats' it. Now i go try your test to see if i can get some idea of your way to handle it with "parallel process" .
I do use parallel process "Calling Common Event" but i dont know if it is possible to have one Parallel Process start, and then when you leave the map, it go on also if you go very far XD
if isnt possible, i need to make a parallel process calling the common event in each single map i wander in XD
Thanks anyway, i go right now to see your test ^^

**
Rep:
Level 66
RMRK Junior
Ohhh tested!
in your test you need to ask anytime you would like to plant a tree...
in my game, i need to plant it just one time, then i go away from map to do quests, things, and when i come back, i need the plant to have growt if time is right ^^
But the point is well taken! i see in your simply quest [thanks again, it was simplyer to figur out this way XD] that you plant the tree...thaen also if you change map, the event will go on without you XD that was my question, i wasnt sure if when you leaved the map, the parallel process was working also if you were away.
So that's it...a parallel process, started, and maked in loop like i had done, doesnt need to be restarted in each new map...
COOOOOL  :blizj:
Thanks Sir, you cleaned up my confused ideas ^^