(Help with finalizing enemy) @Death Enemy turns into NPC

PS_VITA

Active member
Hi - as the title says  I just need someone to take a look at this code and let me know
if this is the optimized way of doing this and if the enemy did indeed die or if this method is wasteful in achieving what I'm trying to do.

Code:
anim death
	loop	0
	offset	77 170
	delay	77
        @cmd	dasher 0 0 0
	frame	data/chars/berkenemy/friendme.png
        delay 1
        frame	data/chars/misc/empty.png
        summonframe 0 0 0 0
        custentity berkfriendnpc

basically you beat this enemy and you prove your worth and he joins you as an NPC.
 
Either solution will work to spawn an NPC, but it will be free to go wherever it likes. It will pursue and fight enemies, but it won't follow you unless you set one of the players as its parent.

DC
 
nsw25 said:
why not just have it defined in level text

spawn berkenemy
item berkfriendnpc
  The name was edited so you could understand  it better :) .... I'm not sure I follow your suggestions. You see the player beats the living lights out of this enemy named berkenemy - like in anime P1 and Berk become friends because
he acknowledges his rival as greater than himself, because power levels and stuff. So, I fail to see how
and why I would spawn an enemy as an item that I guess magically turns into an npc - I'm so lost.


Damon Caskey said:
Either solution will work to spawn an NPC, but it will be free to go wherever it likes. It will pursue and fight enemies, but it won't follow you unless you set one of the players as its parent.

DC
I'm not sure if you are talking to me or nsw25 - or you are replying directly to nsw25.
And yeah - I do know that the NPC can do whatever he wants at the moment ( which is intentional)  - but to simplify my question - did the orignal berk die - as in, openbor engine killed "Berkenemy" during the anim death code or is he still in the level of the game - just invisible do to his "empty" sprite?
 
PS VITA said:
I'm not sure if you are talking to me or nsw25 - or you are replying directly to nsw25.
And yeah - I do know that the NPC can do whatever he wants at the moment ( which is intentional)  - but to simplify my question - did the orignal berk die - as in, openbor engine killed "Berkenemy" during the anim death code or is he still in the level of the game - just invisible do to his "empty" sprite?

I was talking to both of you. I didn't notice you were using Summonframe and not Spawnframe. Both do the same thing, but Summonframe also populates a hidden value on the parent entity with the child entity. This does two things - it allows you to later use the Unsummon command to kill the child entity, and also automatically kills the child entity when parent entity dies. That's also why you can only "summon" one entity at a time without script, but you can "spawn" as many as you want.

The solution is to use Spawnframe instead, or drop the NPC as an item like nsw25 said. The latter is an old method dating from the original BOR days and is perfectly viable. I prefer Spawnframe just because it gives you position control.

DC
 
Damon Caskey said:
PS VITA said:
I'm not sure if you are talking to me or nsw25 - or you are replying directly to nsw25.
And yeah - I do know that the NPC can do whatever he wants at the moment ( which is intentional)  - but to simplify my question - did the orignal berk die - as in, openbor engine killed "Berkenemy" during the anim death code or is he still in the level of the game - just invisible do to his "empty" sprite?

I was talking to both of you. I didn't notice you were using Summonframe and not Spawnframe. Both do the same thing, but Summonframe also populates a hidden value on the parent entity with the child entity. This does two things - it allows you to later use the Unsummon command to kill the child entity, and also automatically kills the child entity when parent entity dies. That's also why you can only "summon" one entity at a time without script, but you can "spawn" as many as you want.

The solution is to use Spawnframe instead, or drop the NPC as an item like nsw25 said. The latter is an old method dating from the original BOR days and is perfectly viable. I prefer Spawnframe just because it gives you position control.

DC

Damon Caskey

With the example I provided above, how do use the unsummon command to get rid of Berkenemy?

Sorry if I'm not understanding as I'm sure you perfectly explained it, is just that I'm dumb and slow in understanding this.

 
PS VITA,

First, don't call yourself dumb. It's self-defeating and a crutch.

With the example I provided above, how do use the unsummon command to get rid of Berkenemy?

First of all, your example above won't work at all. As I just said, you can't use summonframe as the parent entity dies, because the NPC will die too. You need to use spawnframe, NOT summonframe.

Now, as for how to get rid of the NPC afterward - you can't. The NPC is is an independent entity. The only ways to git rid of it are:

  • Set its lifespan so that it dies automatically after X amount of time.
  • It is defeated by normal means (fighting other entities, falls into a pit, etc.).
  • Using script.

"using script" could mean pretty much anything since script can do whatever you want. So it would depend on how you want the NPC to behave in game.

DC
 
Damon Caskey said:
@PS VIT,

First, don't call yourself dumb. It's self-defeating and a crutch.

With the example I provided above, how do use the unsummon command to get rid of Berkenemy?

parent entity dies, because the NPC will die too. You need to use spawnframe, NOT summonframe.

So my method above is working. Hence I'm very confused, I believe is because I'm loading the NPC in the models and I'm using noblinkdie 2(sorry I'm away from my laptop the name could be different)

But I guess is still a bad way of doing this since the enemy that became the npc is still lingering there, just invisible to the eye.

On a similar subject,  instead of trying to spawn a new npc and kill the enemy that created him, is there a way to swap the enemy to the npc?

I've used game maker before and I believe it was possible,  but again I would need to do more research.
 
NO... no, your method is NOT working. How many ways can I say this? Stop using summonframe. Use SPAWNframe. Quit adding moving parts into the discussion and listen to me. Until you do that, I can't really help you.

Also, whatever you want to do it is always possible. That's not even a question. The only thing to worry about is how, not if. You can turn an enemy into an NPC, but it takes script to do it. It's more advanced than spawning an NPC.

DC
 
Damon Caskey said:
NO... no, your method is NOT working. How many ways can I say this? Stop using summonframe. Use SPAWNframe. Quit adding moving parts into the discussion and

What exactly is not working DC?

It's a fact that I have an enemy turning into a NPC.
What I do not know is if the enemy is deleted from the game? If you are referring to the latter than we agree. If we don't than I guess I'm so lost that I rather just move on and scrap the whole idea.

Otherwise,  when I get home I'll grind it out using spawnframe.
 
OK, looks like we had miscommunication. That's my fault. I thought you meant the NPC wasn't spawning.

I think it would help if you took some screenshots or (even better) a video. That would us help see what's happening.

DC
 
Damon Caskey said:
OK, looks like we had miscommunication. That's my fault. I thought you meant the NPC wasn't spawning.

I think it would help if you took some screenshots or (even better) a video. That would us help see what's happening.

DC


I will do a better job of posting videos or images next time. For now, I'm going to grind it out and
Play around using the methods mentioned in this topic.  Also, I just remember Bloodbane helping create a script that can delete any entity on the level.txt so I'm definitely going to be using that if all else fails.


Thanks guys. Have a great weekend.
 
Back
Top Bottom