ADVANCED NPC'S

Posts

Pages: first 12 next last
Hello ppl Iv been trying to think of other ways to communicate with NPC's
here's the idea, alright imagine this...

you have a simple npc (says hello when clicked)

ok now for the hard part
lets just say he/she need's a password to move forward
the password is ...... Spam

!!opens name input!!

if you type "spam" into the name something will
recognise that... activating the next part

if you type anything else nothing will happen...

Am I supposed to activate a variable switch or something???


taking that idea further imagine all npc's that you talk with start with a "name input" sooooo if you type ... "Hi" that will start a general convo
"Fact" for facts about whatever and finnaly "Objectives"

get the idea? ;)

If I can pull it off it should turn out quite nicely

the easy way to do this would be to add choices to the events
but I think it would be a lil better if you could type in what you want to say

Here's how for RMXP (Rm2k3 is pretty much the same way though):
You ask for a player name of a dummy character and use a branch to see if the player's name is equal to the intended password.

example:

Name Input Processing: DummyDude, X Characters - Tab 3, first column, near the top. Input the name of a dummy character so that you don't overwrite the names of any actual characters in the game.

Conditional Branch: is name 'Password' applied Tab 1, first column, around the middle. Second tab of branch. Select your dummy character as the actor and select Name and set that to your intended password.

From there the branch will execute if the player input the Password, and if they put in the wrong password, it'll execute the else instead (if there is one).


Doing it with Rm2k3 should be the same kind of deal.
Nice!!

Im using XP so Ill add it now ;D


wow it worked 1st time..... dam gotta rearrange the whole project now hehe
Hi again I was wondering if was possible to add a time limit to the above code..... example

Im entering the password but I only have 10 seconds to type it all in..... do you think thats possible or would the timer only activate before or after the name input is initiated?

Edit
Incase your wondering how Im going to use this
option....

1}Imagine certain npc or players have... lets just say a fav food
there would be no way without finding certain clues giving you information on that player.... sooo your reading his/her dairy... the player is always talking about cake.....

go back to the character and type Cake into the word option
and then the npc will start a mini task talking about how she wants ingrediants for this magical cake of glory......


2}you want to learn skills from the grand master you can only address him in a cerrtain way.... example he says what do you want.... word option opens you will then have to type either 'Your Guidance' or 'Power'
oviously if you type power he will get mad.... Im not sure how I can get the word guidance to pop into your head without it being ovious but Ill think of something.....

mayby Ill make a lil scene where the Master is instructing a random student (the way in which he/she talks will give you an idea on how
you must interact/talk)

make sense?
Note: I'm doing this off the top of my head, so I can't say if it works or not.

In the RMXP script editor, go into Scene_Name (its near the bottom), in def main, there should be the following snippit of code. Add the bolded stuff (comments extra):



def main
# Get actor
@actor = $game_actors
# Make windows
@edit_window = Window_NameEdit.new(@actor, $game_temp.name_max_char)
@input_window = Window_NameInput.new
# Execute transition
Graphics.transition
# Main loop

# Set the number of frames to wait before closing the window
# RMXP runs at ~40FPS, so 40 frames = 1 second
@FrameCountdown = 400 # Wait 400 frames, or 10 seconds
# For a variable amount of time, use $game_temp.name_actor_id as input
@FrameCountdown = .max
# Wait for as many seconds as the ID of the actor supplied, to as low as 10 seconds
# Only use one of the @FrameCountdowns

# to a function.
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update

# If the frame countdown has ran out
if(@FrameCountdown == 0)
$scene = Scene_Map.new # Exit the name input screen and go back to the map
# Otherwise, decrement the countdown by one
else
@FrameCountdown -= 1
end

# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@edit_window.dispose
@input_window.dispose
end


Remember, I haven't tested this. Make a copy of the original code in case it doesn't work (although removing the changes should be simple enough)
My mind boggled when i read all that. ;D
nice one....

you got skills man!

testing it now...


Edit!!
Wowzers It works like a dream ;D hehe
give your brain a pat on the frontal lobe....


it works on the lower IDs also.... not a problem though
Ill just make the ID number for names 500 seconds ;)


!!!Edit!!!
hmmm it seems to be 10 seconds on all ID's
Because you completed that mission with such ease Im sure this wont be hard for you....

Ok you know the window (windowskin) that pops up in the background when you input characters... is there a way to make that 100% transparent so you can still see the game in the back with the text on top....

oh

I set the window skin to None but that leaves a black bground....

(reasons for wanting this)
I hate the way it stretches out the skin plus if I can still see the game while typing I could set up a better looking picture to go round it


dont worry if you cant youve done enough ;)



Here's everything you need, with a bit more: (Original code is non-bold, new stuff is bolded)

This stuff goes between class Scene_Name and def initialize, change these to fiddle with the settings of the timer and ActorIDs and opacity



PCS = 10 + 1
# Change the first number to the number of PCs your game uses, if it uses the RMXP database for characters
# This is for being able to edit PC names with infinite time
# The +1 is for a dummy actor used for player input with no timeout.
# So lets say your game has 5 PCs aka Actors. Actors 1-5 are your PCs which have infinite name-edit time...
# Actor 6 is for input that has infinite time, and Actor 7+ are actors with timeout

SECONDS_PER_ID = 1
# This adjusts the time to wait before closing the window automatically.
# Its the seconds to wait per ID > PCS, so in the above example of 5 PCs,
# Actor7 will wait SECONDS_PER_ID, Actor8 will wait 2*SECONDS_PER_ID, ect.

WINDOW_OPACITY = 0
# Set this to the opacity of the window background. 0 is transparent, 255 is opaque



This stuff is the def main snippet from before:

def main
# Get actor
@actor = $game_actors
# Make windows
@edit_window = Window_NameEdit.new(@actor, $game_temp.name_max_char)
@input_window = Window_NameInput.new


# Set the opacity of the name input windows
@edit_window.back_opacity = OPACITY
@input_window.back_opacity = OPACITY


# Execute transition
Graphics.transition
# Main loop

# Set the number of frames to wait before closing the window
@FrameCountdown = $game_temp.name_actor_id - PCS * Graphics.frame_rate * SECONDS_PER_ID


# to a function.
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update

# If the frame countdown has ran out and the ActorID is a timeout ActorID (>PCS)
if @FrameCountdown == 0 and $game_temp.name_actor_id > PCS
$scene = Scene_Map.new # Exit the name input screen and go back to the map
# Otherwise, decrement the countdown by one
else
@FrameCountdown -= 1
end

# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@edit_window.dispose
@input_window.dispose
end


I'm not at home so I can't test it though, I'll throw up some tested code later tonight.


For stretching, there should be a way to deal with that. Do you want all windows to tile the windowskin, or just the NameInput windows?
nice one....

hmmm if possible Id like the Name Input backdrop to be 100% transparent so you can still see the game behind it....
Alright, I figured out what it was; its the way RMXP handles "scenes" (I've always ignored it for my systems)

Here's the quick and dirty way:
In the Scene_Map script, on line 205 there should be:


$scene = Scene_Name.new


Change that to:


scene = Scene_Name.new
scene.main()



This needs some changes to the Scene_Name script too. The loop needs a new break condition (it breaks when the scene changes from Scene_Name, but scene is never set to Scene_Name), so I use a simple boolean that the loop executes when true, and when false it breaks. So the boolean is set to false when the time limit expires, or when a name is inputted. Here's the code for it (changes from above code in bold):


def main
@RunFlag = true
# Get actor
@actor = $game_actors

# Prepare for the transition
Graphics.freeze


# Make windows
@edit_window = Window_NameEdit.new(@actor, $game_temp.name_max_char)
@input_window = Window_NameInput.new

# Set the opacity of the name input windows
@edit_window.back_opacity = WINDOW_OPACITY
@input_window.back_opacity = WINDOW_OPACITY

# Execute transition
Graphics.transition
# Main loop

# Set the number of frames to wait before closing the window
@FrameCountdown = ($game_temp.name_actor_id - PCS) * Graphics.frame_rate * SECONDS_PER_ID

# to a function.
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update

# If the frame countdown has ran out and the ActorID is a timeout ActorID (>PCS)
if @FrameCountdown == 0 and $game_temp.name_actor_id > PCS
@RunFlag = false
# Otherwise, decrement the countdown by one
else
@FrameCountdown -= 1
end

# Abort loop if screen is changed
if @RunFlag == false
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@edit_window.dispose
@input_window.dispose

# Do the transition
Graphics.transition

end



There's a small change in the update function too. Look for the following snippet of code in def update, it should be near the middle:

# Change actor name
@actor.name = @edit_window.name
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to map screen
$scene = Scene_Map.new


Replace $scene = Scene_Map.new to @RunFlag = false

That should do the trick.


*edit*
Oh, wait, hold on. Something doesn't work. Gimme a sec

*reedit*
Oops, I forgot to accomodate the graphics transitions since I wasn't changing "scenes". The code should work now with the extra Graphics.freeze/transition calls in the def main for Scene_Name.

I also botched some of my math, I needed brackets when it calculates how many frames to wait otherwise it would always wait indefinetly for every character.

*thirdedit: See? Testing is important!*

Do you want it so that when you timeout, whatever the character's name is when you run out of time is set to the player's response?
Dam My Pc.... >:(


but I see youve been busy.... :o ;D 2 secs

Edit!
Wooo hoooo pure perfection as always.....
:D much better this gives it a real nice feel....

Hmmm Im waiting for the Last Update to be Accepted... have you
tried out my Demo yet? :P

Added a heck load to the Character Creation part.....
my god the 1st attempt got too out of control so
I had to limit it...

What I did
I made 10 sets of eyes, 10 Noses, 10 mouths, 10 Hairstyles, after doing all that
I realised thats about 60+ combination's... I decided to limit a few parts so I didnt have to make the biggest conditional branch known to man.....

Other stuff
theres also an NPC with 32 input phrases

anyhoot thanks again for this ;D If you ever need anything Graphic related
for your Game plz dont hesitate.... hmmm have you made one?

Hahah ;)
Advanced Battle's (to be continued)

!Edit!
Do you want it so that when you timeout, whatever the character's name is when you run out of time is set to the player's response?

Answer!
Ummmm I think Ill use the timeouts on important parts like.... were all gonna die if you dont type this in "seconds" so I could use the "Else" part in the conditional branch

!Edit!
Aghh I think you will know the answer to this but what does it mean
when the game freezes inbetween tranfering to a map it says "Script Hanging"

I managed to get round this by jumping to that map at start of Game
so when you reach that area later on in game it loads correctly.....


author=donline link=topic=643.msg8950#msg8950 date=1202842869
Hmmm Im waiting for the Last Update to be Accepted... have you
tried out my Demo yet? :P

Unfortunately not. I don't have much free time with the current University semester (which involves a mess of group projects) but I do have it downloaded and stashed away with a bunch of other RPG Maker games that I intend to play.


author=donline link=topic=643.msg8950#msg8950 date=1202842869
Added a heck load to the Character Creation part.....
my god the 1st attempt got too out of control so
I had to limit it...

What I did
I made 10 sets of eyes, 10 Noses, 10 mouths, 10 Hairstyles, after doing all that
I realized thats about 60+ combination's... I decided to limit a few parts so I didn't have to make the biggest conditional branch known to man.....

If you could freely choose between each different graphic, you'd have a thousand different combinations, not 60. I'm sure there's a way to have the combinations and have it not literally take forever to implement, but I can't think of it now (and I'd have to play your game to see how it looks anyways)


author=donline link=topic=643.msg8950#msg8950 date=1202842869
anyhoot thanks again for this ;D If you ever need anything Graphic related
for your Game plz dont hesitate.... hmmm have you made one?
Working on a game. Currently its programming work (making a menu mostly from scratch, and that also means having a fair bit of the backend done too like player characters which I'm also making from scratch too) and revising the plot+characters.

If I ever need any graphics (which I'm sure I will), I'll keep your offer in mind. :)
(I just need to learn to stop sucking at sketching my characters...)


author=donline link=topic=643.msg8950#msg8950 date=1202842869
!Edit!
Do you want it so that when you timeout, whatever the character's name is when you run out of time is set to the player's response?

Answer!
Ummmm I think Ill use the timeouts on important parts like.... were all gonna die if you dont type this in "seconds" so I could use the "Else" part in the conditional branch
Alright, I'm fine with that. Means less work for me :P


author=donline link=topic=643.msg8950#msg8950 date=1202842869
!Edit!
Aghh I think you will know the answer to this but what does it mean
when the game freezes inbetween tranfering to a map it says "Script Hanging"

I managed to get round this by jumping to that map at start of Game
so when you reach that area later on in game it loads correctly.....
This, on the other hand, does.

I'll test it out sometime this week (possibly tonight, since I never get any homework done Tuesday nights) and see where I screwed up. I think its in the Scene_Map code (since I pretty much did a cheap hack of the $scene code). I'll get back to you on that though.


*edit*

Alright, I gave it a few tries (opening the name input window and then teleporting to another map) but I never get a failure or anything. Doublecheck that you inputted the script correctly, and see if maybe its another script thats screwing it up (or if its just the map you're teleporting to)
Hi again, about that error Iits in the WestOfTown map the BossBattleIntro map

when I telepot to that area it stops.... "script Hanging"

In the 3rd update I made a little scene at the beggining to show you....
I left another zip file in the folder with the Main edit file for rpg xp
theres a password on it (Ill mail it to you
)
oh and its always been there it wasnt you CODE that started it.....

For the character create bit Ive put 4 eyes, 4 mouths and 4 sets of hair
but.... I missed out a few so dont try all the combos (about 16)



I made a mistake, I don't have a copy of your game. I ran off to my downloaded games folder and I didn't find anything under Illumina. I do remember you posting something about a demo in your thread so that might've been where I got the idea, but I couldn't find it in your thread and you don't have a submission for it on the site.



*somethingIfoundwhenmakingthepost*

I see the game you're talking about: Sacred Shadow (Well, I'm assuming so again, but that one has a character creator, updated to 1.3 yesterday, and has a locked file in it). My bad, I'll take a look to see if I can find any immediate problems sometime soon.
http://www.rpgmaker.net/games/377/downloads/

theres the game link ..... the locked file has the Game EDIT file ill sent you the pass (you can play the game without...just cant edit game)

*oop
Well, this is strange. I downloaded your game but I can't run it (missing Graphics/Title/1 ), and when I go into it with RMXP none of my script changes persist. Hell, I can't even playtest through RMXP, trying to do so really does nothing (also, saving. Quit+Saving also does nothing)

I've never had this kind of problem with RMXP before, it's weird. I'll give it another shot later (probably Saturday) and try to figure out what the hell is wrong with RMXP.
WWHHAATT!
Ok go into the Grapics/Title folder copy the logo picture ...paste it and rename it to 1...

"and when I go into it with RMXP none of my script changes persist"

do you mean in the game?...

the only thing Ive used it for is the character creation bit....
and the guy on the stairs

I havenet added the timeout bits yet I did try
but I couldnt finishh the level in time

Edit
Just remembered you wont see your code until you overright the files with the
3rd update....... the 3rd needs all the files from the 1st and 2nd updates to run...

so...
Unzip Sacred shadows folder....then

Open Update 1.1 Extract the files into a new folder..

Open 1.2 extract files into the folder you just made.. (click overright if asked)

same with 1.3

then put all of the folders into the Sacred Shadow Game

!!Edit!!
I realy hope you forgot to d/l 1 and 2...

!!Edit!!
:o it's going to be almost impossible for you to navigate
through RPG Xp I just remembered all my maps are using
panoramas and a mixture of event pictures that are to big too
be visible in the event box.....

switch the veiw to layer 1 to make the blocks visible

!Edit!
Theres so many updates I think I should
just upload the main game again and get the size down to 50mb
I downloaded everything (original demo and all three updates), erased what I had before, and redid everything in the right order and now RMXP isn't being a pain anymore. I'm not sure what was going on there with how I couldn't make any script changes or run the game through RMXP, but I'm just going to blame Windows.


Anyways, to deal with the mising files, I just took all of the Graphics/Title/0d/1d/2d files and removed the 'd' and that got those working. There's also a missing BGM (s29) which I just copied and renamed another track for.

That gets me to the title screen, but from there I have another missing graphic ( Graphics/Characters/right3 ). I would suggest putting everything back together, doing a quick test run to make sure there's no missing files, and uploading a new version.


Also, locking the Game.rxproj won't lock your game from the database, that file is 10 bytes big and its the same for all RMXP project files. To prevent the game from opening in the RMXP editor, use the File->Compress Game Data in RMXP to lock your game that way.

Just don't send that to me because I won't be able to work with it :P
hehe yea I forgot about the database folder but if anyone puts that much effort making a new game and..... deserve to see it.. hehe

I will upload a new one I have tested this about 1000 times and I still keep missing things... soz about that

!!Edit!!

Ive uploaded fresh copy and shaved 30mb off
http://www.mediafire.com/?0bewep5ilav
Pages: first 12 next last