djeurissen
21.05.2011, 16:30
Edit: Ups, sry falsches Forum :(
Hi,
auch wenn es eigentlich wegen Variablen nicht so gut ist ein Path finding System zu machen, habe ich mich trotzdem drangesetzt (mit dem Rpg Maker Ultimate um genug Variablen für mehr Npc's zu haben^^).
Klappt soweit auch alles, und zurzeit weicht mein Npc auch den Wänden aus. Um den Npc weniger vorhersebar zu machen habe ich einen Zufall eingebaut der ihn jeweils in eine andere Richtung laufen lässt.
Das Problem ist ist wenn die Wand über dem Helden ist und er nach Links geht klappt alles, wenn er aber nach rechts geht, geht er immer wieder nach ner Zeit nach Links.
Aber ich habe keine Ahnung warum da beide Skripts so gut wie Identisch sind:
--- EVENT ---
Type: Map event
Name: Held finden Test
Coordinates: (1, 0)
Number of Pages: 1
-- PAGE 1 --
Start conditions:
<None>
Sprite: <Tileset> #0
Facing direction: Down
Animation frame: Center
Transparent: No
Trigger condition: Parallel process
Event level: Below hero
Forbid event overlap: No
Animation type: Non-continuous
Movement type: Stationary
Movement frequency: 3
Movement speed: 3
- SCRIPT -
<> Label: 5
<> Change Variable: [3] = X position on map (tiles) of event #1
<> Change Variable: [4] = Y position on map (tiles) of event #1
<> Fork Condition: If Variable [1] > V[3] then ...
. <> Move Event: Event #0, Frq 8, Pattern: Mv right
. <>
: Else ...
. <>
: End of fork
<> Fork Condition: If Variable [1] < V[3] then ...
. <> Move Event: Event #0, Frq 8, Pattern: Mv left
. <>
: Else ...
. <>
: End of fork
<> Fork Condition: If Variable [2] < V[4] then ...
. <> Change Variable: [4] -= 1
. <> Get Terrain ID: (V[3], V[4]), Store in var. [5]
. <> Fork Condition: If Variable [5] == 2 then ...
. . <> Show Message: olo
. . <> Change Variable: [6] = Random [1-2]
. . <> Label: 2
. . <> Change Variable: [3] = X position on map (tiles) of event #1
. . <> Change Variable: [4] = Y position on map (tiles) of event #1
. . <> Fork Condition: If Variable [6] == 1 then ...
. . . <> Label: 7
. . . <> Change Variable: [4] -= 1
. . . <> Get Terrain ID: (V[3], V[4]), Store in var. [5]
. . . <> Fork Condition: If Variable [5] == 1 then ...
. . . . <> Jump To Label: 5
. . . . <>
. . . : Else ...
. . . . <>
. . . : End of fork
. . . <> Change Variable: [3] = X position on map (tiles) of event #1
. . . <> Change Variable: [4] = Y position on map (tiles) of event #1
. . . <> Change Variable: [3] += 1
. . . <> Get Terrain ID: (V[3], V[4]), Store in var. [5]
. . . <> Fork Condition: If Variable [5] == 2 then ...
. . . . <> Jump To Label: 6
. . . . <> Change Variable: [3] = X position on map (tiles) of event #1
. . . . <> Change Variable: [4] = Y position on map (tiles) of event #1
. . . . <> Change Variable: [3] -= 1
. . . . <>
. . . : Else ...
. . . . <>
. . . : End of fork
. . . <> Fork Condition: If Variable [5] == 1 then ...
. . . . <> Move Event: Event #0, Frq 8, Pattern: Mv right
. . . . <>
. . . : Else ...
. . . . <>
. . . : End of fork
. . . <>
. . : Else ...
. . . <>
. . : End of fork
. . <> Fork Condition: If Variable [6] == 2 then ...
. . . <> Label: 6
. . . <> Change Variable: [4] -= 1
. . . <> Get Terrain ID: (V[3], V[4]), Store in var. [5]
. . . <> Fork Condition: If Variable [5] == 1 then ...
. . . . <> Jump To Label: 5
. . . . <>
. . . : Else ...
. . . . <>
. . . : End of fork
. . . <> Change Variable: [3] = X position on map (tiles) of event #1
. . . <> Change Variable: [4] = Y position on map (tiles) of event #1
. . . <> Change Variable: [3] -= 1
. . . <> Get Terrain ID: (V[3], V[4]), Store in var. [5]
. . . <> Fork Condition: If Variable [5] == 2 then ...
. . . . <> Jump To Label: 7
. . . . <> Change Variable: [3] = X position on map (tiles) of event #1
. . . . <> Change Variable: [4] = Y position on map (tiles) of event #1
. . . . <> Change Variable: [3] += 1
. . . . <>
. . . : Else ...
. . . . <>
. . . : End of fork
. . . <> Label: 4
. . . <> Fork Condition: If Variable [5] == 1 then ...
. . . . <> Move Event: Event #0, Frq 8, Pattern: Mv left
. . . . <>
. . . : Else ...
. . . . <>
. . . : End of fork
. . . <>
. . : Else ...
. . . <>
. . : End of fork
. . <> Jump To Label: 2
. . <>
. : Else ...
. . <>
. : End of fork
. <> Move Event: Event #0, Frq 8, Pattern: Mv up
. <>
: Else ...
. <>
: End of fork
<> Fork Condition: If Variable [2] > V[4] then ...
. <> Move Event: Event #0, Frq 8, Pattern: Mv down
. <>
: Else ...
. <>
: End of fork
<> Label: 1
<>
Zur info das mit den Label 6 und 7 habe ich gemacht um nicht soviel mit den Maker rumzuwusseln auch wenn es mich später 2 Variablen mehr kostet^^.
Und sollte es besser gehen braucht ihr es mir nicht zu sagen, ich mache das einfach nur zum Spaß und es soll nicht perfekt sein^^.
Edit: Und die Message war zum finden eines Bugs da und ich habe sie noch nicht entfernt^^
Hi,
auch wenn es eigentlich wegen Variablen nicht so gut ist ein Path finding System zu machen, habe ich mich trotzdem drangesetzt (mit dem Rpg Maker Ultimate um genug Variablen für mehr Npc's zu haben^^).
Klappt soweit auch alles, und zurzeit weicht mein Npc auch den Wänden aus. Um den Npc weniger vorhersebar zu machen habe ich einen Zufall eingebaut der ihn jeweils in eine andere Richtung laufen lässt.
Das Problem ist ist wenn die Wand über dem Helden ist und er nach Links geht klappt alles, wenn er aber nach rechts geht, geht er immer wieder nach ner Zeit nach Links.
Aber ich habe keine Ahnung warum da beide Skripts so gut wie Identisch sind:
--- EVENT ---
Type: Map event
Name: Held finden Test
Coordinates: (1, 0)
Number of Pages: 1
-- PAGE 1 --
Start conditions:
<None>
Sprite: <Tileset> #0
Facing direction: Down
Animation frame: Center
Transparent: No
Trigger condition: Parallel process
Event level: Below hero
Forbid event overlap: No
Animation type: Non-continuous
Movement type: Stationary
Movement frequency: 3
Movement speed: 3
- SCRIPT -
<> Label: 5
<> Change Variable: [3] = X position on map (tiles) of event #1
<> Change Variable: [4] = Y position on map (tiles) of event #1
<> Fork Condition: If Variable [1] > V[3] then ...
. <> Move Event: Event #0, Frq 8, Pattern: Mv right
. <>
: Else ...
. <>
: End of fork
<> Fork Condition: If Variable [1] < V[3] then ...
. <> Move Event: Event #0, Frq 8, Pattern: Mv left
. <>
: Else ...
. <>
: End of fork
<> Fork Condition: If Variable [2] < V[4] then ...
. <> Change Variable: [4] -= 1
. <> Get Terrain ID: (V[3], V[4]), Store in var. [5]
. <> Fork Condition: If Variable [5] == 2 then ...
. . <> Show Message: olo
. . <> Change Variable: [6] = Random [1-2]
. . <> Label: 2
. . <> Change Variable: [3] = X position on map (tiles) of event #1
. . <> Change Variable: [4] = Y position on map (tiles) of event #1
. . <> Fork Condition: If Variable [6] == 1 then ...
. . . <> Label: 7
. . . <> Change Variable: [4] -= 1
. . . <> Get Terrain ID: (V[3], V[4]), Store in var. [5]
. . . <> Fork Condition: If Variable [5] == 1 then ...
. . . . <> Jump To Label: 5
. . . . <>
. . . : Else ...
. . . . <>
. . . : End of fork
. . . <> Change Variable: [3] = X position on map (tiles) of event #1
. . . <> Change Variable: [4] = Y position on map (tiles) of event #1
. . . <> Change Variable: [3] += 1
. . . <> Get Terrain ID: (V[3], V[4]), Store in var. [5]
. . . <> Fork Condition: If Variable [5] == 2 then ...
. . . . <> Jump To Label: 6
. . . . <> Change Variable: [3] = X position on map (tiles) of event #1
. . . . <> Change Variable: [4] = Y position on map (tiles) of event #1
. . . . <> Change Variable: [3] -= 1
. . . . <>
. . . : Else ...
. . . . <>
. . . : End of fork
. . . <> Fork Condition: If Variable [5] == 1 then ...
. . . . <> Move Event: Event #0, Frq 8, Pattern: Mv right
. . . . <>
. . . : Else ...
. . . . <>
. . . : End of fork
. . . <>
. . : Else ...
. . . <>
. . : End of fork
. . <> Fork Condition: If Variable [6] == 2 then ...
. . . <> Label: 6
. . . <> Change Variable: [4] -= 1
. . . <> Get Terrain ID: (V[3], V[4]), Store in var. [5]
. . . <> Fork Condition: If Variable [5] == 1 then ...
. . . . <> Jump To Label: 5
. . . . <>
. . . : Else ...
. . . . <>
. . . : End of fork
. . . <> Change Variable: [3] = X position on map (tiles) of event #1
. . . <> Change Variable: [4] = Y position on map (tiles) of event #1
. . . <> Change Variable: [3] -= 1
. . . <> Get Terrain ID: (V[3], V[4]), Store in var. [5]
. . . <> Fork Condition: If Variable [5] == 2 then ...
. . . . <> Jump To Label: 7
. . . . <> Change Variable: [3] = X position on map (tiles) of event #1
. . . . <> Change Variable: [4] = Y position on map (tiles) of event #1
. . . . <> Change Variable: [3] += 1
. . . . <>
. . . : Else ...
. . . . <>
. . . : End of fork
. . . <> Label: 4
. . . <> Fork Condition: If Variable [5] == 1 then ...
. . . . <> Move Event: Event #0, Frq 8, Pattern: Mv left
. . . . <>
. . . : Else ...
. . . . <>
. . . : End of fork
. . . <>
. . : Else ...
. . . <>
. . : End of fork
. . <> Jump To Label: 2
. . <>
. : Else ...
. . <>
. : End of fork
. <> Move Event: Event #0, Frq 8, Pattern: Mv up
. <>
: Else ...
. <>
: End of fork
<> Fork Condition: If Variable [2] > V[4] then ...
. <> Move Event: Event #0, Frq 8, Pattern: Mv down
. <>
: Else ...
. <>
: End of fork
<> Label: 1
<>
Zur info das mit den Label 6 und 7 habe ich gemacht um nicht soviel mit den Maker rumzuwusseln auch wenn es mich später 2 Variablen mehr kostet^^.
Und sollte es besser gehen braucht ihr es mir nicht zu sagen, ich mache das einfach nur zum Spaß und es soll nicht perfekt sein^^.
Edit: Und die Message war zum finden eines Bugs da und ich habe sie noch nicht entfernt^^