View Single Post
Old 15 June 2022, 11:37   #11
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,356
Weirdness... I don't know what's going on there, but some people have reported Amiblitz 3.9 as being a little unstable and have had better luck with 3.8.0. It might be worth trying that instead. Also, bear in mind that you shouldn't install AmiBlitz as an update to an earlier version, but in a separate directory.

Edit: As for your question about Newtypes, it's a little confusing what you're trying to do. You can have nested Newtypes, and Newtypes can contain an array, but that array must be 1-dimensional, and is designated with square brackets instead. You need to define your Newtypes to include the array of the previous Newtypes to nest them. For example:

Code:
NEWTYPE .frames
  piv_x.q
  piv_y.q
  height.q
  width.q
End NEWTYPE

NEWTYPE .animations
  n_anim.w
  name_anim.s
  speed_anim.q
  length_anim.q
  anim_sequence.q[100]
  frame.frames[2]
End NEWTYPE

NEWTYPE .chars
  name.s
  x.q
  y.q
  animation.w
  energy.w
  animation.animations[2]
End NEWTYPE

Dim char.chars(1)


char(player)\x = 10
char(player)\animation(curr_anim)\n_anim = 0
char(player)\animation(curr_anim)\frame[0]\width = 0

char(player)\animation(curr_anim)\anim_sequence[0] = 0
Now, that *should* work (note I've also changed the $ to .s for strings inside the Newtype), though it feels like there might be a more efficient way of doing it. But only you know the layout of your game data so you can make that call

Last edited by Daedalus; 15 June 2022 at 12:25.
Daedalus is offline  
 
Page generated in 0.05482 seconds with 11 queries