Ich brauche eine RGSS Bedingung die abfragt ob das Event auf den bestimmten x,y koordinaten steht.
Am Besten eins, dass man einfach einfügen kan und dann für jedes Event gilt.
Also shematisch so:
Bedingung: Event(Dieses Event) ist auf x,y dann
<>message hallo
<>end
Am Besten eins, dass man einfach einfügen kan und dann für jedes Event gilt.
Also shematisch so:
Bedingung: Event(Dieses Event) ist auf x,y dann
<>message hallo
<>end
Signatur! Hier könnte deine Werbung sthehen!
Signatur!
Signatur!
Hier mal eine fertige Lösung:
Diesen Code über Main einfügen:
und dann im Eventskript dies einfügen:
Für x und y halt die werte einsetzen die überprüft werden sollen.
Zur Zeit wird, wenn ein Event die besagte Position hat, das erste Common Event aufgerufen, das kannst du ja noch nach deinen Wünschen ändern^^
Mfg Monsta
Diesen Code über Main einfügen:
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 |
class Interpreter # By Monsta 9.1.2007
def event_coordinates (x,y)
for ev in $game_map.events.values
if ev.x == x and ev.y == y
$game_temp.common_event_id = 1
end
end
end
end |
und dann im Eventskript dies einfügen:
|
|
Quellcode |
1 |
event_coordinates(x,y) |
Für x und y halt die werte einsetzen die überprüft werden sollen.
Zur Zeit wird, wenn ein Event die besagte Position hat, das erste Common Event aufgerufen, das kannst du ja noch nach deinen Wünschen ändern^^
Mfg Monsta
Skripte:
Animations "Entruckler"
Console
Drunken Mode
Eventskript Debugger
Flat-Events
Impassable Script
Item Shortcut
MSS: Monsta's Shoot System (Neu)
Radius Skript
Random Event Teleport
RMXP Leistungstest
Single Rotate
Split Screen (Beta)
Tutorials:
'alias' Bug beheben
Eigenes RTP
Standard KS komplett Übersetzen
RGSS: Eigener HUD
Programme:
Maker Exchange [ MEX ]
RMXP Skript Explorer
RPGXP Code Converter
Spiele:
[Minispiel] Stampfi V1.5 (Gold)
[Minispiel] Mastermind XP
[Humor] Verfressene Klone
______________________________
[Zukunft] Evil Science
zum Lesen den Text mit der Maus markieren
Wie geht nicht?
Musst halt auch bei Game_Map diesen Code einfügen:
Musst das Problem mal genauer beschreiben (Fehlermeldung?)
Mfg Monsta
Musst halt auch bei Game_Map diesen Code einfügen:
|
|
Quellcode |
1 |
attr_reader :map |
Musst das Problem mal genauer beschreiben (Fehlermeldung?)
Mfg Monsta
Skripte:
Animations "Entruckler"
Console
Drunken Mode
Eventskript Debugger
Flat-Events
Impassable Script
Item Shortcut
MSS: Monsta's Shoot System (Neu)
Radius Skript
Random Event Teleport
RMXP Leistungstest
Single Rotate
Split Screen (Beta)
Tutorials:
'alias' Bug beheben
Eigenes RTP
Standard KS komplett Übersetzen
RGSS: Eigener HUD
Programme:
Maker Exchange [ MEX ]
RMXP Skript Explorer
RPGXP Code Converter
Spiele:
[Minispiel] Stampfi V1.5 (Gold)
[Minispiel] Mastermind XP
[Humor] Verfressene Klone
______________________________
[Zukunft] Evil Science
zum Lesen den Text mit der Maus markieren
also ich weiß erstens nicht, was ich für x == X einsetzen muss..
Da muss ja irgendwo noch die y Variable abgefragt werden.
ich benutze das pathfinding script.
Das hier:
Ist es nicht möglich abzufragen ob das Event am Ort angekommen ist.
Und das halt in einem Call Script?
Da muss ja irgendwo noch die y Variable abgefragt werden.
ich benutze das pathfinding script.
Das hier:
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
#==============================================================================
# ¦ Path Finding
# By: Near Fantastica
# Date: 24.09.05
# Version: 1
#
# Player :: $game_player.find_path(x,y)
# Event Script Call :: self.event.find_path(x,y)
# Event Movement Script Call :: self.find_path(x,y)
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
alias pf_game_character_initialize initialize
alias pf_game_character_update update
#--------------------------------------------------------------------------
attr_accessor :map
attr_accessor :runpath
#--------------------------------------------------------------------------
def initialize
pf_game_character_initialize
@map = nil
@runpath = false
end
#--------------------------------------------------------------------------
def update
run_path if @runpath == true
pf_game_character_update
end
#--------------------------------------------------------------------------
def run_path
return if moving?
step = @map[@x,@y]
if step == 1
@map = nil
@runpath = false
return
end
dir = rand(2)
case dir
when 0
move_right if @map[@x+1,@y] == step - 1 and step != 0
move_down if @map[@x,@y+1] == step - 1 and step != 0
move_left if @map[@x-1,@y] == step -1 and step != 0
move_up if @map[@x,@y-1] == step - 1 and step != 0
when 1
move_up if @map[@x,@y-1] == step - 1 and step != 0
move_left if @map[@x-1,@y] == step -1 and step != 0
move_down if @map[@x,@y+1] == step - 1 and step != 0
move_right if @map[@x+1,@y] == step - 1 and step != 0
end
end
#--------------------------------------------------------------------------
def find_path(x,y)
sx, sy = @x, @y
result = setup_map(sx,sy,x,y)
@runpath = result[0]
@map = result[1]
@map[sx,sy] = result[2] if result[2] != nil
end
#--------------------------------------------------------------------------
def setup_map(sx,sy,ex,ey)
map = Table.new($game_map.width, $game_map.height)
map[ex,ey] = 1
old_positions = []
new_positions = []
old_positions.push([ex, ey])
depth = 2
depth.upto(100){|step|
loop do
break if old_positions[0] == nil
x,y = old_positions.shift
return [true, map, step] if x == sx and y+1 == sy
if $game_player.passable?(x, y, 2) and map[x,y + 1] == 0
map[x,y + 1] = step
new_positions.push([x,y + 1])
end
return [true, map, step] if x-1 == sx and y == sy
if $game_player.passable?(x, y, 4) and map[x - 1,y] == 0
map[x - 1,y] = step
new_positions.push([x - 1,y])
end
return [true, map, step] if x+1 == sx and y == sy
if $game_player.passable?(x, y, 6) and map[x + 1,y] == 0
map[x + 1,y] = step
new_positions.push([x + 1,y])
end
return [true, map, step] if x == sx and y-1 == sy
if $game_player.passable?(x, y, 8) and map[x,y - 1] == 0
map[x,y - 1] = step
new_positions.push([x,y - 1])
end
end
old_positions = new_positions
new_positions = []
}
return [false, nil, nil]
end
end
class Interpreter
#--------------------------------------------------------------------------
def event
return $game_map.events[@event_id]
end
end |
Ist es nicht möglich abzufragen ob das Event am Ort angekommen ist.
Und das halt in einem Call Script?
Signatur! Hier könnte deine Werbung sthehen!
Signatur!
Signatur!
Achso... es soll nur für ein Event sein.
Ich denke das ist selbsterklärend -.-
|
|
Quellcode |
1 2 3 4 5 6 7 |
class Interpreter # By Monsta 9.1.2007
def event_coordinates (id,x,y)
if $game_map.map.events[id].x == x and $game_map.map.events[id].y == y
$game_temp.common_event_id = 1
end
end
end |
Ich denke das ist selbsterklärend -.-
Skripte:
Animations "Entruckler"
Console
Drunken Mode
Eventskript Debugger
Flat-Events
Impassable Script
Item Shortcut
MSS: Monsta's Shoot System (Neu)
Radius Skript
Random Event Teleport
RMXP Leistungstest
Single Rotate
Split Screen (Beta)
Tutorials:
'alias' Bug beheben
Eigenes RTP
Standard KS komplett Übersetzen
RGSS: Eigener HUD
Programme:
Maker Exchange [ MEX ]
RMXP Skript Explorer
RPGXP Code Converter
Spiele:
[Minispiel] Stampfi V1.5 (Gold)
[Minispiel] Mastermind XP
[Humor] Verfressene Klone
______________________________
[Zukunft] Evil Science
zum Lesen den Text mit der Maus markieren
Also jetzt kommt kein Fehler mehr, aber es passiert irgendwie nichts, wenn das Event angekommen ist.. ich hab das mit dem 1.Common Event aufs 4. geänder.
und einfach ne Message geschrieben, die dann ja auftauchen müsste, tut sie aber nicht :-D
also ich hab das jetzt so gemacht:
und einfach ne Message geschrieben, die dann ja auftauchen müsste, tut sie aber nicht :-D
also ich hab das jetzt so gemacht:
|
|
Quellcode |
1 2 3 4 5 6 7 |
class Interpreter # By Monsta 9.1.2007
def event_coordinates (id,x,y)
if $game_map.map.events[id].x == 8 and $game_map.map.events[id].y == 33
$game_temp.common_event_id = 4
end
end
end |
Signatur! Hier könnte deine Werbung sthehen!
Signatur!
Signatur!
Du solltest x und y nicht nicht im Skript ändern!!!
Nimm das Skript was ich vorhin gepostet habe und rufe es so im Event Skript auf:
Nimm das Skript was ich vorhin gepostet habe und rufe es so im Event Skript auf:
|
|
Quellcode |
1 |
event_coordinates(deine_id,8,33) |
Skripte:
Animations "Entruckler"
Console
Drunken Mode
Eventskript Debugger
Flat-Events
Impassable Script
Item Shortcut
MSS: Monsta's Shoot System (Neu)
Radius Skript
Random Event Teleport
RMXP Leistungstest
Single Rotate
Split Screen (Beta)
Tutorials:
'alias' Bug beheben
Eigenes RTP
Standard KS komplett Übersetzen
RGSS: Eigener HUD
Programme:
Maker Exchange [ MEX ]
RMXP Skript Explorer
RPGXP Code Converter
Spiele:
[Minispiel] Stampfi V1.5 (Gold)
[Minispiel] Mastermind XP
[Humor] Verfressene Klone
______________________________
[Zukunft] Evil Science
zum Lesen den Text mit der Maus markieren
Es passiert immer noch nichts..
Ich hab jetzt ins Event diesen code gemacht:
Und über Main:
da müsste dann doch als Windows-Message Hey kommen oder? Ich hab KA von RGSS
Ich hab jetzt ins Event diesen code gemacht:
|
|
Quellcode |
1 |
event_coordinates(001,8,33) |
Und über Main:
|
|
Quellcode |
1 2 3 4 5 6 7 |
class Interpreter # By Monsta 9.1.2007
def event_coordinates (id,x,y)
if $game_map.map.events[id].x == x and $game_map.map.events[id].y == y
p "hey"
end
end
end |
da müsste dann doch als Windows-Message Hey kommen oder? Ich hab KA von RGSS
Signatur! Hier könnte deine Werbung sthehen!
Signatur!
Signatur!
Hm... überprüfe mal ob die Bedingung auch erfüllt wird...
Ich weiß nicht ob das 001 eine rolle spielt versuchs mal einfach mit 1.
Und hast du X und das y durch zahlen ersetzt? Bsp.:
Ich weiß nicht ob das 001 eine rolle spielt versuchs mal einfach mit 1.
Und hast du X und das y durch zahlen ersetzt? Bsp.:
|
|
Quellcode |
1 2 3 4 5 6 7 |
class Interpreter # By Monsta 9.1.2007
def event_coordinates (id,x,y)
if $game_map.map.events[id].x == 5 and $game_map.map.events[id].y == 13
p "hey"
end
end
end |

Zitat von »"darkness666"«
Und hast du X und das y durch zahlen ersetzt? Bsp.:
![]()
Quellcode
1 2 3 4 5 6 7class Interpreter # By Monsta 9.1.2007 def event_coordinates (id,x,y) if $game_map.map.events[id].x == 5 and $game_map.map.events[id].y == 13 p "hey" end end end
Wieso das denn? Es sind doch extra Parameter angegeben!
Und da ich nicht weiss was du falsch machst, hab ich jetzt einfach mal nen Testprojekt gemacht:
Der Rothaarige überprüft ob das 1. Event auf den Koordinaten (4|3) steht.
Wenn ja kommt ein Hey. Und er steht auf 4,3
EDIT: Sorry Darkness, habs zu spät abgeschickt...
EDIT2: Hab den Anhang mal gelöscht, es wird sich ja beschwert das deswegen so viel Platz verlorern geht...
Mfg Monsta
Skripte:
Animations "Entruckler"
Console
Drunken Mode
Eventskript Debugger
Flat-Events
Impassable Script
Item Shortcut
MSS: Monsta's Shoot System (Neu)
Radius Skript
Random Event Teleport
RMXP Leistungstest
Single Rotate
Split Screen (Beta)
Tutorials:
'alias' Bug beheben
Eigenes RTP
Standard KS komplett Übersetzen
RGSS: Eigener HUD
Programme:
Maker Exchange [ MEX ]
RMXP Skript Explorer
RPGXP Code Converter
Spiele:
[Minispiel] Stampfi V1.5 (Gold)
[Minispiel] Mastermind XP
[Humor] Verfressene Klone
______________________________
[Zukunft] Evil Science
zum Lesen den Text mit der Maus markieren
Ja die Koordinaten sind 100% richtig
Ich benutz ja das pathfinding script. (Siehe vorige Posts)
Der Charakter geht dahin:
Gibts nicht irgendeine Möglichkeit jetzt zu fragen ob der chrakter sein Ziel erreicht hat?
EDIT:
Also ich hab mal dein testprojekt in mein spiel eingefügt und es hat geklappt.
aber wenn ich jetzt mit hilfe des pathfinding scriptes das Event z.B. auf Koordinaten 8,33 schicke, (Habe zuvor alle nötigen sachen im script geändert(Also auch diese Koordinaten genommen)) geht es schon nicht mehr
Ich vermute das es mit dem pathfinding script zusammen hängt..
Ich benutz ja das pathfinding script. (Siehe vorige Posts)
Der Charakter geht dahin:
|
|
Quellcode |
1 |
self.event.find_path(8,33) |
Gibts nicht irgendeine Möglichkeit jetzt zu fragen ob der chrakter sein Ziel erreicht hat?
EDIT:
Also ich hab mal dein testprojekt in mein spiel eingefügt und es hat geklappt.
aber wenn ich jetzt mit hilfe des pathfinding scriptes das Event z.B. auf Koordinaten 8,33 schicke, (Habe zuvor alle nötigen sachen im script geändert(Also auch diese Koordinaten genommen)) geht es schon nicht mehr

Ich vermute das es mit dem pathfinding script zusammen hängt..
Signatur! Hier könnte deine Werbung sthehen!
Signatur!
Signatur!
Jupp es liegt am Pathfinding.
Aus irgendeinem Grund werden die Koordinaten vom Event nicht aktualisiert...
Mal sehen wie man das ändern kann.
Aus irgendeinem Grund werden die Koordinaten vom Event nicht aktualisiert...
Mal sehen wie man das ändern kann.
Skripte:
Animations "Entruckler"
Console
Drunken Mode
Eventskript Debugger
Flat-Events
Impassable Script
Item Shortcut
MSS: Monsta's Shoot System (Neu)
Radius Skript
Random Event Teleport
RMXP Leistungstest
Single Rotate
Split Screen (Beta)
Tutorials:
'alias' Bug beheben
Eigenes RTP
Standard KS komplett Übersetzen
RGSS: Eigener HUD
Programme:
Maker Exchange [ MEX ]
RMXP Skript Explorer
RPGXP Code Converter
Spiele:
[Minispiel] Stampfi V1.5 (Gold)
[Minispiel] Mastermind XP
[Humor] Verfressene Klone
______________________________
[Zukunft] Evil Science
zum Lesen den Text mit der Maus markieren
Ich nehm alles zurück... 
Mir ist da ein kleiner Fehler im Skript unterlaufen:
Nimm dieses und es funktioniert.

Mir ist da ein kleiner Fehler im Skript unterlaufen:
|
|
Quellcode |
1 2 3 4 5 6 7 |
class Interpreter # By Monsta 9.1.2007
def event_coordinates(id,x,y)
if $game_map.events[id].x == x and $game_map.events[id].y == y
p "hey"
end
end
end |
Nimm dieses und es funktioniert.
Skripte:
Animations "Entruckler"
Console
Drunken Mode
Eventskript Debugger
Flat-Events
Impassable Script
Item Shortcut
MSS: Monsta's Shoot System (Neu)
Radius Skript
Random Event Teleport
RMXP Leistungstest
Single Rotate
Split Screen (Beta)
Tutorials:
'alias' Bug beheben
Eigenes RTP
Standard KS komplett Übersetzen
RGSS: Eigener HUD
Programme:
Maker Exchange [ MEX ]
RMXP Skript Explorer
RPGXP Code Converter
Spiele:
[Minispiel] Stampfi V1.5 (Gold)
[Minispiel] Mastermind XP
[Humor] Verfressene Klone
______________________________
[Zukunft] Evil Science
zum Lesen den Text mit der Maus markieren
