New account registration is temporarily disabled.

RPG MAKER 2003/ HOW WOULD I DO THIS IN MY GAME?

Posts

Pages: 1
I want to make an event where if you have an item (HM04 Strength) or a Pokémon who knows Strength (a Skill), you can touch (not press Spacebar to interact with) a rock and push it in the direction you push it in.

Here's the link to the move itself
http://bulbapedia.bulbagarden.net/wiki/Strength_(move)
Common Event, Parallel Process

If Possesses Item
Switch Can Push On
Else
If Actor Knows Strength
Switch Can Push On
Else
Switch Can Push Off
End If
End If

Event to Be Pushed
Have a page that's activated by the Can Push switch being on, have it when you touch the event and the player is facing the right direction, have the event move.
If you want it so that you can push more than one boulder without reapplying Strength (like how it lasts while you're on the map or can wear off after a while) you can make it add a state to you and then use the event to check for that state. This way you can have it timed to wear off after a certain amount of steps taken or use a remove state command every time you teleport to a new map.
Huh? You don't even need the Parallel Process (or for that matter, a switch). Just make it part of the event in question, like this:

If Possesses Item
(ThisEvent, away from hero)
Else
If Actor Knows Strength
(ThisEvent, away from hero)
Else
(Blank)
End
End

Put this in the event, and make it Hero Touch instead of Action Key.
Thanks, guys.

EDIT: Would the same work for Rock Smash (a similar move requiring either an item or a skill that shatters rocks)?
Link: http://bulbapedia.bulbagarden.net/wiki/Rock_Smash_(move)
author=bulmabriefs144
Huh? You don't even need the Parallel Process (or for that matter, a switch). Just make it part of the event in question, like this:

If Possesses Item
(ThisEvent, away from hero)
Else
If Actor Knows Strength
(ThisEvent, away from hero)
Else
(Blank)
End
End

Put this in the event, and make it Hero Touch instead of Action Key.

Look up the DRY method; a common event running as a PP satisfies the conditions of DRY programming, which is pretty much how you should be trying to do as much code as possible. Saves you having to go back and fix every single related event if you decide to change the conditions under which you can push that rock and reduces the amount of overhead.

Also a note, should probably toss a Wait 0.0 before or after the conditional statement I put up earlier - it'll ease the burden of the process on the engine.
Nightowl
Remember when I actually used to make games? Me neither.
1577
author=Danny
Thanks, guys.

EDIT: Would the same work for Rock Smash (a similar move requiring either an item or a skill that shatters rocks)?
Link: http://bulbapedia.bulbagarden.net/wiki/Rock_Smash_(move)
Just make the smashable rock check if the player has Rock Smash.
Vague, but I suppose you know how it's done after that rock pushing mumbojumbo.
Also, I'm having another problem. That event that says "Move Away From Hero" sometimes pushes the rock in a random direction. For example, if I push the boulder up, it'll move left or right. This has been a problem for me this whole time I've been trying to make this event. HELP!!!
You could make it a fork, like this:

If Hero faces up -> Move event up
-If Hero faces right -> Move event right
--If Hero faces left -> Move event left
---If Hero faces down -> Move event down
author=Travio
author=bulmabriefs144
Huh? You don't even need the Parallel Process (or for that matter, a switch). Just make it part of the event in question, like this:

If Possesses Item
(ThisEvent, away from hero)
Else
If Actor Knows Strength
(ThisEvent, away from hero)
Else
(Blank)
End
End

Put this in the event, and make it Hero Touch instead of Action Key.
Look up the DRY method; a common event running as a PP satisfies the conditions of DRY programming, which is pretty much how you should be trying to do as much code as possible. Saves you having to go back and fix every single related event if you decide to change the conditions under which you can push that rock and reduces the amount of overhead.

Also a note, should probably toss a Wait 0.0 before or after the conditional statement I put up earlier - it'll ease the burden of the process on the engine.

You are totally right about the dry coding bit, however I would do it somewhat differently to avoid lag issues. I would advice to call a common event, so you are able to change the code if there is an bug in it, but still avoid lag issues due a constantly looping parallel event (yes a 0,0 wait would also work, unless you have dozens of these running at the same time (I would probably stack all those parrallels together, but w/e :p).

So my advice:


Create an event:
Give it the boulder graphic.
Make it hero touch.
In the code you put this:

<>call common event (boulder push)

Now go to your database.
Go to the common event tab.
Place this code in the common event slot you created earlier:

<>If Possesses Item
<><>
<>Else
<><>If Actor Knows Strength
<><><>
<><>Else
<><><>Jump to label 1
<><>end
<>End
<>If Hero faces up
<><>Move event up
<>end
<>If Hero faces right
<><>Move event right
<>end
<>If Hero faces left
<><>Move event left
<>end
<>If Hero faces down
<><>Move event down
<>end
<>Label 1

Btw, Bulmabriefs, why leave an empty else case if you don't do anything with it? As in how you put an else case after checking if the skill is aviable or not. People commenting about my two empty else cases: it would take an extra label if I wouldn't do it this way.
author=Danny
Also, I'm having another problem. That event that says "Move Away From Hero" sometimes pushes the rock in a random direction. For example, if I push the boulder up, it'll move left or right. This has been a problem for me this whole time I've been trying to make this event. HELP!!!


that can occur if you activate the move away from hero command, and then you yourself move. the direction that is 'away from you' is different.

i think it also happens if you are trying to move something away from hero but it hits a wall and you don't have it on 'ignore impossible moves'. its still waiting to move away from hero and when you move, it can finally do that.

if it's doing that but you are not moving, well...i dunno.
Pages: 1