Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

2 Pages V   1 2 >  
Reply to this topicStart new topic
> Berka's NPC Generator, Make your world alive
berka
post Apr 27 2009, 01:36 PM
Post #1


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




NPC Generator
Version: 2.1
By: Berka


Introduction
This script allows you to create characters during play and randomly, without knowing Ruby. Your game will be more realistic and alive.

Features
  • random checked position
  • name generator
  • random dialog generator
  • dialogs, item/gold/armor gains...


Screenshots
none

Demo
here

Script
CODE
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#                            NPC Generator
#  by berka                                            rgss2
#                          www.rpgmakervx-fr.com                                          
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#  Rgss 2                  v 2.1        based on mithos & pipo work
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#                          -Instructions-
# Write in an event, call a script command:
#
# minumum required:
# [event]               # compulsory !
#  chara : "Actor01"    # name of the charset file or: chara : rand
#
# and optional settings:
#  x : 5                # x position, random if nothing
#  y : 10               # y position, random if nothing
#  nom : "Event01"      # event's name or nom: rand
#  c_index : 0          # charset's index
#  face : "Actor01"     # name of the faceset file or: face : true (=> same as chara)
#  f_index : 0          # faceset's index
#  dir : 2              # event direction
#  type_mov:0           # movement type
#  vit_mov:0            # movement speed
#  freq_mov:0           # muvement frequency
#  texte:"bonjour"      # dialog or texte:rand (cf. list above)
#  trigger:0            # event trigger
#  prio_type:1          # priority
#  script: "print @a=1" # script command
#  combat: 1,true,false # battle: id_monster, esc, follow if defeated
#  or: 0,0,1000         # gold:      0/1 (add/rem),0/1 (Const/var),amount (nbr/var_id)
#  objet: 2,0,0,10      # item:   id,0/1 (add/rem),0/1 (Const/var),amount (nbr/var_id)
#  arme: 2,0,0,10       # weapon: id,0/1 (add/rem),0/1 (Const/var),amount (nbr/var_id)
#  bouclier: 2,0,0,10   # armor:  id,0/1 (add/rem),0/1 (Const/var),amount (nbr/var_id)
#  suppr : true         # erase this generated event
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Example:
#
# [event]
# chara:rand
# texte:rand
# type_mov : 1
#
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

$characters="people" # series of charsets used to create random character
                     # people1, people2...
$chara_nbre=5         # nombre de fichiers people                  
# Random dialogs (too lazy to translate everything)                    
# Random dialogs (translated by phenixryte23)                    
$dialogues=["Hello, the weather's lovely don't you think?","How are you?","Get out of here!",
            "I don't have time to talk!","You're annoying me...","You again?",
            "Ah!There you are my friend!","Hey, you seem tired.", "Grrrrr...",
            "Get out of my sight!","What a beautiful day!","I'm just taking a walk.","You're back?",
            "Hihihi!","Nothing.","I don't want to talk to you.","What to do?","Oh, it's �N[1]!",
            "Weather's changing...","You're my idol...","God, you're so ugly!",
            "You remind me of someone...","You seem underhanded","Hi �N[1] !",
            "I don't trust you...","Don't come near me!","I'm suffering",
            "Hey! Do you know this girl?","Ahhahaharff...","Good day","Be careful!",
            "Honored to see you again","...cough...","Hey-ho!","Another stranger?","Boo!",
            "I can't hear a word you're saying...","Speak clearly!","Speak a little quieter.",
            "I've been walking all day.","I agree.","Get out of my way beggar!",
            "Good day young man","...sob...","You're bringing bad luck here!","I hear you.",
            "Don't look at me like that!","We need to talk...","It's time for breakfast!",
            "I'm glad to have known you."]
            # in-game: $dialogues << "You are now an heroe for me !"
            
$nom=[%w(Gw Ul Et Rh Ed Gr Dr Dw Tr Gh As Ar Ag Xor),             # name generator
      %w(ai ia eo ui yn or ul ur a e i o u y yr ya yl),
      %w(th rk dd gh z l mn lyr zar gor ryn nia lia )]
      
module Berka
  module Pnj_Gen
    Tag = "[event]"                                           # Tag of NPC generator
    Separateur = ":"                                          # Separator: cmd/value
    Index_Chara = 8                                           # Number of patterns
    Commandes = {:face     => "[101,[@_face,@_f_index,0,2]]", # List of commands
                 :or       => "[125,[*@_or]]",
                 :objet    => "[126,[*@_objet]]",
                 :arme     => "[127,[*@_arme]]",
                 :bouclier => "[128,[*@_bouclier]]",
                 :combat   => "[301,[0,*@_combat])]",
                 :script   => "[355,[@_script]]",
                 :suppr    => "[214]",
                 :texte    => "[401,[@_texte]]"
                }
    ProfCoord = 100                                           # Deep of x/y scan
  end
end

include Berka::Pnj_Gen
class Array
  def arand
    self[Kernel.rand(self.size)]
  end
end
class Object
  def rand?
    self == "?"
  end
end
class Game_Map
  include RPG
  def check_event(x,y)
    for event in @events.values
      return event.id if event.x==x&&event.y==y
    end
    return nil
  end
  def make_event(com)
    self.instance_variables.each{|v|eval("#{v}=nil") if v.include?("@_")}
    rand="?"
    com.each_with_index{|c,i|eval("@_#{c.first.id2name}=#{c[1]}")}
    set_rand
    set_options
    return if @_x.nil?||@_y.nil?
    if check_event(@_x,@_y).nil?
      @event=Event.new(@_x,@_y)
      com.each{|c|c=c.first
        ajout_cmd(*eval("#{Commandes[c]}"))if Commandes.has_key?(c)
      }
      @event.id=creerid
      @event.name=@_nom
      @event.pages.first.graphic.character_name=@_chara
      @event.pages.first.graphic.character_index=@_c_index
      @event.pages.first.graphic.direction=@_dir
      @event.pages.first.move_type=@_type_mov
      @event.pages.first.move_frequency=@_freq_mov
      @event.pages.first.move_speed=@_vit_mov
      @event.pages.first.through=@_trav
      @event.pages.first.trigger=@_trigger
      @event.pages.first.priority_type=@_prio_type
      @events[@event.id]=Game_Event.new(@map_id,@event)
      @need_refresh=true
      $scene.refresh_spriteset  
    end
  end
  def set_rand
    rand="?"
    @_chara||=rand
    @_nom=aleatoire_nom if @_nom.nil?
    @_texte=$dialogues.arand if @_texte.rand?
    @_x,@_y=*aleatoire_pos if @_x.nil?||@_y.nil?
    @_pers=aleatoire_perso
    if @_chara.rand?||@_c_index.rand?
      @_face,@_f_index,@_chara,@_c_index=@_pers
    end
  end
  def set_options
    @_chara=@_pers.first if @chara.nil?
    @_c_index=@_pers[1] if @_c_index.nil?
    @_face,@_f_index = "",0 if @_face==false
    @_dir||=3
    @_type_mov||=0
    @_freq_mov||=3
    @_vit_mov||=3
    @_trav||=false
    @_trigger||=0
    @_prio_type||=1
  end
  def aleatoire_pos
    ProfCoord.times{
      x,y=Kernel.rand(width).to_i,Kernel.rand(height).to_i
      next if x==$game_player.x&&y==$game_player.y
      (return x,y) if passable?(x,y)&&!check_event(x,y)
    }
    return nil,nil
  end
  def aleatoire_perso
    i=Kernel.rand(Index_Chara-1)
    res=$characters+(Kernel.rand($chara_nbre)+1).to_s
    return [res,i,res,i]
  end
  def aleatoire_nom
    n="#{$nom.first.arand}#{$nom[1].arand}#{$nom[2].arand}"
    n<<$nom[1].arand if rand(4)==1
    return n
  end
  def event_name(id)
    @events[id].name if !@events[id].nil?
  end
  def creerid
    id=1
    id+=1 while @events.keys.include?(id)
    return id
  end
  def ajout_cmd(code,param=[],i=0)
    cmd=EventCommand.new
    cmd.code,cmd.parameters,cmd.indent=code,param,i
    @event.pages.first.list.insert(-2,cmd)
  end
end
class Scene_Map<Scene_Base
  def refresh_spriteset
    @spriteset.dispose;@spriteset=Spriteset_Map.new
  end
end
class Game_Interpreter
  def eval(script)
    if script.include?(Tag)
      com=[];script.gsub!(Tag,'')
      list=script.split("\n")
      s=Separateur
      list.each_with_index{|e,i|e.gsub!(' '+s,s);e.gsub!(s+' ',s);f=e.split(s)
      com<<[f.first.to_sym,f[1]]if !f[1].nil?}
      $game_map.make_event(com)
      return
    end
    return Kernel.eval(script)
  end
end


Instructions
Read the comments at the begining of the script.
Do not use this script in parallel process !

FAQ
Place this script above main

Compatibility
No problem.
You may have problems with my video script

Credits and Thanks
Mithos and Pipo both famous French Scripters
phenixryte23 for dialogs translating

Terms and Conditions

this script is totally free of use, but I need an apparent credit in your game and:
Do not post these scripts anywhere without my permission !

have fun.
Berka

This post has been edited by berka: May 4 2009, 12:27 PM


__________________________
Go to the top of the page
 
+Quote Post
   
fogfactor
post Apr 27 2009, 01:44 PM
Post #2


Level 7
Group Icon

Group: Member
Posts: 95
Type: Writer
RM Skill: Beginner




you should get some screenies, cause i don't really get what this does.


__________________________
tournaments won: 2 yay! i won demon's official tourney #45!

Go to the top of the page
 
+Quote Post
   
berka
post Apr 27 2009, 01:57 PM
Post #3


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




ow... I think that screenies will be useless...

Using this script you can create new events in an event.

You have to create only one event in the editor.
And each time you start this event in game, a new random event will be generated.

berka


__________________________
Go to the top of the page
 
+Quote Post
   
fogfactor
post Apr 27 2009, 02:33 PM
Post #4


Level 7
Group Icon

Group: Member
Posts: 95
Type: Writer
RM Skill: Beginner




ok, what i THINK this does is make random events? like make an event, and everytime you go to it it makes something completly random?


__________________________
tournaments won: 2 yay! i won demon's official tourney #45!

Go to the top of the page
 
+Quote Post
   
Xeyla
post Apr 27 2009, 03:53 PM
Post #5


Keeper of the RMVX FAQ
Group Icon

Group: Revolutionary
Posts: 706
Type: Mapper
RM Skill: Intermediate




QUOTE (fogfactor @ Apr 27 2009, 06:33 PM) *
ok, what i THINK this does is make random events? like make an event, and everytime you go to it it makes something completly random?


This script allows you to make an event that randomly generates NPCs, which are Non-Player-Characters. You know, the insignificant people you meet, but never talk to? Or you do talk to, but they say random things like: "my name is So&So" "Nice weather" or Why do I always walk to same path every day?"

This script is meant to add flavor, and maybe some eye-candy for people who try to make their games as real as you possibly can with RMVX.

If i'm wrong, please correct me smile.gif


__________________________


QUOTE (Albino Parakeet @ Apr 1 2011, 05:46 PM) *
i need to know exactly how to put a penis inside someone's butt.
do you have the technical knowledge to tell me how?
QUOTE (Albino Parakeet @ Apr 2 2011, 01:20 PM) *
QUOTE (Shadyone @ Apr 2 2011, 06:29 AM) *
I see the keet likes anal.

im trying to get into it but people aren't answering my question
Go to the top of the page
 
+Quote Post
   
SuperMega
post Apr 27 2009, 08:38 PM
Post #6


Public memberTitle(String n)
Group Icon

Group: Revolutionary
Posts: 683
Type: Developer
RM Skill: Skilled




Wow, this is exactly what I needed for one of my projects! Thanks a bunch, berka!


__________________________
Translated Scripts:
Diagonal Movement (Eight Direction) and Smooth Jumping
Attack Party, Heal Enemies
Display Party Status On Map (DQ Style)
Display Maps Under Maps
Save Screen Customization
Subtitled Menus

If you want to suggest a translation for something, PM me, and I'll take a look. I AM TRYING TO GIVE AWAY LOCKERZ.com INVITES, SO PLEASE LET ME KNOW IF YOU WANT ONE.
Currently Working on 2 RPG Maker VX Projects. They are very unique, and have a different kind of style then the usual RPGs. So don't think of them as just another RPG. Did that sound rude? :D Not sure if I want them to go public yet, but we'll see how it goes.
Need a script translated? Come talk to me, and I'll see what I can do.
Go to the top of the page
 
+Quote Post
   
berka
post Apr 28 2009, 08:43 AM
Post #7


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




xeyla: It's what you say !

Thanks guys,
berka


__________________________
Go to the top of the page
 
+Quote Post
   
SuperMega
post Apr 28 2009, 04:34 PM
Post #8


Public memberTitle(String n)
Group Icon

Group: Revolutionary
Posts: 683
Type: Developer
RM Skill: Skilled




Hm, I'm getting a syntax error. Is it possible to upload a demo?


__________________________
Translated Scripts:
Diagonal Movement (Eight Direction) and Smooth Jumping
Attack Party, Heal Enemies
Display Party Status On Map (DQ Style)
Display Maps Under Maps
Save Screen Customization
Subtitled Menus

If you want to suggest a translation for something, PM me, and I'll take a look. I AM TRYING TO GIVE AWAY LOCKERZ.com INVITES, SO PLEASE LET ME KNOW IF YOU WANT ONE.
Currently Working on 2 RPG Maker VX Projects. They are very unique, and have a different kind of style then the usual RPGs. So don't think of them as just another RPG. Did that sound rude? :D Not sure if I want them to go public yet, but we'll see how it goes.
Need a script translated? Come talk to me, and I'll see what I can do.
Go to the top of the page
 
+Quote Post
   
berka
post Apr 29 2009, 05:33 AM
Post #9


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




New version.
I'll post a demo in a few minutes

berka


__________________________
Go to the top of the page
 
+Quote Post
   
bahumut0
post Apr 29 2009, 06:44 AM
Post #10


Level 9
Group Icon

Group: Revolutionary
Posts: 139
Type: Developer
RM Skill: Intermediate




hey this is cool. im just missing the images, so it gets an error, but i understand what it does. i can even read about 70% of the french!
so can the npc's move around? and also,
can i set it up so that only specific npcs generate?

this appears to simply be a development tool that makes making npc's faster. ill try it out.
I know my game takes ages to make it look realistic. so this helps out a lot.

thanks a lot!/merci bien!


__________________________





AEROSAGA


Story- 100% (just rewriting)
Maps-5%
Art-50%
Database-15%
Scripts-80%

Overall-20%


Full game - Coming Summer 2009
Go to the top of the page
 
+Quote Post
   
Valnar
post Apr 29 2009, 06:56 AM
Post #11


Level 4
Group Icon

Group: Member
Posts: 47
Type: Developer
RM Skill: Masterful




type_mov:1 and other stuff all well explained in the script
Thumbs up i love this Script xP
No need to make the Npcs on your own^^ thumbsup.gif


__________________________
Memories....
http://avalnar.co.cc/ - PHP;HTML;CSS;SQL;PS;TOP Tutorials and Sources

Go to the top of the page
 
+Quote Post
   
berka
post Apr 29 2009, 08:17 AM
Post #12


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




@bahamut0 : it depends on what kind of event do you want to select.
Valnar has answered at your first question.

regards,
berka


__________________________
Go to the top of the page
 
+Quote Post
   
darkubersaw
post Apr 29 2009, 02:43 PM
Post #13


Level 5
Group Icon

Group: Member
Posts: 67
Type: Event Designer
RM Skill: Beginner




demo no longer works. i suggest upload it to mediafire.com because its COMPLETELY free and easy to use


__________________________

[Show/Hide] My Gamertag



[Show/Hide] My Personailty Test
Go to the top of the page
 
+Quote Post
   
noahflash14
post Apr 29 2009, 02:55 PM
Post #14


Level 4
Group Icon

Group: Member
Posts: 54
Type: Artist
RM Skill: Beginner




Aw! I can't understand the demo because it's in French? Can anyone translate it..?


__________________________
Pokemon SXR by noahflash14
[Updated(11-06-10): added 4 spritesn] Pokemon SR = 22

Don't forget to visit Pokemon SXR thread.
Go to the top of the page
 
+Quote Post
   
reijubv
post Apr 30 2009, 01:32 AM
Post #15


It's been awhile lol
Group Icon

Group: Revolutionary
Posts: 168
Type: Artist
RM Skill: Advanced




Hmm...the demo is no longer can be downloaded from rapidshare,
please upload it somewehere else that there!

I have a question, is this compatible with woratana's NMS?


__________________________
I'll be back again :P
Go to the top of the page
 
+Quote Post
   
berka
post Apr 30 2009, 10:36 AM
Post #16


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




Demo updated.
About the NMS, it depends on how you use his script. The gen only makes standard events.

berka


__________________________
Go to the top of the page
 
+Quote Post
   
SuperMega
post May 1 2009, 05:15 PM
Post #17


Public memberTitle(String n)
Group Icon

Group: Revolutionary
Posts: 683
Type: Developer
RM Skill: Skilled




Hm, the demo seems to be gone. Can you re-upload it?


__________________________
Translated Scripts:
Diagonal Movement (Eight Direction) and Smooth Jumping
Attack Party, Heal Enemies
Display Party Status On Map (DQ Style)
Display Maps Under Maps
Save Screen Customization
Subtitled Menus

If you want to suggest a translation for something, PM me, and I'll take a look. I AM TRYING TO GIVE AWAY LOCKERZ.com INVITES, SO PLEASE LET ME KNOW IF YOU WANT ONE.
Currently Working on 2 RPG Maker VX Projects. They are very unique, and have a different kind of style then the usual RPGs. So don't think of them as just another RPG. Did that sound rude? :D Not sure if I want them to go public yet, but we'll see how it goes.
Need a script translated? Come talk to me, and I'll see what I can do.
Go to the top of the page
 
+Quote Post
   
berka
post May 2 2009, 12:40 AM
Post #18


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




thanks, I've corrected the dl link.

berka


__________________________
Go to the top of the page
 
+Quote Post
   
reijubv
post May 2 2009, 12:52 AM
Post #19


It's been awhile lol
Group Icon

Group: Revolutionary
Posts: 168
Type: Artist
RM Skill: Advanced




Yeah, now I can download your demo!
Thanks!

Hmm, can this script use special message effect like the ones from NMS?
Example, the name window, or maybe drawing an item's icon, etc?


__________________________
I'll be back again :P
Go to the top of the page
 
+Quote Post
   
berka
post May 2 2009, 06:27 AM
Post #20


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




yes, of course, if you right the correct tags in the message:
CODE
[event]
texte : "berka[/tag]hello"

berka


__________________________
Go to the top of the page
 
+Quote Post
   

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 20th June 2013 - 12:38 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker