View previous topic :: View next topic |
Author |
Message |
adlingtont
Joined: 29 Aug 2006 Posts: 3
|
Posted: Wed Jul 16, 2008 12:52 pm Post subject: Portal |
|
|
I'm sure many of you have played the puzzle game 'Portal'.
What I'm hoping for is a way to make portal within OHRRPGCE. I have the idea of using portals which would appear on the next 'wall' in front of the player when a specific button (keyboard/mouse) is pressed.
I'm no good at scripting - I really should learn.
Any way the requirement for this code (if possible) are:
When button (keyboard/mouse) 1 is pressed portal 1 appears on the next wall in front of the player
When button (keyboard/mouse) 2 in pressed portal 2 appears on the next wall in front of the player
The above to can be combined if needed (preferred not) so it toggles between the two (portal 1 then portal 2 etc)
The two portals are only connected to each other in both directions (like doors)
If portal 1 is 'open' and button 1 is pressed and a 2nd portal 1 can be created then previous portal 1 closes (same with portal 2)
If player moves away from map then portals 1 and 2 close
Portals can not be opened upon one another
Extras for script (if possible) are:
Portals close if a certain tile is touched (could be harm tiles as probably no harm tiles to hurt player)
Portals can be 'fired' through walls which the player can not go through
Portals can only be opened on specified walls
I was thinking perhaps the portals are some kind of vehicle (as they travel) which would possibly make the 2nd extra easier as walls can be defined for player and vehicle separately.
Sorry, I waffle. You will be very much praised among the game if you can work this problem out. Thank you in advance. _________________ [url "http://thegreatestwar.bebo.com"]The Greatest War - My online story[/url] |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Jul 18, 2008 9:37 pm Post subject: |
|
|
You can't manipulate doors with scripting, so what you will probably want to do is create a step on NPC on the wall, as well as modify the passmap to let the player step on it, and maybe the tilemap too. You could reserve 2 npc IDs on every map to simplify things, or use one twice. To find the position of the exit, you can just check whether the other NPC exists on the map, and if so, where.
The part that you have to put together is how to decide whether a wall is suitable for a portal (what is a wall?), and how to modify it, taking layers into account if you're using them. Then scan the tiles in front of the hero in a line for a wall.
Using the mouse for that seems awkward when the player has to use the keyboard for everything else (unless they are using a joystick) _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Blue Pixel SPY SAPPIN MAH FISH SANDWICH

Joined: 22 Apr 2005 Posts: 621
|
Posted: Sat Jul 19, 2008 9:37 am Post subject: |
|
|
i was going to try the same thing you were doing but then gave up on the project. if you succeed at this id love to see what you come up with. _________________
 |
|
Back to top |
|
 |
Chenzi User was banned for this post

Joined: 02 Aug 2003 Posts: 190 Location: Grand Rapids, MI
|
Posted: Sat Jul 19, 2008 2:15 pm Post subject: |
|
|
Just remember:
Speedy thing goes in, speedy thing comes out. _________________ Allow me to preemptively disclose that I probably hate the person posting below, including myself. |
|
Back to top |
|
 |
|