Main Menu

The "why won't this work" thread.

Started by Draco9898, August 07, 2007, 06:25:36 PM

Previous topic - Next topic

Draco9898

Why doesn't this work?


TYPE tAssist
alive, X#, Y#
ENDTYPE
TYPE tPlayerChar
Assist(2) AS tassist
ENDTYPE
Dim PlayerChar AS tPlayerChar
PlayerChar.Assist(2).X# = 1
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

kevin


Draco9898

thought so, would be interesting though, wouldn't it
guess I'll just do this:

TYPE tPlayerChar
   Assistalive(2)
   AssistX#(2)
   AssistY#(2)
ENDTYPE
Dim PlayerChar AS tPlayerChar
PlayerChar.AssistX#(2) = 1
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

kevin


PlayerChar.AssistX#(2) = 1

That won't work either :)

You can't mix data with static arrays ATM, so it needs to be

PlayerChar.AssistX#(2) = 1.0

So it's moving a float to float


Draco9898

#4
Ok, I got a new one. Why won't THIS example work?

I'm going to be stuck if I can't get this to work.

`~~~~Enemies~~~~
Type BasicEnemy
alive, life, defense#
variation
animstate
X#, Y#
XVelo#, YVelo#
Angle#,Anglevelo#
Direction
sprite, spriteMode, curimage
FireRate#, ShootTime#, shootTimer#, shootBeginTime#
FlashTimeSET#, FlashBTime#, FlashTimer#
EndType
`A special type
Type AlienSerpent As BasicEnemy
SinVal1#, SinVal2#
SegX
Segz#(23)
SegY#(8)
   EndType

Dim EnemyCol(1) As BasicEnemy

EnemyCol(1) = New AlienSerpent

Dim typedpointer As AlienSerpent Pointer
typedpointer =EnemyCol(index).BasicEnemy

`works
typedpointer.SinVal1# = 56.0   `don't forget it must float
print typedpointer.SinVal1#
`works
typedpointer.SegX = 52
print typedpointer.SegX

`doesn't work!?
typedpointer.Segz#(23) =242.0

sync
waitkey
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

kevin

#5
 not supported. (yet :) )

kevin


Rembrandt Q Einstein

Awesome.  I just wanted to make sure you know Kevin that Draco wasn't the only one interested in inheritance/pointer improvements.  I often have random arrays lying around outside my types due to problems like these.




Draco9898

hey cool, what version is this going to be supported in?
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

kevin


kevin

#10
or

Pb1.63m (login required)