halrawk 11 Posted October 7, 2015 (edited) You skipped step 1, you'll want to put that event into "common events" in your database. Common events can happen anywhere in game, once triggered, they aren't tied to a single map. Edited October 7, 2015 by halrawk Share this post Link to post Share on other sites
Ariel Schnee 7 Posted October 9, 2015 (edited) Actually I found this works best : --- 1. In "Database", create a "Common Event" called "Apple". 2. In the "content" of this event, open up the "Event Commands" (double clicking a line) and go to the 3rd tab. 3. Under "Advanced", click on "Script". 4. Copy and paste "$survival_v[2] += 20" into the textbox. This means that whenever this function is called, it will add 20 to the value of the food bar. 5. Now go to "Items" and create an "Apple" item. 6. Set the price, description etc to your liking. 7. In the right side of the menu, under "Effects", double click on a space. 8. Under "Other" tab, click on "Common Event" and select the "Apple" you just created in the previous steps. 9. Repeat steps 1-8 changing "Apple" to "Milk" and "v[2]" to "v[3]" to affect your water bar instead. --- Edited October 9, 2015 by Nightgazer Starlight 1 Share this post Link to post Share on other sites
kaarnij 0 Posted October 15, 2015 I'm having trouble with this, this is what I've done so far http://www.rpgmakervxace.net/topic/35095-survival-system-by-apellonyx/ Share this post Link to post Share on other sites
kaarnij 0 Posted October 19, 2015 Anyone that could help me, would much be appreciated thx. I get a error on line 576 if the script http://www.rpgmakervxace.net/topic/35095-survival-system-by-apellonyx/ Anyone that could help me, would much be appreciated thx. I get a error on line 576 if the script http://www.rpgmakervxace.net/topic/35095-survival-system-by-apellonyx/ Share this post Link to post Share on other sites
kaarnij 0 Posted October 27, 2015 (edited) nvm my last 2 post i figured it out but now I'm getting a new error and must have something to do with the event i made that turns the script on, i think i may of made the event wrong and everything works well until i try to eat or drink the items i made for this script.The error is > Script 'Game_Interpreter' line 1411: SyntaxError Heres a pic of the error and event i made to turn on the scriptand other things I've donei figured it out, i stupidly had @>Script: Script: $survival_v[3] +=15 in the common event, i must of copied the extra Script in by mistake Edited November 16, 2015 by Rikifive Merged double post Share this post Link to post Share on other sites
MoonShadow 2 Posted November 16, 2015 Hello everyone, how do I show the bars always even out of the menu? Share this post Link to post Share on other sites
Rikifive 3,411 Posted November 16, 2015 @kaarnij I have merged your posts. Please avoid double posting unless it's absolutely necessary. Thank you. (= @MoonShadow Menu and outside-the-menu are two different scenes, so you have to draw the window again in the Map scene (outside the menu) Try this: class Scene_Map < Scene_Base alias :start_up :start def start start_up create_survival_window end def create_survival_window barcount = 0 if $survival_s[1] == true barcount += 1 if $survival_s[6] == false || $survival_v[1] < Anyx::LIFEHIDEVAL end # if $survival_s[1] == true if $survival_s[2] == true barcount += 1 if $survival_s[7] == false || $survival_v[2] < Anyx::FOODHIDEVAL end # if $survival_s[2] == true if $survival_s[3] == true barcount += 1 if $survival_s[8] == false || $survival_v[3] < Anyx::WATERHIDEVAL end # if $survival_s[3] == true if $survival_s[4] == true barcount += 1 if $survival_s[9] == false || $survival_v[4] < Anyx::RESTHIDEVAL end # if $survival_s[4] == true if $survival_s[5] == true barcount += 1 if $survival_s[10] == false || $survival_v[5] > Anyx::TOXINHIDEVAL end # if $survival_s[5] == true @survival_window = Window_Survival.new @survival_window.contents.draw_text(0, 0, 500, 24, " Survival System") if barcount == 0 barcount -= 1 if barcount >= 1 survivalwinypos = Anyx::WINYPOS - (24 * barcount) @survival_window.x = Anyx::WINXPOS @survival_window.y = survivalwinypos @survival_window.opacity = Anyx::WINOPACITY end # def create_survival_window end # class Scene_Map < Scene_Base Paste below the Survival Script. Share this post Link to post Share on other sites
MoonShadow 2 Posted November 16, 2015 @MoonShadow Menu and outside-the-menu are two different scenes, so you have to draw the window again in the Map scene (outside the menu) Try this: class Scene_Map < Scene_Base alias :start_up :start def start start_up create_survival_window end def create_survival_window barcount = 0 if $survival_s[1] == true barcount += 1 if $survival_s[6] == false || $survival_v[1] < Anyx::LIFEHIDEVAL end # if $survival_s[1] == true if $survival_s[2] == true barcount += 1 if $survival_s[7] == false || $survival_v[2] < Anyx::FOODHIDEVAL end # if $survival_s[2] == true if $survival_s[3] == true barcount += 1 if $survival_s[8] == false || $survival_v[3] < Anyx::WATERHIDEVAL end # if $survival_s[3] == true if $survival_s[4] == true barcount += 1 if $survival_s[9] == false || $survival_v[4] < Anyx::RESTHIDEVAL end # if $survival_s[4] == true if $survival_s[5] == true barcount += 1 if $survival_s[10] == false || $survival_v[5] > Anyx::TOXINHIDEVAL end # if $survival_s[5] == true @survival_window = Window_Survival.new @survival_window.contents.draw_text(0, 0, 500, 24, " Survival System") if barcount == 0 barcount -= 1 if barcount >= 1 survivalwinypos = Anyx::WINYPOS - (24 * barcount) @survival_window.x = Anyx::WINXPOS @survival_window.y = survivalwinypos @survival_window.opacity = Anyx::WINOPACITY end # def create_survival_window end # class Scene_Map < Scene_Base Paste below the Survival Script. It works ok but updates only if I open the menu. Share this post Link to post Share on other sites
Rikifive 3,411 Posted November 16, 2015 I'm really not sure how the script/window will react to this, since I didn't make that script and I'm not exactly sure how it was written, so test that and tell me what happens. The window will be refreshed each 2 seconds. class Scene_Map < Scene_Base alias :start_up :start def start start_up create_survival_window end def create_survival_window barcount = 0 if $survival_s[1] == true barcount += 1 if $survival_s[6] == false || $survival_v[1] < Anyx::LIFEHIDEVAL end # if $survival_s[1] == true if $survival_s[2] == true barcount += 1 if $survival_s[7] == false || $survival_v[2] < Anyx::FOODHIDEVAL end # if $survival_s[2] == true if $survival_s[3] == true barcount += 1 if $survival_s[8] == false || $survival_v[3] < Anyx::WATERHIDEVAL end # if $survival_s[3] == true if $survival_s[4] == true barcount += 1 if $survival_s[9] == false || $survival_v[4] < Anyx::RESTHIDEVAL end # if $survival_s[4] == true if $survival_s[5] == true barcount += 1 if $survival_s[10] == false || $survival_v[5] > Anyx::TOXINHIDEVAL end # if $survival_s[5] == true @survival_window = Window_Survival.new @survival_window.contents.draw_text(0, 0, 500, 24, " Survival System") if barcount == 0 barcount -= 1 if barcount >= 1 survivalwinypos = Anyx::WINYPOS - (24 * barcount) @survival_window.x = Anyx::WINXPOS @survival_window.y = survivalwinypos @survival_window.opacity = Anyx::WINOPACITY @refresh_timer = 120 end # def create_survival_window alias :map_update_up :update def update map_update_up @refresh_timer = @refresh_timer > 0 ? @refresh_timer - 1 : 120 @survival_window.refresh if @refresh_timer == 0 end end # class Scene_Map < Scene_Base Replace the previous snippet I gave you. Share this post Link to post Share on other sites
MoonShadow 2 Posted November 16, 2015 ok it seems to work. Thanks for the help Share this post Link to post Share on other sites
Rikifive 3,411 Posted November 16, 2015 Glad could help! (= If you want to make the window update faster, then change two values: (...) @refresh_timer = 120 <<< THIS /\/\/\/\/\/\/\\/\/\/\/\/\/\/\\/\//\\/\/\/ end # def create_survival_window alias :map_update_up :update def update map_update_up @refresh_timer = @refresh_timer > 0 ? @refresh_timer - 1 : 120 <<< AND THIS \//\/\/\/\/\//\\/\/\/ @survival_window.refresh if @refresh_timer == 0 end 120 is 120 frames ~ game runs at 60 FPS (unless it runs horrible on some PC's ( ͡° ͜ʖ ͡°)) so it gives 2 seconds. Replace these two to for example 30 and it will update the window each 0.5 second. Good luck! (= 1 Share this post Link to post Share on other sites
MoonShadow 2 Posted November 16, 2015 OK understood. You can disable the stamina if hunger and thirst less than half? Share this post Link to post Share on other sites
Rikifive 3,411 Posted November 16, 2015 What exactly do you mean? Turning off the display or generally disabling it? Share this post Link to post Share on other sites
MoonShadow 2 Posted November 16, 2015 basically if the bars of hunger and thirst down to a certain level you can not use more sprint (shift) Share this post Link to post Share on other sites
Rikifive 3,411 Posted November 16, 2015 I'm really not sure and can't test, since I don't have prepared things, but try this and tell me what happens. (Paste below scripts) class Game_Player < Game_Character def dash? return false if @move_route_forcing return false if $game_map.disable_dash? return false if vehicle return Input.press?(:A) && $survival_v[2] >= 50 && $survival_v[3] >= 50 end end 1 Share this post Link to post Share on other sites
MoonShadow 2 Posted November 16, 2015 It works. Great! Share this post Link to post Share on other sites
Rikifive 3,411 Posted November 16, 2015 YAY! Glad could help! =3 You can edit these: && $survival_v[2] >= 50 && $survival_v[3] >= 50 [2] is food and [3] is water. They are listed here (in the survival script): def self.create_survival_commands $survival_v = Survival_Variables.new $survival_s = Survival_Switches.new $survival_v[1] = LIFEINIT $survival_v[6] = LIFERATE $survival_s[1] = LIFEENABLE $survival_s[6] = LIFEHIDE $survival_v[2] = FOODINIT # this line $survival_v[7] = FOODRATE $survival_s[2] = FOODENABLE $survival_s[7] = FOODHIDE $survival_v[3] = WATERINIT # and that line $survival_v[8] = WATERRATE $survival_s[3] = WATERENABLE $survival_s[8] = WATERHIDE $survival_v[4] = RESTINIT $survival_v[9] = RESTRATE $survival_s[4] = RESTENABLE $survival_s[9] = RESTHIDE $survival_v[5] = TOXININIT $survival_v[10] = TOXINRATE $survival_s[5] = TOXINENABLE $survival_s[10] = TOXINHIDE end # def self.create_survival_commands You can change the values (50) to other to fit your needs. (= 1 Share this post Link to post Share on other sites
TekZappa 0 Posted November 28, 2015 (edited) Hello, im just curious if it is possible to put the "Survival window" on the main screen and not on main menu, i know i can adjust the position on the menu but i would prefer to have it on main screen. Thank you. Nevermind, there is an answer to it on other reply. sorry Most scripts are not "plug and play" especially if it's gameplay related. Are you sure you did step 10-12 properly? THAT is how you ACTIVATE the script. Probably the only way... Uh...I forgot to mention something very important. When you customize any event, MAKE SURE you check the "Trigger". Set it to "Parallel Process". Default is "Action Button". I shall edit that post now. I think this is what you're missing. Oh and, I've fixed the problem I had (where if the value reached the "exceed" value, it stops working). It's a simple if statement if anyone wants it. Just have to know where to put it lol. I *can* post a script but since it's not mine, there are copyright problems so...yea....... Hi, im having same issue when i exceed food value, did you make a conditional branch in common events("apple effect") ? that you can only replenish food if youre food is >=99 ? Edited November 29, 2015 by Rikifive Merged double post Share this post Link to post Share on other sites
Rikifive 3,411 Posted November 29, 2015 @TekZappa I have merged your posts. (= Share this post Link to post Share on other sites
Dymdez 77 Posted December 2, 2015 Rikifive thank you so much for the support you've given to this thread, I've been following it for quite some time and you're really helping quite a lot. 1 Share this post Link to post Share on other sites
MoonShadow 2 Posted February 28, 2016 hello, if I use the script for food and water for example. $survival_v[2] =+100 and I already 40% my hunger bar will reach 140%. How do I get her up to 100% even using values that surpass it? Share this post Link to post Share on other sites
Rikifive 3,411 Posted February 28, 2016 Do you mean not getting past the limit? Then try this: $survival_v[2] = [($survival_v[2] + 100),100].min 1 Share this post Link to post Share on other sites
MoonShadow 2 Posted February 28, 2016 ok I tried it and it works. Thank you! 1 Share this post Link to post Share on other sites
MoonShadow 2 Posted March 9, 2017 as you can do to pop up the values of hunger, thirst and rest in a game when down below 15? Share this post Link to post Share on other sites