Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> decrease varibale to 0 in perks of 1 per sec
johnny55
post Apr 28 2011, 11:19 AM
Post #1


Level 1
Group Icon

Group: Member
Posts: 5
Type: None
RM Skill: Undisclosed




Heys, my idea is this

when player touch on a event, it adds +10 to variable 5 and it automaticly start counting down til reach 0 (where then a action starts

i tried it with events, but problem was, each time i step on the event it would add +10 and +10 and +10 etc, i tried using self-switches to try cancel it but no luck

atm i tried this

Method 1: (it keep adding +10 for as many times i step on it)
Page 1] Player Touch > set route
script: $game_variables[5] -= 1
wait 20
script: $game_variables[5] -= 1
wait 20
script: $game_variables[5] -= 1
wait 20
script: $game_variables[5] -= 1
wait 20
script: $game_variables[5] -= 1
wait 20
script: $game_variables[5] -= 1
wait 20
script: $game_variables[5] -= 1
wait 20
script: $game_variables[5] -= 1
wait 20
script: $game_variables[5] -= 1
wait 20
script: $game_variables[5] -= 1
script: $game_map.refresh
wait 20
script: SELF_A = [1, 1, A']
script: $game_self_switches[SELF_A] == true

Page 2] self switch A is ON
nothing, so it be disabledd


Method 2 (it reduces from 10 to 0 in 1 second ....)
Page 1] Player touch > self_switch A (so only be triggered once)
Page 2] self switch A is ON, Paralel (so it starts automaticly without lag) set route
script: $game_variables[5] -= 1
wait 20
script: $game_variables[5] -= 1
wait 20
script: $game_variables[5] -= 1
wait 20
script: $game_variables[5] -= 1
wait 20
script: $game_variables[5] -= 1
wait 20
script: $game_variables[5] -= 1
wait 20
script: $game_variables[5] -= 1
wait 20
script: $game_variables[5] -= 1
wait 20
script: $game_variables[5] -= 1
wait 20
script: $game_variables[5] -= 1
script: $game_map.refresh
wait 20
script: SELF_B = [1, 1, B']
script: $game_self_switches[SELF_B] == true
Page 3] self switch B is on
nothing

i think you able to see my idea, and i came to conclusion, this wont be able do though event (unless if i be wrong), so i'd like a lil help to convert this inito script

because if i do it in a 'normal' form would be somethiing like
if $game_variables[5] >= 1
$game_variables[5] -= 1
end

it would automaticly decrease the variable by 1 til reach 0 (wich isnt higher or equal to 1), but i need it to only drop 1 point PER second, and if im not mistaken the 'Wait' code on script, makes the entire game to 'wait' not just the variable

thanks

This post has been edited by johnny55: Apr 28 2011, 11:20 AM
Go to the top of the page
 
+Quote Post
   
Night_Runner
post Apr 29 2011, 12:26 AM
Post #2


Level 50
Group Icon

Group: +Gold Member
Posts: 1,522
Type: Scripter
RM Skill: Undisclosed




I'm confused. Why are you using set route?


How I'd do it




__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   
johnny55
post Apr 29 2011, 05:03 AM
Post #3


Level 1
Group Icon

Group: Member
Posts: 5
Type: None
RM Skill: Undisclosed




reason i was using set route was to prevent the game to hang when using the 'wait', but your method works smile.gif

wont need to convert it to script then, thanks smile.gif
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 21st May 2013 - 08:36 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker