Solved projectile palette script

Question that is answered or resolved.
Then I changed type to enemy and it started moving around the screen. I changed it pshot and none and it still stays after hitting the enemy.

When you said "started moving around the screen", are there any animations for your character or projectile? You should have only one animation for your projectile to play a role for shooting, and that is.. anim idle. If you have other animations like walking, falling, attacking, and whatever exist, that can dance around in there. LOL Use only anim idle for your projectiles, no other anims for the char/projectile. If you are using OpenBOR.exe, then there is no problem.

I forgot that you can shoot with or without script on a player/enemy/npc character.

With script:
Code:
anim	freespecial11
	delay	5
	bbox	5 1 57 101
	offset	23 99
	sound	data/sounds/ryu/hadoken.wav
	frame	data/chars/ryu/0100000000.gif
	offset	22 94
	frame	data/chars/ryu/0100000001.gif
	offset	23 91
	frame	data/chars/ryu/0100000002.gif
	bbox	7 0 65 88
	offset	23 90
	frame	data/chars/ryu/0100000003.gif
	bbox	32 10 44 89
	offset	23 96
	delay	7
	@cmd	shooter "Hadoken" 0 70 0 8 0 0
	frame	data/chars/ryu/0100000004.gif
	bbox	32 6 44 89
	offset	23 93
	frame	data/chars/ryu/0100000005.gif
	bbox	32 0 44 89
	offset	23 88
	frame	data/chars/ryu/0100000006.gif
	frame	data/chars/ryu/0100000007.gif
	offset	24 90
	frame	data/chars/ryu/0100000008.gif
	bbox	23 0 44 93
	offset	23 92
	frame	data/chars/ryu/0100000009.gif
	bbox	16 0 44 100
	offset	23 97
	frame	data/chars/ryu/0100000010.gif
	bbox	9 1 44 100
	offset	23 99
	frame	data/chars/ryu/0100000011.gif

Or..

Without script:
Code:
anim	freespecial11
	delay	5
	bbox	5 1 57 101
	offset	23 99
	throwframe	4
	custknife	hadoken
	sound	data/sounds/ryu/hadoken.wav
	frame	data/chars/ryu/0100000000.gif
	offset	22 94
	frame	data/chars/ryu/0100000001.gif
	offset	23 91
	frame	data/chars/ryu/0100000002.gif
	bbox	7 0 65 88
	offset	23 90
	frame	data/chars/ryu/0100000003.gif
	bbox	32 10 44 89
	offset	23 96
	delay	7
	frame	data/chars/ryu/0100000004.gif
	bbox	32 6 44 89
	offset	23 93
	frame	data/chars/ryu/0100000005.gif
	bbox	32 0 44 89
	offset	23 88
	frame	data/chars/ryu/0100000006.gif
	frame	data/chars/ryu/0100000007.gif
	offset	24 90
	frame	data/chars/ryu/0100000008.gif
	bbox	23 0 44 93
	offset	23 92
	frame	data/chars/ryu/0100000009.gif
	bbox	16 0 44 100
	offset	23 97
	frame	data/chars/ryu/0100000010.gif
	bbox	9 1 44 100
	offset	23 99
	frame	data/chars/ryu/0100000011.gif
 
This is the file:

name bh
health    1
nolife  1
type  pshot
candamage enemy
gfxshadow 1
speed 15
remove 1
alpha 1

palette data/chars/0misc2/bh1.gif #1
alternatepal data/chars/1dra/jalt1.gif #2
alternatepal data/chars/1dra/jalt2.gif #3

anim idle
loop  1
delay  3
offset 0 85
hitflash  Flashc
hitfx  data/sounds/swd.wav
blast  63 44 27 18 30 0 0 20
frame  data/chars/0misc2/bh1.gif
frame  data/chars/0misc2/bh2.gif
frame  data/chars/0misc2/bh3.gif
frame  data/chars/0misc2/bh4.gif
 
pshot is way outdated. You see?

type {type}
{type}
player = The entity is a human-controlled player.
enemy = The entity is a CPU controlled enemy or enemy projectile.
npc = The entity is a CPU controlled ally that will seek out and attack enemies. The entity is otherwise functionally identical to enemy entities with the chase subtype. You can change the npc's allegiance via hostile setting. Npcs types do not count toward groups.
item = The entity is a stationary item which can be picked up. Items can only give one bonus per item. In other words, you can't make one item that both gives 2000 points AND gives a 1-up.
none = The entity is a useless decoration.
steamer = The entity constantly spews the object called Steam upwards with alpha transparency.
obstacle = The entity is a stationary blockade which can (normally) be destroyed.
text = The entity is a message object. When spawned, it will freeze all objects in play and show it's IDLE animation, then dissapear. It can be sped up by pressing attack or jump. Can be used for level intros, mid-level cutscenes, etc.
trap = The entity is an obstacle which cannot be attacked. It can be made to attack, though, and will hit both players and enemies. If a trap is not set up to knock the entity down, the trap will only damage the entity one time. To hit them again, the target entity must take damage from another entity.
endlevel = The entity is an item which, when touched by a player, will end the stage. It can be given a score value to be awarded for level completion.
pshot = Outdated and does nothing. You can still use it, but it's ignored.
panel = The entity will scroll together with level. If the entity's speed is 10, entity will stay with panel. If the speed is 5, it will stay with background (for direction left, right and both). This type is used to make multiple layers.

EDIT:

Hmm.. How about if you use none type?

EDIT2:

I use Hadoken as enemy type with candamage enemy player to damage both enemies and players. Yes, you can use candamage to declare on what type of entity you want it to damage.
 
maxman said:
pshot is way outdated. You see?

type {type}
{type}
player = The entity is a human-controlled player.
enemy = The entity is a CPU controlled enemy or enemy projectile.
npc = The entity is a CPU controlled ally that will seek out and attack enemies. The entity is otherwise functionally identical to enemy entities with the chase subtype. You can change the npc's allegiance via hostile setting. Npcs types do not count toward groups.
item = The entity is a stationary item which can be picked up. Items can only give one bonus per item. In other words, you can't make one item that both gives 2000 points AND gives a 1-up.
none = The entity is a useless decoration.
steamer = The entity constantly spews the object called Steam upwards with alpha transparency.
obstacle = The entity is a stationary blockade which can (normally) be destroyed.
text = The entity is a message object. When spawned, it will freeze all objects in play and show it's IDLE animation, then dissapear. It can be sped up by pressing attack or jump. Can be used for level intros, mid-level cutscenes, etc.
trap = The entity is an obstacle which cannot be attacked. It can be made to attack, though, and will hit both players and enemies. If a trap is not set up to knock the entity down, the trap will only damage the entity one time. To hit them again, the target entity must take damage from another entity.
endlevel = The entity is an item which, when touched by a player, will end the stage. It can be given a score value to be awarded for level completion.
pshot = Outdated and does nothing. You can still use it, but it's ignored.
panel = The entity will scroll together with level. If the entity's speed is 10, entity will stay with panel. If the speed is 5, it will stay with background (for direction left, right and both). This type is used to make multiple layers.

EDIT:

Hmm.. How about if you use none type?

EDIT2:

I use Hadoken as enemy type with candamage enemy player to damage both enemies and players. Yes, you can use candamage to declare on what type of entity you want it to damage.

I have read that. I cant use "enemy player" because then I can hit other players including myself if I run into it. It didnt have this issue before I added scripting are you sure its not the script?
 
I see. Of course it's not script. You don't have to declare "enemy player" on candamage if you can't use that. By the way, I just tested with pshot just now for the first time. It seems that it can work for me (but I don't know for others that it works for them). What version are you using which cannot let you use that?

This is candamage which is used for damaging any types.

candamage {type1} {type2} ...
Determines what entity types an entity can hit with its attack boxes.

{type#}
Target types. Available types are enemy, player, npc, obstacle, and shot. You may add as many types as you wish.
Be aware if you use this setting, you must provide all types you wish this entity to hit. For example, an enemy type entity with settings ‘candamage npc obstacle’ will only be able to hit npcs or obstacles. It attacks will simply pass through any other type of entity.

I forgot to say that you can let your player declare a projectile by using load in the header (for non-script). But it doesn't have to be more than 1.
name Ryu #Name of model
type player #entity type
health  1000 #health {int}
gfxshadow 1

speed  14 #speed {int}

load      hadoken2  #load {projectile}
load      hadoken3
turndelay 9999999999999999999999999999999 # Over 9 nonillion centiseconds for turndelay as limit before turning face. 100 centiseconds per second
nolife 1
ondeathscript data/scripts/death.c
script data/scripts/player.c
animationscript data/scripts/script.c
atchain 1  #light punch #atchain {attack#} {attack#} ....
com a2 freespecial #medium punch #com {dir}... (up to 15 dir) {freespecial#}
com a3 freespecial2 #heavy punch
com j freespecial3 #light kick
com s freespecial4 #medium kick
com a4 freespecial5 #high kick


com    d f a freespecial11 #slow hadoken
com    d f a2 freespecial12 #med hadoken
com    d f a3 freespecial13 #fast hadoken
com    f d f a freespecial14 #low shoryuken
com    f d f a2 freespecial15 #med shoryuken
com    f d f a3 freespecial16 #high shoryuken
com    d b j freespecial17 #low tatsumaki senpuu kyaku
com    d b s freespecial18 #med tatsumaki senpuu kyaku
com    d b a4 freespecial19 #high tatsumaki senpuu kyaku

If you like to use script like @cmd to call projectiles for shooting, then there's no need to use load in the header.

Code:
anim	freespecial11
	delay	5
	bbox	5 1 57 101
	offset	23 99
	sound	data/sounds/ryu/hadoken.wav
	frame	data/chars/ryu/0100000000.gif
	offset	22 94
	frame	data/chars/ryu/0100000001.gif
	offset	23 91
	frame	data/chars/ryu/0100000002.gif
	bbox	7 0 65 88
	offset	23 90
	frame	data/chars/ryu/0100000003.gif
	bbox	32 10 44 89
	offset	23 96
	delay	7
	@cmd	shooter "Hadoken" 0 70 0 8 0 0
	frame	data/chars/ryu/0100000004.gif
	bbox	32 6 44 89
	offset	23 93
	frame	data/chars/ryu/0100000005.gif
	bbox	32 0 44 89
	offset	23 88
	frame	data/chars/ryu/0100000006.gif
	frame	data/chars/ryu/0100000007.gif
	offset	24 90
	frame	data/chars/ryu/0100000008.gif
	bbox	23 0 44 93
	offset	23 92
	frame	data/chars/ryu/0100000009.gif
	bbox	16 0 44 100
	offset	23 97
	frame	data/chars/ryu/0100000010.gif
	bbox	9 1 44 100
	offset	23 99
	frame	data/chars/ryu/0100000011.gif

Load (in the header) is only used when you don't use script. You can use custknife to call a projectile (e.g. Hadoken2, look at it below) and a throwframe for which the projectile will be summoned.

Code:
anim	freespecial12
	delay	5
	bbox	5 1 57 101
	offset	23 99
	throwframe	4
	custknife	hadoken2
	sound	data/sounds/ryu/hadoken.wav
	frame	data/chars/ryu/0100000000.gif
	offset	22 94
	frame	data/chars/ryu/0100000001.gif
	offset	23 91
	frame	data/chars/ryu/0100000002.gif
	bbox	7 0 65 88
	offset	23 90
	frame	data/chars/ryu/0100000003.gif
	bbox	32 10 44 89
	offset	23 96
	delay	7
	frame	data/chars/ryu/0100000004.gif
	bbox	32 6 44 89
	offset	23 93
	frame	data/chars/ryu/0100000005.gif
	bbox	32 0 44 89
	offset	23 88
	frame	data/chars/ryu/0100000006.gif
	frame	data/chars/ryu/0100000007.gif
	offset	24 90
	frame	data/chars/ryu/0100000008.gif
	bbox	23 0 44 93
	offset	23 92
	frame	data/chars/ryu/0100000009.gif
	bbox	16 0 44 100
	offset	23 97
	frame	data/chars/ryu/0100000010.gif
	bbox	9 1 44 100
	offset	23 99
	frame	data/chars/ryu/0100000011.gif

Code:
anim	freespecial13
	delay	5
	bbox	5 1 57 101
	offset	23 99
	throwframe	4
	custknife	hadoken3
	sound	data/sounds/ryu/hadoken.wav
	frame	data/chars/ryu/0100000000.gif
	offset	22 94
	frame	data/chars/ryu/0100000001.gif
	offset	23 91
	frame	data/chars/ryu/0100000002.gif
	bbox	7 0 65 88
	offset	23 90
	frame	data/chars/ryu/0100000003.gif
	bbox	32 10 44 89
	offset	23 96
	delay	7
	frame	data/chars/ryu/0100000004.gif
	bbox	32 6 44 89
	offset	23 93
	frame	data/chars/ryu/0100000005.gif
	bbox	32 0 44 89
	offset	23 88
	frame	data/chars/ryu/0100000006.gif
	frame	data/chars/ryu/0100000007.gif
	offset	24 90
	frame	data/chars/ryu/0100000008.gif
	bbox	23 0 44 93
	offset	23 92
	frame	data/chars/ryu/0100000009.gif
	bbox	16 0 44 100
	offset	23 97
	frame	data/chars/ryu/0100000010.gif
	bbox	9 1 44 100
	offset	23 99
	frame	data/chars/ryu/0100000011.gif

Script or not, you can summon a projectile for shooting enemies.

EDIT: You can use type none for the projectile or type enemy.
 
GarMod said:
I tried adding "remove 1" and it didnt work. Then I changed type to enemy and it started moving around the screen. I changed it pshot and none and it still stays after hitting the enemy.

Garmod, you are using alternate way to shoot projectile. There are 2 ways to spawn projectiles in OpenBoR, one with throwframe command and the other is this one

maxman's suggestion is for the former. For this scripted you should use this:

name  bh
type  none
candamage enemy
gfxshadow 1
alpha 1
lifespan  0.7

palette          data/chars/0misc2/bh1.gif #1
alternatepal        data/chars/1dra/jalt1.gif #2
alternatepal        data/chars/1dra/jalt2.gif #3

anim idle
  loop  1
  delay  3
  offset 0 85
followanim 1
followcond 1
  hitflash  Flashc
  hitfx  data/sounds/swd.wav
  blast  63 44 27 18 30 0 0 20
  frame  data/chars/0misc2/bh1.gif
  frame  data/chars/0misc2/bh2.gif
  frame  data/chars/0misc2/bh3.gif
  frame  data/chars/0misc2/bh4.gif

anim follow1
delay 1
offset 3 3
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif

I removed couple redundant lines. This should do the trick
 
GarMod said:
Works great but now the projectile hits and keeps going. Only supposed to hit once.

As BB stated above, you should use another way to make it hit and disappear, since we are going to use a scripted way

  followanim  1
  followcond  1


followcond {value}

~This command is to make the entity performs FOLLOW{#} if an attackbox in the animation hits.
~value determines the condition requirements before FOLLOW{#} is played.
1 = this animation will followup as long as it hits an entity.
2 = this animation will followup as long as it hits an enemy (Or player if an enemy uses it).
3 = this animation will followup as long as it hits an enemy and the target does not get killed or block the attack.
4 = this animation will followup as long as it hits an enemy, and the target is not killed, does not block the attack, and is not set to be ungrabbable.
~Which FOLLOW animation played is determined by 'followanim'.

This will make the projectile go to follow1 animation once it hit something.

The other question is: what is this line?

@cmd  spawn01 "sdust" 0 0 0

That is a common spawn function, which is the base for the function I am using to match the caller palette. I use it to spawn a dust fx called "sdust"

Code:
void spawn01(void vName, float fX, float fY, float fZ)
{
	//spawn01 (Generic spawner)
	//Damon Vaughn Caskey
	//07/06/2007
	//
	//Spawns entity next to caller.
	//
	//vName: Model name of entity to be spawned in.
	//fX: X location adjustment.
	//fZ: Y location adjustment.
      //fY: Z location adjustment.

	void self = getlocalvar("self"); //Get calling entity.
	void vSpawn; //Spawn object.
	int  iDirection = getentityproperty(self, "direction");

	clearspawnentry(); //Clear current spawn entry.
      setspawnentry("name", vName); //Acquire spawn entity by name.

	if (iDirection == 0){ //Is entity facing left?                  
          fX = -fX; //Reverse X direction to match facing.
	}

      fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
      fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
      fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
	
	vSpawn = spawn(); //Spawn in entity.

	changeentityproperty(vSpawn, "position", fX, fZ, fY); //Set spawn location.
	changeentityproperty(vSpawn, "direction", iDirection); //Set direction.
    
	return vSpawn; //Return spawn.
}

And yes, I use type none for the projectile.
 
@Maxman
I am using a paxploder. Likely the problem.

@BloodBane
Bloodbane said:
GarMod said:
I tried adding "remove 1" and it didnt work. Then I changed type to enemy and it started moving around the screen. I changed it pshot and none and it still stays after hitting the enemy.

Garmod, you are using alternate way to shoot projectile. There are 2 ways to spawn projectiles in OpenBoR, one with throwframe command and the other is this one

maxman's suggestion is for the former. For this scripted you should use this:

name  bh
type  none
candamage enemy
gfxshadow 1
alpha 1
lifespan  0.7

palette          data/chars/0misc2/bh1.gif #1
alternatepal        data/chars/1dra/jalt1.gif #2
alternatepal        data/chars/1dra/jalt2.gif #3

anim idle
  loop  1
  delay  3
  offset 0 85
followanim 1
followcond 1
  hitflash  Flashc
  hitfx  data/sounds/swd.wav
  blast  63 44 27 18 30 0 0 20
  frame  data/chars/0misc2/bh1.gif
  frame  data/chars/0misc2/bh2.gif
  frame  data/chars/0misc2/bh3.gif
  frame  data/chars/0misc2/bh4.gif

anim follow1
delay 1
offset 3 3
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif

I removed couple redundant lines. This should do the trick

I tried this and it loaded then exited. So I changed type to pshot and it did the same. Changed it back to none packed and used 3.0, stayed on but the hadouken spawned and stayed there though it did go away after hitting an enemy. I changed type back to pshot repacked and finally it worked correctly...paxploder outdated?
Thanks again for the help.

@ BeasTie
I can rename? Or does it have to be admin?

@ O Ilusionista
Thanks, I got it working with this method.
 
ah, you don't need to pak the game to work. If there is a DATA folder, OpenBOR will always use it.
Just pack it when you are finished.
 
O Ilusionista said:
ah, you don't need to pak the game to work. If there is a DATA folder, OpenBOR will always use it.
Just pack it when you are finished.

I know. I have my paxploder in its own folder so I can be sure of what is and is not finished. The problem seems to have been that it was using an old version of the game.
 
I can rename? Or does it have to be admin?

You can rename it yes. :) It doesn't have to be any admin to rename topics for you. You can do it yourself just like most of us here. Try to rename your topic in the first post. :)

What version are you using which cannot let you use that?

I am using a paxploder. Likely the problem.

I meant OpenBOR version. Not a paxploder itself. Check your log in the logs folder and open that openborlog.txt to see what version number you are using (if you don't know).
 
OpenBOR v3.0 Build 4055

before I knew the correct way to play a game in progress, I downloaded Neo edit pack which has its own folder for playing paxploded games. It is obviously outdated but thats why I just updated it.
 
Back
Top Bottom