 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
brotoad Guest
|
Posted: Thu Sep 13, 2012 12:46 am Post subject: adding a shoot em up section to an RPG game? |
|
|
I'm making an RPG game, but I want to add a SHMUP section before the final dungeon to add some variety. I'm not an advanced plotscripter, and I don't need anything like a score (or even health given it's essentially a joke game, though a hit animation would be good)
How would be the best way to go about this?
I'm using the zenzizenizac version. |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Thu Sep 13, 2012 6:21 am Post subject: |
|
|
I think a good first step in making a minigame is to describe how you would like for it to play.
If you are not sure how to describe it, maybe there is some other SHMUP game you can give as an example for comparison.
Then when you have a concrete idea, we can talk about ideas for how to make it happen with plotscripting.
EDIT: by the way! Please download the new alectormancy release! it has lots of bugfixes that were not in zenzizenzic |
|
Back to top |
|
 |
Rya.Reisender Snippy

Joined: 18 Jan 2008 Posts: 821
|
Posted: Thu Sep 13, 2012 9:04 am Post subject: |
|
|
Someone once made a shoot 'em up with OHRRPGCE, maybe you could get in contact with him? Don't really remember who did, though... _________________ Snippy:
"curt or sharp, esp. in a condescending way" (Oxford American Dictionary)
"fault-finding, snappish, sharp" (Concise Oxford Dictionary, UK)
1. short-tempered, snappish, 2. unduly brief or curt (Merriam-Webster Dictionary) |
|
Back to top |
|
 |
brotoad Guest
|
Posted: Fri Sep 14, 2012 1:53 pm Post subject: |
|
|
I didn't stay with alectormancy, as for some reason, NPCs with the "usable only once" option would dissapeer before they finished what they were doing, such as text boxes. It would take a lot of time to replace all of it with tags, so I stuck with zenzizezizznzznenzizc.
As for the Minigame, all I'm looking to make is a sidescrolling area, where you can only move up and down, and shoot. The enemies wouldn't really need to move much, just so long as they can be destroyed via being shot.
If one touches you, it should make the character explode, then gameover.
Like I said, this is basically a joke game, so it doesn't need to be difficult or have anything too complex. I just wanted to add some variety to it given it runs over 30 minutes. |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Fri Sep 14, 2012 2:43 pm Post subject: |
|
|
brotoad wrote: | I didn't stay with alectormancy, as for some reason, NPCs with the "usable only once" option would dissapeer before they finished what they were doing, such as text boxes. It would take a lot of time to replace all of it with tags, so I stuck with zenzizezizznzznenzizc. |
And you didn't report the bug!? I am wounded!
But you are in luck, somebody else reported that bug, and it was fixed in alectormancy+1 (alectormancy+2 is the current stable)
brotoad wrote: | As for the Minigame, all I'm looking to make is a sidescrolling area, where you can only move up and down, and shoot. The enemies wouldn't really need to move much, just so long as they can be destroyed via being shot.
If one touches you, it should make the character explode, then gameover.
Like I said, this is basically a joke game, so it doesn't need to be difficult or have anything too complex. I just wanted to add some variety to it given it runs over 30 minutes. |
That wouldn't be too hard to script. You could suspend the normal player controls, and use an on-keypress script to handle the up and down movement for the player. In the same script you could check for spacebar to shoot, and if pressed, add a bullet NPC to the map.
Then you could have a timer script that repeats once every tick. It would be responsible for moving the hero and the camera slowly to the right, and for making all bullets move, and for checking if a bullet NPC has collided with an enemy NPC. |
|
Back to top |
|
 |
brotoad Guest
|
Posted: Sat Sep 15, 2012 12:43 am Post subject: |
|
|
I'm relatively new to plotscripting, so I still have a whole bunch of questions.
Mainly in that I have no idea how to make a timer or how to make it check for these things, or how to make the bullet appear from the player. Maybe this is too advanced for me right now?
I can always just have it be a cutscene if it's too much of a problem.
Another thing, I don't know if this is a bug, but in my game, after some random point, the experience points start getting divided between heroes rather than all heroes getting the full amount. It's not a big problem as I've managed to work around it, but I am still curious. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sun Sep 16, 2012 1:57 am Post subject: |
|
|
This is pretty straight forward, so I hope you fill in the gaps of the following. I wish someone else would step up for once to provide a script!
You don't actually need a timer, just a while loop. For example to move every copy of NPC 3 to the right 5 pixels every tick:
Code: |
while (true) do, begin # replace with some victory/loss condition
variable (num, npc)
for (num, 0, npc copy count (3) -- 1) do (
npc := npc reference (3, num)
put npc (npc, npc pixel x (npc) + 5, npc pixel y (npc))
)
wait (1)
end |
To create a bullet, just use "create npc" followed by "put npc" to place it at exactly the right pixel.
You can use the "slice collide" command on the walkabout slices of a pair of NPCs, or a hero and an NPC ("get npc slice" and "get hero slice") to see if they're colliding. (Or you could totally skip slices and check collision based on position manually. That would be the way to go if you don't want 20x20 hitboxes.) So you could loop through all bullet and enemy npcs (two nested for loops) and check collision with:
Code: |
variable (slice1, slice2)
slice1 := get npc slice (npc ref1) #a bullet npc
slice2 := get npc slice (npc ref2) #an enemy npc
if (slice collide (slice1, slice2)) then (
#delete both npcs using "destroy npc"
) |
NOTE: both for loops should run backwards, or you'll get error messages when NPCs are deleted in the middle of a loop, screwing up the copy count number ("num"):
Code: | variable (num, npc)
for (num, npc copy count (3) -- 1, 0, -1) do ( # step -1
npc := npc reference (3, num)
#...
) |
Quote: | Another thing, I don't know if this is a bug, but in my game, after some random point, the experience points start getting divided between heroes rather than all heroes getting the full amount. It's not a big problem as I've managed to work around it, but I am still curious. |
Experience is meant to be divided between heroes only if the "Don't divide experience between heroes" general preference bitset is off. Are you sure you didn't toggle this bit accidentally at some point? _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Brotoad Guest
|
Posted: Sun Sep 23, 2012 3:40 am Post subject: |
|
|
Thanks for the help, it didn't work out too well though so I skipped the shmup in favour of a cutscene and it works with the story perfectly fine
The game is nearing completion (about to start work on the final dungeon), and in the end screen, I want to show the play time. How would I go about that?
It would show a backdrop, and at the bottom, a text box with something along the lines of
"Completion Time: XX minutes" as well as showing hours if applicable. |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Sun Sep 23, 2012 12:45 pm Post subject: |
|
|
Here is a script that stores the play-time in string number 0
Code: |
plotscript, show play time, begin
$0=""
if(hours of play >> 0) then(
append number(0, hours of play)
$0+" hours and "
)
append number(0, minutes of play)
$0+" minutes"
show text box(10)
end
|
In this example, text box 10 is a text box that shows string 0 using the ${S0} code. |
|
Back to top |
|
 |
Brotoad Guest
|
Posted: Sun Sep 23, 2012 1:35 pm Post subject: |
|
|
Final question (I hope!)
How can I use the on keypress script to play a footstep sound while walking?
Thank you all very much for the help by the way! |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Sun Sep 23, 2012 2:53 pm Post subject: |
|
|
I think a footstep sound script would be much easier if you use the "each step" script instead of the "on keypress" script.
Then the script can be as simple as:
Code: |
plotscript, walking noise, begin
play sound(1)
end
|
|
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sun Sep 23, 2012 8:17 pm Post subject: |
|
|
You might want to try "playsound(ID, false, true)" instead if your sound effect is too long.. By default playsound doesn't restart the sound effect if it's already playing. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|