technical help

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

technical help

Post by Willy Elektrix »

A few questions:

---- First ----

In a section of my game when certain NPCs touch you, you die. I'm doing this by making a touch trigger NPC that loads a text box.

This first text box says "You've been caught!" and then skips to another text box.

The second text box has a full screen background and is the default Game Over text box for my game which loads a text box that says "Game Over" and then runs this script (the syntax might not be quite right, I'm typing in this post from memory):

plotscript, endthegame, begin
game over
end

However, when that script is done it flashes the game screen (as it was before you died) for a 1/2 second before kicking you back to the title screen. It's not a big deal but it looks a little sloppy and I'm trying to fix it. Does anyone know what I'm talking about and if there is a work around for this?

---- Second ----

Is there anyway to freeze NPCs during a text box? Here's my example. I have certain NPCs that chase the player and kill him by touching him. However, some of the rooms have descriptive text boxes and if you bump into one of these boxes then NPCs will rush you while you read it. How can I suspend time while a text box is open?

Thanks for your help guys!
User avatar
JSH357
Liquid Metal Slime
Posts: 1341
Joined: Mon Oct 15, 2007 7:38 pm
Location: Columbia, SC
Contact:

Post by JSH357 »

For #1, try this:

Code: Select all

plotscript, endthegame, begin
showbackdrop(x) 
#X is the number of the backdrop you are using in the last box
game over
end
For #2:
Use this script instead of just calling the text box:

Code: Select all

suspend player
suspend npcs
show text box(x)
wait for text box
resume npcs
resume player
My website, the home of Motrya:
http://www.jshgaming.com
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

Post by Willy Elektrix »

The second bit of code worked great. Thanks so much! But something is strange with this bit below:

Code: Select all

plotscript, endthegame, begin
showbackdrop(x) 
#X is the number of the backdrop you are using in the last box
game over
end
The code seems to work (it is compiled without an error) but backdrop 0 doesn't actually show up. I've tried phrasing it as "showbackdrop(0)" or "show backdrop(0)" but neither does anything. I went through the wiki and according to it, the syntax is correct.
User avatar
Mogri
Super Slime
Posts: 4668
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

Yep, syntax is correct. But you're not pausing the game between showing the backdrop and ending the game. You probably want either wait for key(use key) or wait(ticks). Minimally, wait(0) will make the backdrop show up before the fade.
Post Reply