Autor Beitrag
Fabian E.
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 554

Windows 7 Ultimate
Visual Studio 2008 Pro, Visual Studion 2010 Ultimate
BeitragVerfasst: Do 08.03.07 22:26 
Hallo!

Hab ein problem mit fears engine!
ich möchte eine klasse deklarieren welche von TSimpleObject abgeleitet ist.
Beim zeichnen gibt er mir aber einen zugriffsfehler...woran könnte das liegen?
an der klasse? ich hoffe mal nicht...
ich denke ich habe alles richtig gemacht, andere objekte werden auch gezeichnet!

Vielen Dank!
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Do 08.03.07 22:39 
Ich stelle jetzt eine Waghalsige Behauptung auf: Der Fehler liegt in deinem Code :!: :wink:

PS: Mehr wolltste ja nich wissen

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Fabian E. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 554

Windows 7 Ultimate
Visual Studio 2008 Pro, Visual Studion 2010 Ultimate
BeitragVerfasst: Fr 09.03.07 06:09 
also okay ich weiß jetzt woran es liegt... beim createn wird dem object keine Engine zugewiesen...
keine ahnung warum... :nixweiss: Manuelle zuweisung geht auch nicht...
Weiß jemand warum das so sein könnte?

Ich habe ein Array of TCreep wobei TCreep = class(TSimpleObject) ist.
mit einem Creep: TCreep; geht es...das heißt es liegt wohl am array...
kann mir da jemand helfen?

Vielen dank!
Fabian E. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 554

Windows 7 Ultimate
Visual Studio 2008 Pro, Visual Studion 2010 Ultimate
BeitragVerfasst: Fr 09.03.07 06:43 
okay also die engine scheint allgemein probleme mit array zu haben...
wenn ich meiner klasse eine eigenschaft Object1: TSimpleObject; gebe kommt der gleiche fehler :cry:
immer zugriffsverletzung... :(
HelgeLange
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 735
Erhaltene Danke: 6

Windows 7
Delphi7 - Delphi XE
BeitragVerfasst: Fr 09.03.07 09:30 
dann schau doch, woran es liegt und fix es ?
Ich sage mir immer (nein, das hat nicht zu mir so Mutti gesagt!) : Wenn Du eine Engine nicht halbwegs verstehst, dann solltest Du nicht damit programmieren.

_________________
"Ich bin bekannt für meine Ironie. Aber auf den Gedanken, im Hafen von New York eine Freiheitsstatue zu errichten, wäre selbst ich nicht gekommen." - George Bernhard Shaw
IngoD7
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 629


D7
BeitragVerfasst: Fr 09.03.07 09:52 
Weiß eigentlich jeder außer mir, was eine Fear-Engine ist? :?

Ansonsten @Fabian E.:
Selbst wenn jemand die Engine auswendig kennt, was du ja anscheinend voraussetzt, glaubst du wirklich es könne dir jemand helfen, ohne die entsprechenden Stellen des Codes zu sehen?

Du schreibst mit einem Creep geht es. Mit einem Array dieser Viecher kommst du aber nicht klar. Dann würde ich mal den Code posten, wo du das Array erstellst und seinen Elementen etwas zuweist. Dazu die Stelle, wo genau welcher Fehler auftriit, und man kann mal weiterschauen.
Fabian E. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 554

Windows 7 Ultimate
Visual Studio 2008 Pro, Visual Studion 2010 Ultimate
BeitragVerfasst: So 11.03.07 23:00 
also nochmal zum source:

die deklaration:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
TCreep = class(TSimpleObject)
  private
    Energie: Integer;
    Speed: Integer;
    Attribute: (Luft, Land);
    Dots: (Feuer, Eis);
    Direction: (oben,unten,links,rechts);
  end;
ausblenden Delphi-Quelltext
1:
Creep: Array of TCreep;					


das createn:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
procedure CreepInitalize(Anzahl: Integer; Art: Integer; Health: Integer);
Var i: Integer;
begin
  SetLength(Creep,Anzahl);
  for i := 0 to Anzahl-1 do
  begin
    Creep[i] := TCreep.Create(Engine);
    If i = 0
    Then Creep[i].Position.X := -90
    Else Creep[i].Position.X := Creep[i-1].Position.X-95;
    with Creep[i] do
    begin
      Energie := Health;
      Speed := 1;
      Direction:= rechts;
      Position.Y := 0;
      texture := 'turm';
      UseAlpha := true;
      Alpha := 255;
      Size.X := 50;
      Size.Y := 50;
    end;


das zeichnen:
ausblenden Delphi-Quelltext
1:
2:
3:
for i:= 0 to AnzahlCreeps-1 do
  begin
  Creep[i].Draw(true);


der fehler liegt wie gesagt darin, dass dem object keine engine zugewiesen wird...
und ja die engine gibt es zu dem zeitpunkt schon.
der eigentliche fehler kommt bei "translatef"...

Vielen dank!
HelgeLange
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 735
Erhaltene Danke: 6

Windows 7
Delphi7 - Delphi XE
BeitragVerfasst: So 11.03.07 23:11 
dann schau doch im Debugger, was passiert, wenn du das create aufrufst, du gibst ja scheinbar eine Engine als Owner mit. Gibt es die Engine denn schon zu dem Zeitpunkt ? Wenn ja, was macht dein Vorfahre mit dieser Information ?

_________________
"Ich bin bekannt für meine Ironie. Aber auf den Gedanken, im Hafen von New York eine Freiheitsstatue zu errichten, wäre selbst ich nicht gekommen." - George Bernhard Shaw
IngoD7
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 629


D7
BeitragVerfasst: So 11.03.07 23:57 
user profile iconFabian E. hat folgendes geschrieben:

der eigentliche fehler kommt bei "translatef"...

:( Und wo und was ist das schon wieder??
Mensch Fabian, wir sind doch keine Hellseher ...
Fabian E. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 554

Windows 7 Ultimate
Visual Studio 2008 Pro, Visual Studion 2010 Ultimate
BeitragVerfasst: Mo 12.03.07 15:27 
schon mal mit OGL beschäftigt? dann sollte dir das nämlich bekannt vorkommen ;)
damit habe ich eigentlich nur die stelle in den units von fear angegeben ;)
hat mit dem problem nix zu tun, weiß ja woran es liegt...
nur halt keine lösung... :(
wär nett wenn fear selber mal was dazu schreiben würde! :)

MfG

//EDIT: @Helgelange:


user profile iconFabian E. hat folgendes geschrieben:
und ja die engine gibt es zu dem zeitpunkt schon.


;)

was passiert ist ganz einfach: es passiert gar nichts...
alles ganz normal nur das bei dem array die engine nicht übergeben wird...
hat jemand vllt eine andere idee statt den array? :(
vllt sogar was schnelleres?
Wär echt schön!
HelgeLange
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 735
Erhaltene Danke: 6

Windows 7
Delphi7 - Delphi XE
BeitragVerfasst: Mo 12.03.07 15:38 
ich meinte, du sollst mal in das Create rein-debuggen, nicht nur über den Befehl drübergehen. Schaun, was er mit dem Parameter macht, ob er ihn in Listen einträgt etc...

_________________
"Ich bin bekannt für meine Ironie. Aber auf den Gedanken, im Hafen von New York eine Freiheitsstatue zu errichten, wäre selbst ich nicht gekommen." - George Bernhard Shaw
IngoD7
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 629


D7
BeitragVerfasst: Mo 12.03.07 15:40 
Na dann viel Spaß noch.
Fabian E. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 554

Windows 7 Ultimate
Visual Studio 2008 Pro, Visual Studion 2010 Ultimate
BeitragVerfasst: Mo 12.03.07 15:49 
okay...werd ich sobald ich wieder an meinem pc bin tun :)