Problem mit Types
Übersicht

mDaveBetreff: Problem mit Types |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Hallo Community,
wie so viele habe ich auch Probleme mit Types. Die Suchfunktion habe ich bereits genutzt, jedoch nichts gefunden was mein Problem beseitigen könnte. Deshalb habe ich diesen Thread eröffnet. Aber nun zum Problem: Code: [AUSKLAPPEN] Type gegner Field tempo Field mass Field startx Field starty End Type Function platzieren() g.gegner=New gegner:LoadAnimMesh("Modelle/Spieler/spielerschlag!.3ds") g\startx=Rand(-100,100) g\starty=Rand(-100,100) g\mass=Rnd(0.01,0.02) ScaleEntity g.gegner,g\mass,g\mass,g\mass PositionEntity g.gegner,g\startx,1,g\starty End Function While Not KeyDown(1) For g.gegner = Each gegner PointEntity g.gegner,kamera g\starty= g\starty+0.05 MoveEntity g.gegner,0,0,g\starty Next Was habe ich hier bloß falsch gemacht? Ich hoffe ihr könnt helfen. |
||
![]() |
robotx |
![]() Antworten mit Zitat ![]() |
---|---|---|
Erstelle für dein 3DModel ein eigenes Feld
Code: [AUSKLAPPEN] ...
Field mesh ... und benutze diese Variable weiter und nicht g.gegner. mfg robotx |
||
www.botbomb.robotzgames.de
www.robotzgames.de |
![]() |
Chester |
![]() Antworten mit Zitat ![]() |
---|---|---|
Du speicherst ja das Handle des Objektes nirgends. Der Doppelpunkt ist in Blitzbasic keine Zuweisung, sondern ein Seperator für Funktionen in einer Zeile. Dann wird das Objekt zwar geladen, aber du kannst nicht darauf zugreifen, weil du das Handle nicht hast.
g.gegner ist dagegen das Handle des erstellten Types, weshalb es zu einem Zugriffsfehler kommen müsste, weil BB ein Handle eines 3D Objektes erwartet. |
||
mDave |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Danke!
BB gibt jetzt keine Fehlermeldung, allerdings wird das Modell nicht sichtbar. Code: [AUSKLAPPEN] Type gegner Field tempo Field mass Field startx Field starty Field aussehen End Type Function platzieren() g.gegner=New gegner g\aussehen=LoadAnimMesh("Modelle/Spieler/spielerschlag!.3ds") g\startx=Rand(-100,100) g\starty=Rand(-100,100) g\mass=Rnd(0.01,0.02) ScaleEntity g\aussehen,g\mass,g\mass,g\mass PositionEntity g\aussehen,g\startx,1,g\starty End Function While Not KeyDown(1) For g.gegner = Each gegner PointEntity g\aussehen,kamera g\starty= g\starty+0.05 MoveEntity g\aussehen,0,0,g\starty Next If KeyHit(8) Then platzieren() Es werden einfach keine Gegner platziert. |
||
![]() |
Nicdel |
![]() Antworten mit Zitat ![]() |
---|---|---|
Der Rest des Codes wäre sicher sinnvoll... ![]() |
||
Desktop: Intel Pentium 4 2650 Mhz, 2 GB RAM, ATI Radeon HD 3850 512 MB, Windows XP
Notebook: Intel Core i7 720 QM 1.6 Ghz, 4 GB DDR3 RAM, nVidia 230M GT, Windows 7 |
mDave |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Ok hier ist der Code:
Code: [AUSKLAPPEN] Graphics3D 1280,800,0,1 framer=CreateTimer(60) SetBuffer BackBuffer() Flip bnovacd=3200 dspherecd=1200 telecd=500 mana=1000 cd=5 hieb=1 streich=2 stich=3 kamera=CreateCamera(kamera) CameraRange kamera,0.1,5000000 PositionEntity kamera,0,1,0 EntityType kamera,1 CameraFogMode kamera,1 CameraFogRange kamera,1,1000000 Collisions 1,1,2,3 Collisions 2,2,2,3 Collisions 3,1,2,1 Collisions 5,1,1,1 spielerleben=3000 char=LoadAnimMesh("Modelle/Spieler/spielerschlag!.3ds") ScaleEntity char,0.00135,0.00135,0.00135 EntityParent char,kamera hieb=ExtractAnimSeq(char,1,40) streich=ExtractAnimSeq(char,41,63) stich=ExtractAnimSeq(char,61,100) typ=CreatePivot() PositionEntity typ,0,-11,0 EntityParent typ,kamera EntityType typ,1 aura=CreateLight(2,kamera) LightRange aura,3 LightColor aura,0,0,0 dsphere1=LoadSprite("Bilder/Dsphere1.bmp") ScaleSprite dsphere1,0.35,0.35 PositionEntity dsphere1,0,40000,0 HideEntity dsphere1 spherelight=CreateLight(2,dsphere1) LightColor spherelight,40,40,40 LightRange spherelight,3 dsphere2=LoadSprite("Bilder/Dsphere2.bmp") ScaleSprite dsphere2,0.3,0.3 PositionEntity dsphere2,0,40000,0 HideEntity dsphere2 dsphere3=LoadSprite("Bilder/Dsphere3.bmp") ScaleSprite dsphere3,0.25,0.25 PositionEntity dsphere3,0,40000,0 HideEntity dsphere3 dsphere4=LoadSprite("Bilder/Dsphere4.bmp") ScaleSprite dsphere4,0.2,0.2 PositionEntity dsphere4,0,40000,0 HideEntity dsphere4 musik=LoadSound("Spielmusik Saloon.wav") LoopSound musik PlaySound musik sl=LoadSound("luftkolben.wav") shott=LoadSound("kugel.wav") Include "Fähigkeiten/Spieler Nova.bb" schrift=LoadFont("Arial",21,False,False,False) ; Include "Fähigkeiten/Baron Blutbauch Laden.bb" ;Include "Fähigkeiten/Exotron Laden.bb" ;Include "Fähigkeiten/Golteron Laden.bb" Include "Fähigkeiten/Bonusrunde.bb" ;Include "Fähigkeiten/Mehrspielertraining.bb" Type gegner Field tempo Field mass Field startx Field starty Field aussehen End Type Type Schuss Field x Field y Field z Field s End Type Function platzieren() g.gegner=New gegner g\aussehen=LoadAnimMesh("Modelle/Spieler/spielerschlag!.3ds") g\startx=Rand(-100,100) g\starty=Rand(-100,100) g\mass=Rnd(0.01,0.03) ScaleEntity g\aussehen,g\mass,g\mass,g\mass PositionEntity g\aussehen,g\startx,1,g\starty End Function While Not KeyDown(1) For g.gegner = Each gegner PointEntity g\aussehen,kamera MoveEntity g\aussehen,0,0,0.05 Next platzieren() SeedRnd MilliSecs() zeit=AnimTime(char) If MouseHit(1) Then mausdruck1=1 If MouseHit(2) Then mausgedrueckt=1 If MouseHit(3) Then spezial=1 If KeyHit(18) Then benutzen=1 If MouseDown(1) Then s.schuss = New Schuss s\s = LoadSprite("Bilder/Meteorflamme.bmp") s\x = EntityX(kamera) s\y = EntityY(kamera) s\z = EntityZ(kamera) PositionEntity s\s, s\x-0.5, s\y -1,s\z RotateEntity s\s,EntityPitch(kamera),EntityYaw(kamera),EntityRoll(kamera) End If For s.schuss = Each schuss MoveEntity s\s,0,0,0.9 Next ra=Rand(1,3) If mausdruck1=1 And Animating(char)=0 And ra=1 Then PlaySound sl:Animate char,3,0.8,hieb If mausdruck1=1 And Animating(char)=0 And ra=2 Then PlaySound sl:Animate char,3,1,streich If mausdruck1=1 And Animating(char)=0 And ra=3 Then PlaySound sl:Animate char,3,0.7,stich If spezial=1 And Animating(char)=0 Then PlaySound sl:Animate char,3,0.3 If KeyHit(2) Then wf=1 If wf=1 Then WireFrame 1 If KeyHit(3) Then wf=0 If wf=0 Then WireFrame 0 crit=Rand(10,100) If mana<1001 Then mana=mana+2 If mana>1000 Then mana=1000 If bnovacd<3201 Then bnovacd=bnovacd+3 If bnovacd>3200 Then bnovacd=3200 If dspherecd<1201 Then dspherecd=dspherecd+8 If dspherecd>1200 Then dspherecd=1200 If telecd<501 Then telecd=telecd+16 If telecd>500 Then telecd=500 TranslateEntity kamera,0,-0.23,0 If KeyDown(17) Then MoveEntity kamera,0,0,0.14 If KeyDown(31) Then MoveEntity kamera,0,0,-0.05 If KeyDown(30) Then MoveEntity kamera,-0.06,0,0 If KeyDown(32) Then MoveEntity kamera,0.06,0,0 MausGeschwindigkeitX#=MausGeschwindigkeitX#-MouseXSpeed()/2 MausGeschwindigkeitY#=MausGeschwindigkeitY#+MouseYSpeed() If status=0 Then MoveMouse GraphicsWidth()/3,GraphicsHeight()/3 If MausGeschwindigkeitY#>+180 Then MausGeschwindigkeitY#=+180 If MausGeschwindigkeitY#<-180 Then MausGeschwindigkeitY#=-180 RotateEntity kamera,MausGeschwindigkeitY#/2,MausGeschwindigkeitX#/2,0 If KeyDown(57) And sprungz#<30 Then TranslateEntity kamera,0,-(sprungz#/12)+0.67,0:sprungz#=sprungz#+0.5 If EntityCollided(kamera,1)<>0 And KeyDown(57)=0 Then sprungz#=0 If KeyDown(57)=0 And EntityCollided(kamera,1)=0 Then sprungz#=90 If mausgedrueckt=1 And MouseZ()=1 And mana>250 And dspherecd>1199 Then dsphereruck=0 PositionEntity dsphere1,EntityX(kamera),EntityY(kamera),EntityZ(kamera) RotateEntity dsphere1,EntityPitch(kamera),EntityYaw(kamera),EntityRoll(kamera) ShowEntity dsphere1 PositionEntity dsphere2,EntityX(kamera),EntityY(kamera),EntityZ(kamera)-1 RotateEntity dsphere2,EntityPitch(kamera),EntityYaw(kamera),EntityRoll(kamera) ShowEntity dsphere2 PositionEntity dsphere3,EntityX(kamera),EntityY(kamera),EntityZ(kamera)-2 RotateEntity dsphere3,EntityPitch(kamera),EntityYaw(kamera),EntityRoll(kamera) ShowEntity dsphere3 PositionEntity dsphere4,EntityX(kamera),EntityY(kamera),EntityZ(kamera)-3 RotateEntity dsphere4,EntityPitch(kamera),EntityYaw(kamera),EntityRoll(kamera) ShowEntity dsphere4 mana=mana-250 dspherecd=0 End If PointEntity dsphere2,dsphere1 PointEntity dsphere3,dsphere2 PointEntity dsphere4,dsphere3 MoveEntity dsphere1,0,0,0.35 MoveEntity dsphere2,0,0,0.35 MoveEntity dsphere3,0,0,0.35 MoveEntity dsphere4,0,0,0.35 TurnEntity dsphere1,-0.1,0,0 If mausgedrueckt=1 And MouseZ()=3 And mana>100 And telecd>499 Then MoveEntity kamera,0,0,12:mana=mana-100:telecd=0 benutzen=0 mausdruck1=0 mausgedrueckt=0 spezial=0 If MouseZ()=0 Then zauber$="Kein Zauber ausgewählt" If MouseZ()=1 Then zauber$="Energieball" If MouseZ()=2 Then zauber$="Energienova" If MouseZ()=3 Then zauber$="Teleport" UpdateWorld RenderWorld SetFont schrift Text 600,30,zeit WaitTimer framer Flip Wend End Vielleicht erscheint er euch ein wenig unübersichtlich... |
||
![]() |
Nicdel |
![]() Antworten mit Zitat ![]() |
---|---|---|
Ich zweifle irgentwie am Sinn dieser Zeile:
Code: [AUSKLAPPEN] kamera=CreateCamera(kamera)
|
||
Desktop: Intel Pentium 4 2650 Mhz, 2 GB RAM, ATI Radeon HD 3850 512 MB, Windows XP
Notebook: Intel Core i7 720 QM 1.6 Ghz, 4 GB DDR3 RAM, nVidia 230M GT, Windows 7 |
mDave |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Leider ändert die Zeile nichts am Problem. | ||
![]() |
Chester |
![]() Antworten mit Zitat ![]() |
---|---|---|
Wird wohl an deiner Dimensionierung liegen.
Du verteilst ein Objekt, mit einem bis drei Hunderdstel seiner ursprünglichen Größe, auf einem Feld mit einer Größe von 200x200, wobei ca. 70% außerhalb des Sichtbereichs liegen. Also dürfte die Wahrscheinlichkeit, dass du irgendwelche Objekte sehen kannst, ziemlich gering sein. |
||
mDave |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Genau so war es Chester. Danke! | ||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group