Solved help implementing projectiles

Question that is answered or resolved.

kzr

Member
I asked in chat and was instructed to make a post, so here I am.

I tried following the wiki and tutorials from the community but my projectile is either not spawning or being destroyed so fast it doesn't even show up in debug mode.

I'm using custknife and throwframe, and the engine crashes if I use load instead of know for the projectile. I'm not able to send the log right away because I'm on my phone, but it stops saying it can't load the graphics, failing at the first frame at the idle animation.

the frames are gif files exported by jasc animation shop 3 and open in various editors and viewers without error.

am I doing something wrong?
 
I asked in chat and was instructed to make a post, so here I am.

I tried following the wiki and tutorials from the community but my projectile is either not spawning or being destroyed so fast it doesn't even show up in debug mode.

I'm using custknife and throwframe, and the engine crashes if I use load instead of know for the projectile. I'm not able to send the log right away because I'm on my phone, but it stops saying it can't load the graphics, failing at the first frame at the idle animation.

the frames are gif files exported by jasc animation shop 3 and open in various editors and viewers without error.

am I doing something wrong?

If you get a crash on load but not on know, the the problem likely has nothing to do with it being a projectile. You've most likely got a fundamental issue with the model itself, but there's not much more we can say without that log. Post it when you can and we'll have a look.

DC
 
Log file:

Code:
Total Ram: 25716424704 Bytes ( 24525 MB )
 Free Ram: 15648395264 Bytes ( 14923 MB )
 Used Ram:     7299072 Bytes (     6 MB )

debug:nativeWidth, nativeHeight, bpp, Hz  1536, 864, 24, 60
OpenBoR v4.0 Build 7555 (commit hash: b1676f9), Compile Date: Jan  9 2024

Game Selected: ./Paks/bor.pak

FileCaching System Init.......    Disabled
Initializing video............
Reading video settings from 'data/video.txt'.
Initialized video............    720x480 (Mode: 3)

Timer init...................    Done!
Initialize Sound............. 
Loading sprites..............    Done!
Loading level order..........    Done!
Loading model constants......    Done!
Loading script settings......    Done!
Loading scripts..............    Done!
Loading models...............

Joystick: "Unknown" connected at port: 0 at 2024-01-22 16:55:04
Cacheing 'Flash' from data/chars/misc/flash.txt
Cacheing 'bloodH' from Data/CHARS/misc/blood/bloodH.txt
Cacheing 'bloodV' from Data/CHARS/misc/blood/bloodv.txt
Cacheing 'michio_sword' from data/chars/player/michiosword/michiosword.txt
Cacheing 'rin' from data/chars/player/rin/rin.txt
Cacheing 'Green_Grunt' from data/chars/enemy/greengrunt/greengrunt.txt
Cacheing 'red_grunt' from Data/CHARS/enemy/redgrunt/red_grunt.txt
Cacheing 'blue_grunt' from Data/CHARS/enemy/bluegrunt/blue_grunt.txt
Cacheing 'blue_grunt_shuriken' from Data/CHARS/enemy/bluegrunt/blue_grunt_shuriken/blue_grunt_shuriken.txt
Cacheing 'Rat_Big' from data/chars/creature/ratbig/ratbig.txt
Cacheing 'Hedgehog_Brown' from data/chars/creature/hedgehogbrown/hedgehogbrown.txt
Cacheing 'dummy' from data/chars/misc/dummy.txt
Cacheing 'foliage1' from Data/CHARS/objects/plant/foliage1.txt
Cacheing 'bonsai1' from Data/CHARS/objects/plant/bonsai1/bonsai1.txt
Cacheing 'bonsai2' from Data/CHARS/objects/plant/bonsai2/bonsai2.txt
Cacheing 'foliage1' from Data/CHARS/objects/plant/foliage1/foliage1.txt
Cacheing 'grass1' from Data/CHARS/objects/plant/grass1/grass1.txt
Cacheing 'Pine1' from Data/CHARS/objects/plant/pine1/Pine1.txt
Cacheing 'Pine2' from Data/CHARS/objects/plant/pine2/Pine2.txt
Cacheing 'smallhouse' from Data/CHARS/objects/Buildings/smallhouse/smallhouse.txt
Cacheing 'woodchips' from Data/CHARS/misc/woodchips/woodchips.txt
Cacheing 'bridgefg' from Data/CHARS/objects/bridgefg/bridgefg.txt
Cacheing 'plat32' from Data/CHARS/misc/platforms/plat32.txt

Loading 'Flash' from data/chars/misc/flash.txt
 ...done!
Loading 'bloodH' from Data/CHARS/misc/blood/bloodH.txt
 ...done!
Loading 'bloodV' from Data/CHARS/misc/blood/bloodv.txt
 ...done!
Loading 'michio_sword' from data/chars/player/michiosword/michiosword.txt
WARNING: data/chars/player/michiosword/michiosword.txt tries to load a non-numeric value at followanim, where a number is expected!
erroneus string: follow1
 ...done!
Loading 'rin' from data/chars/player/rin/rin.txt
 ...done!
Loading 'blue_grunt_shuriken' from Data/CHARS/enemy/bluegrunt/blue_grunt_shuriken/blue_grunt_shuriken.txt

********** An Error Occurred **********
*            Shutting Down            *

Unable to load file 'Data/CHARS/enemy/bluegrunt/blue_grunt_shuriken/shuriken1.gif'
Total Ram: 25716424704 Bytes ( 24525 MB )
 Free Ram: 15601303552 Bytes ( 14878 MB )
 Used Ram:    50360320 Bytes (    48 MB )

Release level data...........
Done!

Release graphics data........    Done!
Release game data............


Release game data............    Done!
Release timer................    Done!
Release input hardware.......    Done!
Release sound system.........    Done!
Release FileCaching System...    Done!

**************** Done *****************

Unable to load file 'Data/CHARS/enemy/bluegrunt/blue_grunt_shuriken/shuriken1.gif'

Projectile entity:


Code:
name blue_grunt_shuriken
icon Data\CHARS\enemy\bluegrunt\blue_grunt_shuriken\shuriken.gif
type projectile
health  100
gfxshadow    1
candamage player npc obstacle

anim    idle
    attack    3 3 8 8 0 0 0 0 0 0
    bbox    1 1 12 12
    offset    -16 40
    loop    1
    delay    4
    frame    Data/CHARS/enemy/bluegrunt/blue_grunt_shuriken/shuriken1.gif
    frame    Data/CHARS/enemy/bluegrunt/blue_grunt_shuriken/shuriken2.gif
    frame    Data/CHARS/enemy/bluegrunt/blue_grunt_shuriken/shuriken3.gif
    frame    Data/CHARS/enemy/bluegrunt/blue_grunt_shuriken/shuriken4.gif
    frame    Data/CHARS/enemy/bluegrunt/blue_grunt_shuriken/shuriken5.gif
    frame    Data/CHARS/enemy/bluegrunt/blue_grunt_shuriken/shuriken6.gif
    frame    Data/CHARS/enemy/bluegrunt/blue_grunt_shuriken/shuriken7.gif
    frame    Data/CHARS/enemy/bluegrunt/blue_grunt_shuriken/shuriken8.gif

Parent entity:


Code:
name    Blue_Grunt

health 30
speed    12
knife blue_grunt_shuriken
throw   2 3

type    enemy
gfxshadow    1 0
jumpspeed       2
jumpmove 0 3
aggression -8
aimove avoidz

icon    data/chars/enemy/bluegrunt/icon.gif
diesound data/chars/enemy/bluegrunt/!sfx/die.wav


anim    attack1
    range    24 512
    throwframe    2 40
    projectile_velocity_x    16
    loop    0
    delay    7
    offset    40 80
    bbox    37 36 14 42
    frame    data/chars/enemy/bluegrunt/punch/0.gif
    attack    52 41 18 6 2 0 1 0 0 0
    bbox    40 36 12 42
    frame    data/chars/enemy/bluegrunt/punch/1.gif
    bbox    46 36 12 42
    attack    52 41 27 6 5 0 0 0 0 0
    knife    blue_grunt_shuriken
    frame    data/chars/enemy/bluegrunt/punch/2.gif
    bbox    42 36 12 42
    attack    0 0 0 0 0 0 0 0 0 0
    delay    21
    frame    data/chars/enemy/bluegrunt/punch/0.gif
      
anim    attack2
    loop    0
    delay    25
    offset    32 80
    bbox    25 33 14 42
    frame    data/chars/enemy/bluegrunt/kick1/0.gif
    delay    15
    attack    45 42 22 10 3 0 0 0 0 0
    bbox    30 33 14 42
    move    16
    frame    data/chars/enemy/bluegrunt/kick1/1.gif
    bbox    28 33 14 42
    attack    0 0 0 0 0 0 0 0 0 0
    delay    10
    frame    data/chars/enemy/bluegrunt/kick1/0.gif
      
anim    backwalk
    jumpframe    0 2 -2 0
    landframe    1
    loop    1
    delay    20
    bbox    30 28 12 37
    offset    36 77
    bbox    30 28 12 37
    sound    data/chars/enemy/bluegrunt/!sfx/evade.wav
    frame    data/chars/enemy/bluegrunt/jump/0.gif
    delay    20
    bbox    43 32 17 42
    offset    46 80
    frame    data/chars/enemy/bluegrunt/run/4.gif
    offset    40 80
    bbox    33 31 12 47
    delay    10
    frame    data/chars/enemy/bluegrunt/idle/0.gif
      
anim    fall
    bbox    30 33 31 15
    attack    30 34 38 17 0 0 1 0 0 0
    loop    0
    delay    20
    offset    40 40
    frame    data/chars/enemy/bluegrunt/fall/0.gif
    offset    40 45
    frame    data/chars/enemy/bluegrunt/fall/1.gif
      
anim    idle
    attack    0 0 0 0 0 0 0 0 0 0
    loop    1
    offset    40 80
    bbox    33 31 12 47
    delay    10
    frame    data/chars/enemy/bluegrunt/idle/0.gif
      
anim    jump
    loop    0
    delay    5
    bbox    28 26 11 42
    offset    35 80
    sound    data/chars/enemy/bluegrunt/!sfx/jump.wav
    frame    data/chars/enemy/bluegrunt/jump/0.gif
      
anim    jumpattack2
    loop    0
    delay    7
    offset    40 80
    jumpframe    2 2 1 0
    bbox    28 32 14 46
    frame    data/chars/enemy/bluegrunt/kick2/0.gif
    attack    38 24 8 30 7 1 0 0 0 0
    bbox    28 32 14 46
    frame    data/chars/enemy/bluegrunt/kick2/1.gif
    attack    0 0 0 0 0 0 0 0 0 0
    bbox    28 32 14 46
    delay    21
    frame    data/chars/enemy/bluegrunt/kick2/0.gif
      
anim    pain
    loop    0
    offset    40 80
    bbox    37 38 11 36
    delay    12
    sound    data/chars/enemy/bluegrunt/!sfx/hurt.wav
    frame    data/chars/enemy/bluegrunt/hurt/0.gif
    bbox    32 30 13 44
    frame    data/chars/enemy/bluegrunt/grab/0.gif
      
anim    rise
    bbox    0 0 0 0
    loop    0
    offset    40 60
    delay    15
    frame    data/chars/enemy/bluegrunt/jump/0.gif
      
anim    walk
    loop    1
    offset    40 80
    bbox    37 38 18 40
    delay    7
    frame    data/chars/enemy/bluegrunt/run/0.gif
    bbox    37 38 18 40
    frame    data/chars/enemy/bluegrunt/run/1.gif
    bbox    37 38 18 40
    frame    data/chars/enemy/bluegrunt/run/2.gif
    bbox    37 38 18 40
    frame    data/chars/enemy/bluegrunt/run/3.gif
    bbox    37 38 18 40
    frame    data/chars/enemy/bluegrunt/run/4.gif
    bbox    37 38 18 40
    frame    data/chars/enemy/bluegrunt/run/5.gif

models.txt
Code:
maxattacks 10

#particles
load     bloodH         Data/CHARS/misc/blood/bloodH.txt
load     bloodV         Data/CHARS/misc/blood/bloodv.txt
Load    woodchips   Data/CHARS/misc/woodchips/woodchips.txt
load    Flash        data/chars/misc/flash.txt

#Players
load    michio_sword    data/chars/player/michiosword/michiosword.txt
load    rin                data/chars/player/rin/rin.txt

#Player objects

#Enemy objects

#"load" here crashes. wait for community feedback
know     blue_grunt_shuriken Data/CHARS/enemy/bluegrunt/blue_grunt_shuriken/blue_grunt_shuriken.txt

#Enemies
know    Green_Grunt    data/chars/enemy/greengrunt/greengrunt.txt
know    red_grunt Data/CHARS/enemy/redgrunt/red_grunt.txt
know    blue_grunt Data/CHARS/enemy/bluegrunt/blue_grunt.txt
know    Rat_Big        data/chars/creature/ratbig/ratbig.txt
know    Hedgehog_Brown    data/chars/creature/hedgehogbrown/hedgehogbrown.txt



#debug and helpers
know    dummy            data/chars/misc/dummy.txt
Know plat32 Data/CHARS/misc/platforms/plat32.txt

#Objects
Know foliage1 Data/CHARS/objects/plant/foliage1.txt
Know bonsai1 Data/CHARS/objects/plant/bonsai1/bonsai1.txt
Know bonsai2 Data/CHARS/objects/plant/bonsai2/bonsai2.txt
Know foliage1 Data/CHARS/objects/plant/foliage1/foliage1.txt
Know grass1 Data/CHARS/objects/plant/grass1/grass1.txt
Know Pine1 Data/CHARS/objects/plant/pine1/Pine1.txt
Know Pine2 Data/CHARS/objects/plant/pine2/Pine2.txt
Know smallhouse Data/CHARS/objects/Buildings/smallhouse/smallhouse.txt

Know bridgefg Data/CHARS/objects/bridgefg/bridgefg.txt
 

Attachments

  • shuriken1.gif
    shuriken1.gif
    130 bytes · Views: 4
  • shuriken2.gif
    shuriken2.gif
    905 bytes · Views: 2
  • shuriken3.gif
    shuriken3.gif
    122 bytes · Views: 0
  • shuriken4.gif
    shuriken4.gif
    905 bytes · Views: 0
  • shuriken5.gif
    shuriken5.gif
    122 bytes · Views: 0
  • shuriken6.gif
    shuriken6.gif
    906 bytes · Views: 0
  • shuriken7.gif
    shuriken7.gif
    122 bytes · Views: 0
  • shuriken8.gif
    shuriken8.gif
    904 bytes · Views: 2
Last edited:
C:
Unable to load file 'Data/CHARS/enemy/bluegrunt/blue_grunt_shuriken/shuriken1.gif'

your .gif sprite need to be indexed, it's still RGB color right now

View attachment 6963
interesting, maybe the color depth is too low. they all have palletes between 16 and 256 colors. apparently 4-bit mode is not supported, because the first image is indeed 16 colors only. let me try converting up to 8 bit

edit:

yup, 8-bit depth only. thanks for helping me out

 
Last edited:
@kzr,

You solved? It is true. Only 8bit pallets are allowed. Obviously you can use as few or as many colors you like, but the format is 8bit only. This is kind of 101 in the manual. You might want to have a quick read through... if you don't have the basics down it's no wonder you're going frustrated trying advanced stuff.

DC
 
  • Like
Reactions: kzr
@kzr,

You solved? It is true. Only 8bit pallets are allowed. Obviously you can use as few or as many colors you like, but the format is 8bit only. This is kind of 101 in the manual. You might want to have a quick read through... if you don't have the basics down it's no wonder you're going frustrated trying advanced stuff.

DC
I'm reading through stuff as I go. but yes you're right indeed it's just too much to take in at once, newbie mistakes are bound to happen
 
to be honest, I don't know. I guess I followed the example game or some old tutorial. oh well, time to convert the graphics and replace all calls :)
 
to be honest, I don't know. I guess I followed the example game or some old tutorial. oh well, time to convert the graphics and replace all calls :)

Cool, that will get you about a 20% size reduction in files and future proof your work. 8bit is still required, except the background, which supports 24bit, but unless you have a really, really good reason for that, 8bit is the way to go.

DC
 
your .gif sprite need to be indexed, it's still RGB color right now
That is the problem: GIF images CANNOT be saved in RGB - it's a format limitation. Although Photoshop says its RGB, it's not:
ed6Gekf.png


It's a 4bit image, but it needs to be 8bit.
 
Back
Top Bottom