Dead bonca carcass
I want to make it so that the carcass of a bonca that Dink kills remains behind after he leaves the screen, and then have him be able to remove it later (as part of a sort of quest). I've had a look at scripts which do similar things (eg. barrels, pushable rocks that stay), but haven't had much luck adapting them to what I want here, which is: Bonca -> Dink kills it -> Leaves carcass (which Dink can talk/hit) -> Dink 'removes' carcass by talking
Any help?
Any help?
I've done that in the past in the Scourger.
I remember using three global variables to actually make it work. One for the body's x value, one for its y value and one for whether or not it should be present (the normal story variable).
It works pretty much like this: A script attached to a room determines whether a body or a slayer should be drawn, in the die procedure add this: (for a slayer, taken from the Scourger)
//Globals for the x and y posistions:
&slayx = sp_x(¤t_sprite,-1);
&slayy = sp_y(¤t_sprite,-1);
//Creating of the body:
int &junk = create_sprite(&slayx,&slayy,0,645,1);
//I need to make a cutscene or something when Dink touches the body:
sp_touch_damage(&junk,-1);
sp_script(&junk,"s4-corpse");
//Let's make sure the 'normal' body isn't drawn:
sp_active(¤t_sprite,0);
<EDIT>
And don't forget to do something similar in the room's script.
I remember using three global variables to actually make it work. One for the body's x value, one for its y value and one for whether or not it should be present (the normal story variable).
It works pretty much like this: A script attached to a room determines whether a body or a slayer should be drawn, in the die procedure add this: (for a slayer, taken from the Scourger)
//Globals for the x and y posistions:
&slayx = sp_x(¤t_sprite,-1);
&slayy = sp_y(¤t_sprite,-1);
//Creating of the body:
int &junk = create_sprite(&slayx,&slayy,0,645,1);
//I need to make a cutscene or something when Dink touches the body:
sp_touch_damage(&junk,-1);
sp_script(&junk,"s4-corpse");
//Let's make sure the 'normal' body isn't drawn:
sp_active(¤t_sprite,0);
<EDIT>
And don't forget to do something similar in the room's script.
If you don't want to use any global variables, you may be able to use the editor_seq, editor_frame commands to store the x/y location. The editor_type information could show if the bonca was actually dead - then you'd load your quest script with the provided coordinates.
I used editor_frame and editor_seq in Initiation to store where a corpse was, so you may want to check out the scripts for the cast guards and other NPCs for an example. One thing to note is editor_frame only accepts values from 0-255, so you have to divide the y coordinate by two and put it in there, then multiply it by two when you retrieve it.
Or, you could just place the Bonca in Vision 1, and the corpse in Vision 2, and use a base script attached to the screen to toggle between the two, if you don't care about the exact position that the Bonca was killed at. I believe that Prophecy of the Ancients used this technique.
Or, you could just place the Bonca in Vision 1, and the corpse in Vision 2, and use a base script attached to the screen to toggle between the two, if you don't care about the exact position that the Bonca was killed at. I believe that Prophecy of the Ancients used this technique.
At the moment I'm using the barrel-stay-flat script section, which works pretty similar to the vision method.
However, it won't let me talk or run the touch procedure after it's dead. I've used a global variable to say when it's dead (that variable already is a part of the story anyway), and then in main have the touch damage = -1, as well as for the talk function. I've tried changing the editor_type to both background and normal, but it doesn't change it.
If there's no easy fix I'll just use the vision method; it seems pretty easy to implement.
P.S. Thanks for all the help
However, it won't let me talk or run the touch procedure after it's dead. I've used a global variable to say when it's dead (that variable already is a part of the story anyway), and then in main have the touch damage = -1, as well as for the talk function. I've tried changing the editor_type to both background and normal, but it doesn't change it.
If there's no easy fix I'll just use the vision method; it seems pretty easy to implement.
P.S. Thanks for all the help
WHAT?! This is no dead bonca carcass cult?! NOOOOOOOO!!
Hmmm, a good idea for my D-Mod...
...or too cheesy?
(mmmmmm, cheeeeseeey...)
...or too cheesy?
(mmmmmm, cheeeeseeey...)