Home
Help
Search
Calendar
Login
Register
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
New forum theme up and running!
Charas-Project
»
Game Creation
»
Requests
»
Tutorials
»
Crosshair
« previous
next »
Print
Pages: [
1
]
Author
Topic: Crosshair (Read 4708 times)
ThexXtremeXx
Hey.
Exemplar
Posts: 1,007
Dum.. badum.
Crosshair
«
on:
November 03, 2008, 10:09:47 PM »
I want to make a crosshair that stays the same amount of space away from the hero but can move any help?
Logged
DragonBlaze
A Wild DB Appeared!
Royal
Posts: 3,329
Re: Crosshair
«
Reply #1 on:
November 03, 2008, 10:37:14 PM »
Is this crosshair a picture or charset? And will it rotate a full 360 degrees or will it just be displayed in front of the hero in whatever direction he is facing?
Logged
Hell Yeah! Just recovered all my old rm2k/3 games from my 10 year old, broken laptop hard drive that had been formatted and had a new OS installed on it. Oh, and I did all of this from my phone. WIN
ThexXtremeXx
Hey.
Exemplar
Posts: 1,007
Dum.. badum.
Re: Crosshair
«
Reply #2 on:
November 03, 2008, 11:22:20 PM »
charset/whatever direction he is facing
Logged
DragonBlaze
A Wild DB Appeared!
Royal
Posts: 3,329
Re: Crosshair
«
Reply #3 on:
November 03, 2008, 11:45:50 PM »
Ok, hmm crap I don't have rpg maker on my computer, but I'll do the best I can.
First off, put a crosshair event on every map, give it the graphic of the crosshair. Make it a parallel process event. Give it the "above hero" attribute, and give a custom move patern of "passability mode" or "phasing on" whatever its called.
In that event, put a .0 wait at the start.
Record the x and y possitions.
Do four conditional branches (one for each of the dirrections the hero is facing. )
if up, subtract some from the hero y (amount is up to you).
Use the command "change event location" and select the crosshair, and use the x and y.
For the other conditional branches, just add or subtract to the x and y to line it up right.
Then just set it up so that the crosshair event only changes its location of the hero changes his direction (do this by recording the dirrection the hero was in, then check it against the hero's current dirrection (done with a conditional branch)).
Then just move the crosshair with the hero. (Done by four conditional branches for key pressed, if key is down, move the crosshair down, ect)
I hope thats enough of the concept to get you started
Logged
Hell Yeah! Just recovered all my old rm2k/3 games from my 10 year old, broken laptop hard drive that had been formatted and had a new OS installed on it. Oh, and I did all of this from my phone. WIN
Desimodontidae
Registered July 13, 2004, 10:41:19 AM (+1692 post counts)
Agent
Posts: 892
ghost host
Re: Crosshair
«
Reply #4 on:
November 03, 2008, 11:51:50 PM »
Yeah it'll probably take a bit of playing around to get right, though. Actually, that would probably make for a decent flashlight code too, DB. Of course probably using pictures instead of a charset, but you can use the same principle.
Logged
My MGS3 main character sprites
ThexXtremeXx
Hey.
Exemplar
Posts: 1,007
Dum.. badum.
Re: Crosshair
«
Reply #5 on:
November 03, 2008, 11:55:55 PM »
well, i under stood the first part but then i got lost,but I'll try it anyway, thanks!
Logged
DragonBlaze
A Wild DB Appeared!
Royal
Posts: 3,329
Re: Crosshair
«
Reply #6 on:
November 04, 2008, 12:05:52 AM »
make something like this
wait 0.0
variable [hero x position] = hero x position
variable [hero y position] = hero y position
variable[hero dirrection] = hero facing
if [hero dirrection] does not equal [old dirrection]
if (hero is facing up)
[hero y position] - 5
Change event location (to [hero x position] and [hero y position]
[old dirrection] = up
END if
if (hero is facing down)
[hero y position] + 5
Change event location (to [hero x position] and [hero y position]
[old dirrection] = down
END if
(do the left and right ifs too)
END if
Key input process
if (left pressed)
move crosshair left
END if
if (right pressed)
move crosshair right
END if
do the other two ifs for the left and right keys
Logged
Hell Yeah! Just recovered all my old rm2k/3 games from my 10 year old, broken laptop hard drive that had been formatted and had a new OS installed on it. Oh, and I did all of this from my phone. WIN
ThexXtremeXx
Hey.
Exemplar
Posts: 1,007
Dum.. badum.
Re: Crosshair
«
Reply #7 on:
November 27, 2008, 05:44:08 PM »
doesnt work. well atleast you tried to help.
Logged
Print
Pages: [
1
]
« previous
next »
Charas-Project
»
Game Creation
»
Requests
»
Tutorials
»
Crosshair