Jump to content
Rpg²S Forum
  • 0

Cerco 2 Script, il lavoro e l'allineamento buono cattivo.


lotgd
 Share

Question

avevo trovato questo

#===================================

# Leon's Good and Evil script

#----------------------------------------------------------------------

# Features:

# Gives an actor the "good", "Neutral" or "evil" alignment, based

# upon their actions.

#

# Instructions:

# Place above main, and below other scripts.

# Use: draw_alignment_bar(actor, x, y) in a script to draw the alignment bar.

# x and y being the position of the bar, and actor being the syntax for the actor's information.

#

# To use:

# To add or subtract from their alignment, use: $game_actors[actor_id].alignment += x

# To see if the actor's alignment is good, evil or neutral, use:

# * Conditional Branch, tab 4, Script.

# * For good, use $game_actors[actor_id] > 0

# * For evil, use $game_actors[actor_id] < 0

# * For neutral, use $game_actors[actor_id] == 0

#

# Extra Information:

# This script edits the original Window_Status script to add the good/evil.

#===================================

 

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# Game_Actor

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

class Game_Actor < Game_Battler

 

attr_accessor :alignment

attr_accessor :alignment_name

 

alias leon_alignment_bars_ga_setup setup

 

def setup(actor_id)

@alignment = 0

@alignment_name = "Neutrale"

leon_alignment_bars_ga_setup(actor_id)

end

 

def alignment

if @alignment > 0

if @alignment > 100

@alignment = 100

end

@alignment_name = "Buono"

return @alignment

end

if @alignment < 0

if @alignment < -100

@alignment = -100

end

@alignment_name = "Cattivo"

return @alignment

end

@alignment_name = "Neutrale"

return @alignment

end

 

 

end

 

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# Window_Base

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

class Window_Base

def draw_bar(x, y, min, max, width = 152, height = 6,

bar_color = Color.new(0, 75, 0, 255), end_color = Color.new(0, 255, 0, 255))

for i in 0..height

self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))

end

for i in 1..(height - 1)

r = 100 * (height - i) / height + 0 * i / height

g = 100 * (height - i) / height + 0 * i / height

b = 100 * (height - i) / height + 0 * i / height

a = 255 * (height - i) / height + 255 * i / height

self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))

end

for i in 1..( (min.to_f / max.to_f) * width - 1)

for j in 1..(height - 1)

r = bar_color.red * (width - i) / width + end_color.red * i / width

g = bar_color.green * (width - i) / width + end_color.green * i / width

b = bar_color.blue * (width - i) / width + end_color.blue * i / width

a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width

self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))

end

end

end

 

def draw_backward_bar(x, y, min, max, width = 152, height = 6,

bar_color = Color.new(75, 0, 0, 255), end_color = Color.new(255, 0, 0, 255))

for i in 0..height

self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))

end

for i in 1..(height - 1)

r = 100 * (height - i) / height + 0 * i / height

g = 100 * (height - i) / height + 0 * i / height

b = 100 * (height - i) / height + 0 * i / height

a = 255 * (height - i) / height + 255 * i / height

self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))

end

for i in 1..( (min.to_f / max.to_f) * width - 1)

for j in 1..(height - 1)

r = bar_color.red * (width - i) / width + end_color.red * i / width

g = bar_color.green * (width - i) / width + end_color.green * i / width

b = bar_color.blue * (width - i) / width + end_color.blue * i / width

a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width

self.contents.fill_rect(x - i + j, y + height - j, 1, 1, Color.new(r, g, b, a))

end

end

end

 

def draw_alignment_bar(actor, x, y)

#x = 320 y = 147

draw_bar(x, y, 0, 200, 200, 6)

if actor.alignment > 0

draw_bar(x + 100, y, actor.alignment, 100, 100, 6)

actor.alignment_name = "Buono"

elsif actor.alignment < 0

draw_backward_bar(x + 100, y, -1 * actor.alignment, 100, 100, 6)

actor.alignment_name = "Cattivo"

elsif actor.alignment == 0

draw_bar(x + 100, y, actor.alignment, 100, 100, 6)

actor.alignment_name = "Neutrale"

end

draw_bar(x + 97, y - 2, 2, 2, 2, 10, Color.new(255, 255, 255, 255), Color.new(255, 255, 255,255))

self.contents.font.color = normal_color

self.contents.draw_text(x + 5, y - 13, 120, 32, "C")

self.contents.draw_text(x + 190, y - 13, 120, 32, "B")

end

 

end

 

 

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# Window_Status

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

class Window_Status < Window_Base

 

alias leon_alignment_bars_ws_refresh refresh

 

def refresh

leon_alignment_bars_ws_refresh

if @actor.alignment > 100

@actor.alignment = 100

elsif @actor.alignment < -100

@actor.alignment = -100

end

self.contents.font.color = system_color

self.contents.draw_text(320, 112, 120, 32, "Carattere")

draw_alignment_bar(@actor, 320, 147)

self.contents.font.color = normal_color

self.contents.draw_text(420, 112, 120, 32, @actor.alignment_name)

end

end

 

 

(autore leon)

per l'allineamento, ma non mi funziona e non è precisamente come mi serve perchè non penso funzioni con personaggi variabili.

 

e cercavo uno script che mi permette di far lavorare i personaggi, con tanto di livelli ecc ecc

 

spero in un aiuto.

IL MIO NICK è FRISKON Quando mi son registrato, credevo di fare lo spettatore!

 

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
Io nel mio gioco ho fatto entrambi ad eventi, più un piccolo script che visualizzava sul menu le variabili dei lavori e della reputazione.

 

Volete due giochi Completi e Seri fatti con RPG MAKER? Cliccate su...

www.raldon.altervista.org

 

Problemi con Raldon? Segnalali su...

www.raldon.forumfree.net

 

Partecipante al Rpg2s.net Game Contest 2008/2009

http://www.rpg2s.net/contest/GameContest0809/gc0809-bannerino.jpg

Gioco in Sviluppo: Raldon

 

 

Posizioni raggiunte nei Contest

http://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://img76.imageshack.us/img76/1260/destroy3gr3.pnghttp://img233.imageshack.us/img233/7186/comics2hd8.gifhttp://www.rpg2s.net/gif/GC_bestoftool3.gif

http://www.rpg2s.net/gif/GC_premio3.gifhttp://www.rpg2s.net/gif/GC_premio3.gifhttp://www.rpg2s.net/gif/GC_premio1.gifhttp://www.rpg2s.net/gif/GC_premio2.gifhttp://www.rpg2s.net/gif/GC_grafica3.gifhttp://www.rpg2s.net/gif/GC_programmazione3.gifhttp://www.rpg2s.net/gif/GC_programmazione1.gifhttp://www.rpg2s.net/awards/furordipopolo/Popolo3K.gifhttp://www.rpg2s.net/awards/furordipopolo/Popolo2XP.gifhttp://www.rpg2s.net/awards/furordipopolo/Popolo2BEST.gif

http://www.rpg2s.net/awards/bestuser2.jpghttp://www.rpg2s.net/awards/bestmaker2.jpghttp://www.rpg2s.net/awards/mostpresent1.jpghttp://www.rpg2s.net/awards/mostproductive1.jpg

Link to comment
Share on other sites

  • 0
raldon il problema è che sono un novizio e a stento faccio il teletrasporto ^^ anche se ho visto che in questo sito c'è una guida su come creare cose simili, cercavo qualche script prefatto

IL MIO NICK è FRISKON Quando mi son registrato, credevo di fare lo spettatore!

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...