Need help with basic stuff

Die_In_Fire

Well-known member
I’m very rusty, I need help with a few things.

1. First, it seems I don’t quite understand the jump frame landframe, as I can’t get the desired result on this animation.
I want the high point of the jump to be on frame #22, so I set landframe at frame #23 (counting from 0. The 17.gif frame), but the character starts de descending much before that. Probably at frame #20.

This is the code:
(Sorry for any typos. I typed it from my phone so there’s probably some mistake)
Code:
anim freespecial13
fastattack 1
loop 0
delay 2
jumpframe 0 3 1
landframe 23
offset 43 75
hitfx data/sounds/kbeatko1.wav
frame data/chars/kunio/18.gif
attack3 39 47 31 21 0 1 0 0 20 8
dropv 2 1 0
frame data/chars/kunio/44.gif
delay 3
attack4 0
frame data/chars/kunio/45.gif
attack3 39 47 31 21 0 1 0 0 20 8
dropv 2 1 0
frame data/chars/kunio/45.gif
attack4 0
frame data/chars/kunio/44.gif
move 4
attack3 39 47 31 21 0 1 0 0 20 8
dropv 2 1 0
frame data/chars/kunio/45.gif
attack4 0
frame data/chars/kunio/44.gif
attack3 39 47 31 21 0 1 0 0 20 8
 dropv 2 1 0
frame data/chars/kunio/44.gif
 attack4 0
frame data/chars/kunio/45.gif
attack3 39 47 31 21 0 1 0 0 20 8
 dropv 2 1 0
frame data/chars/kunio/44.gif
        attack 0
frame data/chars/kunio/45.gif
attack3 39 47 31 21 0 1 0 0 20 8
dropv 2 1 0
frame data/chars/kunio/45.gif
Attack4 0 0 0 0
frame data/chars/kunio/44.gif
attack3  40  58  30  17  0  1 0 0 15
dropv 2 1 0
frame data/chars/kunio/45.gif
attack4  0  0  0  0  0  0
frame data/chars/kunio/44.gif
attack3 39  47  31  21  0  0 0 0 0 15
dropv 2 1 0
frame data/chars/kunio/44.gif
attack4  0  0  0  0  0  0
frame data/chars/kunio154.gif
Delay 15
bbox 37 44 13 31
attack3  39  47  31  21  0  1 0 0 0 15
dropv 2 1 0
frame data/chars/kunio/155.gif
 dropv -3 1 0
attack  0  0  0  0  0  0
Delay 4
frame data/chars/kunio/155.gif
frame data/chars/kunio/15.gif
Delay 10
frame data/chars/kunio/16.gif
frame data/chars/kunio/15.gif
Delay -1000
frame data/chars/kunio/16.gif
Delay 15
frame data/chars/kunio/17.gif

2. I have a coin which is type item that gives 60 score points. It’s subtype touch and has a sound in the middle of his idle animation. When I touch it, it works as intended giving the 60 points and disappearing, but it still keeps playing the idle sound effect (until lifespan finish) . Again, typed from my phone so I skipped bbox numbers and others...
Code:
Name coin60
Health 0
score 60
type item
subtype touch
Shadow 0
icon data/ blabla
lifespan 8
palette blabla

Anim idle
loop 1
offset 43 75
bbox blabla
Delay 4
frame etc
bbox etc
frame etc
bbox etc
frame etc
bbox etc
frame etc
bbox etc
frame etc
bbox etc
frame etc
bbox etc
frame etc
bbox etc
frame etc
bbox etc
sound data/sounds/rcr9.wav
frame etc
bbox etc
frame etc
bbox etc
frame etc
bbox etc
frame etc
bbox etc
frame etc
bbox etc
frame etc
bbox etc
frame etc
bbox etc
frame etc
bbox etc
frame etc


anim death
loop 0
offset 43 75
bbox etc
delay 3
frame etc
 
Hi Die_In_Fire, I've got this basic horizontal and vertical shooter that you can customize as you wish:
https://drive.google.com/file/d/1JlmSKhTJcm9ZNSNZkXD1Cu2eHl-iqGL4/view?usp=sharing

The Xelam Bloodbane game is a vertical shooter too:
http://www.chronocrash.com/forum/index.php?topic=5718.msg76200#msg76200
 
Kimono thanks a lot for the links. will surely take a look at those!

btw this is the coin entity in case someone wants to take a look at the sound issue:

https://we.tl/t-fnZQ75oaWe
 
Thanks for sharing the coin!
Now I understand the problem.

I think this is engine bug but I decided to code simple script to solve it.
This is koinded.c:
Code:
void main()
{//Script to remove taken item immediately
    void self = getlocalvar("self");
    killentity(self); //Suicide!
}

Save that to a folder, preferably data/scripts folder then declare it in coin60.txt with this:
didhitscript data/scripts/koinded.c

With this script, coin60 will be immediately removed after taken and thus preventing the SFX to be replayed.
 
Bloodbane said:
So if you declared Summonframe 0 10 242 0 1, function declaration should be @cmd spawn01 10 0 242 .

Just a minute, if you set last parameter of summonframe to 1, you might need to use spawn06 function instead.

Have you loaded all wasted entities? at least in this enemy's header text?

Yes I have the entities loaded on models.txt.

I changed the script to this and still can’t see nothing spawned:

Code:
Anim death
Loop 0
Delay 13
Offset 43 75
Frame data/etc .gif
  int r = rand()%6+6;

    if(r >= 0 && r < 2){
      spawn06("wasted1", 10, 0, 242);
    } else if(r >= 2 && r < 4){
      spawn06("wasted2", 10, 0, 242);
    } else if(r >= 4 && r < 6){
      spawn06("wasted3", 10, 0, 242);
    } else if(r >= 6 && r < 8){
      spawn06("wasted4", 10, 0, 242);
    } else if(r >= 8 && r < 10){
      spawn06("wasted5", 10, 0, 242);
    } else {
      spawn06("wasted6", 10, 0, 242);
    }
Frame data/etc .gif
 
Back
Top Bottom