Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

Click here to join us on IRC (#charas on irc.freenode.net)!



  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Kirby Hyper candy. Need help on the coding of event.
« previous next »
  • Print
Pages: [1]

Author Topic: Kirby Hyper candy. Need help on the coding of event.  (Read 3852 times)

Offline elementalhero76

  • Your Ad here!
  • Zealot
  • *
  • Posts: 612
  • The Writer of Light
    • Official Esgardum Wiki (locked)
Kirby Hyper candy. Need help on the coding of event.
« on: March 01, 2010, 09:03:11 PM »
I want to script a on the map effect where you become invincible and move faster than normal (even when dashing).

What I need to do is make it run for only 15 seconds (the length of the effect) and have it so terrain damage fails and enemy encounters are at 0%.

I need:
2 switches
a timer
and a couple of pages for the event.
a sprite (the Kirby hyper candy sprite I have already)

When the action key is pressed near the candy it is consumed and you get a status condition called Hyper.
On the field it will allow you to avoid all environmental effects and enemy encounters for the duration.
In battle, you're invincible for 5 turns. (That's the easy part which I done already.)

What happened:
When I tried this on my test map I'd slow down first and the event will not work.

What should happen:
The candy should activate (action key pressed) and disappear and you'd get a  15 second timer in which you'd run twice as fast and be able to avoid all damage tiles (damage flooring) and enemy encounters (This changes encounter rate to 0. They supposedly died in one hit.). After 15 seconds you return to normal walking speed and enemy encounter rate goes back to normal. The hyper status should be removed for battle reasons.

Now the coding I tried that doesn't work and needs to be fixed:

Code: [Select]
Page 1:
Sprite: Candy set to flicker/Continuous at 5 speed.
Trigger: no preconditions, action key
Layer: same layer as hero.

<> Switch Operation: [0012 Candy 1] ON
<> Switch Operation: [0013 Candy 2] OFF
<>

Page 2:
Sprite: Candy set to flicker/Continuous at 5 speed.
Trigger: Switch [0012 Candy 1] is ON, Parallel Process,
Layer: Same layer as hero.

<> Play BGM: Invincible
<> Change Condition: Entire Party Hyper Inflict
<> Move Event: Hero, Increase Move Speed
<> Switch Operation: [0013 Candy 2] OFF (To make a simple loop later on or to use this event on other maps, unless variables will work better.)
<> Timer Operation: Set 00M 15S

Page 3:
Sprite: none (map transparency/background tile)
Trigger: None, Parallel Process (see code)
Layer: Above hero.

<> Branch if Timer 1 is 0M 15S or more
   <>Timer 1 Operation: Start Timer
   <>
:Else Handler
   <>
:End
<>

Page 4:
Sprite: none (map transparency/background tile)
Trigger: None, Parallel Process (see code)
Layer: Above hero.

<> Branch if Timer 1 is 0M 00S or less/equal
   <> Change Condition: Entire Party Hyper Remove
   <> Move Event: Hero, Decrease Move Speed
   <> Play BGM: 27_-_GRASS
   <> Switch Operation: [0013 Candy 2] ON
   <> Switch Operation: [0012 Candy 1] OFF
   <>
:Else Handler
   <>
:End
<>

Page 5:
Sprite: Candy set to flicker/Continuous at 5 speed.
Trigger: Switch [0013 Candy 2] ON , Parallel process
Layer: same layer as hero.

<> Switch Operation: [0012 Candy 1] ON

Somewhere in the coding I need to add terrain changing functions and an encounter rate handler after I get this fixed.
I need help on this ASAP, I am going to add it to my game very soon.
« Last Edit: March 02, 2010, 04:46:15 PM by elementalhero76 »
Logged
Retired RM2k3 user. Using VS2015 Pro.
Discord:LightWriterOfLegend2016#5786

Esgardum Legends wiki:
Dead. Need to pay $100/yr to stay open and editable. Debating if I want to or not.

Esgardum Series status:
RPG: World building and planning stage
Books: Still on book 1: The Four Sinners

Offline elementalhero76

  • Your Ad here!
  • Zealot
  • *
  • Posts: 612
  • The Writer of Light
    • Official Esgardum Wiki (locked)
Re: Kirby Hyper candy. Need help on the coding of event.
« Reply #1 on: March 02, 2010, 04:46:49 PM »
Bump. I know Osmose knows how to script this. Timers suck.
Logged
Retired RM2k3 user. Using VS2015 Pro.
Discord:LightWriterOfLegend2016#5786

Esgardum Legends wiki:
Dead. Need to pay $100/yr to stay open and editable. Debating if I want to or not.

Esgardum Series status:
RPG: World building and planning stage
Books: Still on book 1: The Four Sinners

Offline Prpl_Mage

  • Administrator
  • Sage
  • *
  • Posts: 7,645
  • The Administrator Mage
    • Check out our itch website
Re: Kirby Hyper candy. Need help on the coding of event.
« Reply #2 on: March 02, 2010, 05:23:40 PM »
Just spontaneously from looking at the code I think I see two issues.

1. The part were movement speed is increased is probably looping over and over. You have nothing that stops it from running. Therefore the movement speed is increased to the point that it's slow...

2. Don't have 5 pages on the same event. I'm pretty sure that rpgm only can run 1 page at a time of an event. Create another event that does everything with the timer and such.
Logged
Cool RPGM Project!
Sprite till you die

Oh my god, this was ...10 years ago...

Offline elementalhero76

  • Your Ad here!
  • Zealot
  • *
  • Posts: 612
  • The Writer of Light
    • Official Esgardum Wiki (locked)
Re: Kirby Hyper candy. Need help on the coding of event.
« Reply #3 on: March 02, 2010, 05:27:57 PM »
Any sample code I can build on? From what I have here it doesn't work though, I have an idea but nothings coming to mind. I'll have to get back to this later today since I have a class today.
Logged
Retired RM2k3 user. Using VS2015 Pro.
Discord:LightWriterOfLegend2016#5786

Esgardum Legends wiki:
Dead. Need to pay $100/yr to stay open and editable. Debating if I want to or not.

Esgardum Series status:
RPG: World building and planning stage
Books: Still on book 1: The Four Sinners

Offline Prpl_Mage

  • Administrator
  • Sage
  • *
  • Posts: 7,645
  • The Administrator Mage
    • Check out our itch website
Re: Kirby Hyper candy. Need help on the coding of event.
« Reply #4 on: March 03, 2010, 02:05:47 AM »
dum dum dum dum.

So yeah. Stuff and stuff let's get this cookin'.

What you'll need then.
1 the event which is on fact the "hyper candy"
2 Variable. call it [hypercandy] or something like that.
3 Events. I'd say 1 will be enough.

----------------------------
So, the hero walks up to this candy(event) and eat it (action key).
The event responds by increasing the value of the variable by 1.
Then it kills itself(erase event).

The event on the side is a parallel process but a precondition : varaible[hypercandy]=1.
The event increases the hero speed by 1.
Changes the encounter rate to 0.
And change graphics(?).
play music(?).
Start timer
then it increases itself(variable) by 1.
-------_______________-----------------
         Second page
parrallell process. Precondition: variable [hypercandy]=2, timer = whateveryouwantthetimertobe.
Decrease hero's movement speed.
Restore the encounter rate
Change the graphics.
Stop the music.
End timer.
Set variable[hypercandy] to 0.

-------------------------------------

Erhm. This should include everything that's needed.
You pick the candy. Varaible increases.
When the variable is one: your side event will "awaken" and add all the "stats" for the "hyper mode" thingy and then makes the varaible = 2.(it won't play over and over again this way.) And you also started your timer.
The second page of this event will not oly check so the varaible is right, it will also check that the time of the hyper mode have passed. If both are true : you revert everything you did on the first page. And then turns the variable back to 0 so that none of the events will react to it.

And that's probably it. Give it a try and let me know if I suck.
Logged
Cool RPGM Project!
Sprite till you die

Oh my god, this was ...10 years ago...

Offline elementalhero76

  • Your Ad here!
  • Zealot
  • *
  • Posts: 612
  • The Writer of Light
    • Official Esgardum Wiki (locked)
Re: Kirby Hyper candy. Need help on the coding of event.
« Reply #5 on: March 05, 2010, 04:36:06 PM »
Sorry for not being here to respond.

Yeah it failed as much as my own script.
If I did it with the timer ending in the second page, the event ends with no effects in just 1 second.

If I throw in a conditional branch on page one of the effect event to check for timer to be 0 to add 1 to hypercandy, timer doesn't run and just freezes at 15 seconds. and if I manually manage the variable using F9-f10,
the event clears as it should, but I run much faster than I wanted even after running my unbroken dash script with the shift key.

The Dash ability does not work in tandem for some reason when this one is running but with one of my earlier scripts it did, thereby running 4 times as fast then returning to normal speed after. (The Dash script is a toggle set to shift key as variable 7.)

If I can get this to work, Is it possible to run two or more variables at once? I know its possible I done before with my in game clock and the day/night cycle and the dash system all at once on a much older long gone project.

Also: Maybe instead of a timer have a variable count up to 15?
Logged
Retired RM2k3 user. Using VS2015 Pro.
Discord:LightWriterOfLegend2016#5786

Esgardum Legends wiki:
Dead. Need to pay $100/yr to stay open and editable. Debating if I want to or not.

Esgardum Series status:
RPG: World building and planning stage
Books: Still on book 1: The Four Sinners

Offline Rowan

  • ...
  • Zealot
  • *
  • Posts: 601
  • Charas arbitrary gay black guy.
Re: Kirby Hyper candy. Need help on the coding of event.
« Reply #6 on: March 09, 2010, 05:04:05 AM »
Examine 1 of your script:
Quick question, are all of these pages within the same eventID or no? If yes, then I can see why it's not working.

Examine 2 of your script:
You have some SERIOUSLY bad parallel processing going on which is overriding the lower tiered pages (i.e the higher number pages). If I were you I would drop most of the Parallels and SWITCH triggers and start focusing on the CALL EVENT command to activate your scripts.

Examine 3 of your script:
I'm picturing a solution in my head.

You'll need 3 Events::
         The second and third events MUST be a common event if you want to do this on all maps.
2+ Switches::
         You'll need more switches if you plan to create more candy.

EVENT 1: The Candy itself :: 2 pages
--Page 1: Shows the candy. Activates the event and continues it in Common Event 1.
--Page 2: No Candy.

COMMENT EVENT 1:
Sets the Timer, Song, and Movement and activates the 2nd event VIA Switch. Once done it recalls back to it's original Candy event and shuts itself off.

COMMENT EVENT 2:
A brand new "Event". Checks the Timer VIA looping. When conditions are met it resets everything back to it's original state, and then proceeds to shut itself off.

EVENT 1
Code: [Select]
PAGE 1::
Sprite: Candy set to flicker/Continuous at 5 speed.
Trigger: Nothing, action key
Layer: same layer as hero.

<> Memorize BGM
<> CALL EVENT: COMMON EVENT 1
<> Switch [0001]: ON

PAGE 2::
Sprite: Nothing
Trigger: Switch [0001] is ON, action key
Layer: below hero

<> NO CODE


COMMON EVENT 1
Code: [Select]
Trigger: Call

<> Timer Operation: Set 00M 15S
<> Play BGM: Invincible
<> Change Condition: Entire Party Hyper Inflict
<> Move Event: Hero, Increase Move Speed
<> Timer 1 Operation: Start Timer
<> SWITCH [0002]: ON

COMMON EVENT 2
Code: [Select]
Trigger: SWITCH [0002], Parallel Process

<> Branch if Timer 1 is 0M 00S or less/equal
   <> Change Condition: Entire Party Hyper Remove
   <> Move Event: Hero, Decrease Move Speed
   <> Play Memorized BGM
   <> SWITCH [0002]: OFF
   <> End Event Processing
   <>
:End
<>

NOTE: Im not sure if this works lol.



« Last Edit: March 09, 2010, 05:14:25 AM by Rowan »
Logged


  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Kirby Hyper candy. Need help on the coding of event.
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum