More Basics Help

The_Gambit

New member
I opened and modified an existing .gif, Ironman's d13.gif. Now the game crashes and says 'Unable to load file 'data/chars/Ironman/d13.gif'. I did not change the name or location. How do I implement new or modified .gif's?

On another note,
-So I am using shooter2 to launch missiles in a bunch of directions, adding the follow1 animation to disappear when they hit, or after 0.25 seconds, whichever comes first.
-Next, if the missile did not 'hit', at the 0.25 second mark I will us the generic 'shoot' command to relaunch the missile, at the same coordinates it disappears, with 'chase' property.
-Therefore, it should look like I'm shooting a bunch of missiles, which after a short delay, acquire and zoom at targets.
-I think shooting the missiles out in different directions will help prevent them from all going after the same target.

Caveats:
1. How to determine whether or not to spawn chase missile based on if original missile 'hit'?
2. Chase missiles don't chase on the Y axis, which results in them flipping back and forth under/over some enemies.
3. Any other way to prevent the missiles from all acquiring the same target if other targets are present?
4. Effective way to end or remove Missile after set amount of time, since using shooter2 command doesn't use the missiles' lifespan properties?

What do you guys think?

My current script fails to load. Shooter2 works, but the items do not despawn so I added the get elapsed time section, and now it crashes:

void shooter2(void vName, float fX, float fY, float fZ, float Vx, float Vy, float Vz)
{//Spawns projectile next to caller and move it with speed
//vName: Model name of entity to be spawned in
//fX: X location adjustment
//fY: Y location adjustment
//fZ: Z location adjustment
//Vx: X speed
//Vy: Y speed
//Vz: Z speed

  void self = getlocalvar("self"); //Get calling entity
  int Direction = getentityproperty(self, "direction");

  void vSpawn; //Spawn object.
 
  vSpawn = spawn01(vName, fX, fY, fZ); //Spawn in projectile
  if (Direction == 0){ //Is entity facing left?               
      Vx = -Vx; //Reverse Vx direction to match facing
  }

  changeentityproperty(vSpawn, "velocity", Vx, Vz, Vy);
  return vSpawn;

  int time = openborvariant("elapsed_time");// get time
  if ( time % 300 == 0 int time = openborvariant("elapsed_time");// get time  )
{killentity vName; // ????
}
}
 
I opened and modified an existing .gif, Ironman's d13.gif. Now the game crashes and says 'Unable to load file 'data/chars/Ironman/d13.gif'. I did not change the name or location. How do I implement new or modified .gif's?

seems that you put a non indexed image when swaped the d13.gif
so as this part you need to understand how to edit images to openbor stantards  that is 256 colors indexed images
rgb images dont work
 
About the image, Rafhot already got it.

About your other questions:
Next, if the missile did not 'hit', at the 0.25 second mark I will us the generic 'shoot' command to relaunch the missile, at the same coordinates it disappears, with 'chase' property.
The missile entity will spawn a copy of itself? OpenBOR doesn't let you do recursive spawns (an antity can't spawn a copy of itself). In fact, it DOES let you do this, but it will screw the spanw function - the spawned entity has wrong position, animations, etc. Seams the engine simply doesn't know how to handle that new entity.

So, for this, you will need to have two different missile entities. One spawns the other one.

1. How to determine whether or not to spawn chase missile based on if original missile 'hit'?
If you use the duplicated entity trick above, it will be super easy - just spawn the new entity in its follow1 animation

2. Chase missiles don't chase on the Y axis, which results in them flipping back and forth under/over some enemies.
Chase function doesn't takes Y in account, only x and z axis. you will need to write a function for that. using some math, you can even make it rotates itself based on target's position. But its kinda tricky to do.

3. Any other way to prevent the missiles from all acquiring the same target if other targets are present?
They are making what they should - chase looks for the nearest available target. If a target is near, all the missiles will target it- specially if you spawn the missiles at the same position, with the same velocity.

Using script, you can sort the targets randomly and set a new target for each missile - but I think the internal routine of the "chase" function will make it choose the nearest target again. So I think you can sort the targets and set a random target but you will need to code a "chase" function yourself.

4. Effective way to end or remove Missile after set amount of time, since using shooter2 command doesn't use the missiles' lifespan properties?
Are you sure? I use shooter2 function on my game with lifespan and it works. Right now, there is a bug with "killentity" function in OpenBOR - sometimes the entity simply doesn't dies. WhiteDragon tried to fix it but the bug is still persistent. The onyl thing which really kills an entity without any issue is "lifespan".

My current script fails to load. Shooter2 works, but the items do not despawn so I added the get elapsed time section, and now it crashes:

It won't work that way. Animationscript codes are run only one time per frame when you call them. So it won't count time that way. Plus, there a synthax script on your code.
 
@rafhot
Thank you for the response. We edited a currently used .gif that is indexed 256. Our new .gif is still indexed 256. Still does not work. Am I needing to to preload it somewhere in one of the other files? Or do I need a special editor that allows me to put a center on it?

@O Ilusionista
Thank you for the response. Can you point me at a mod that I can get that has examples of some of these? I am new to scripting and the logic language is still giving me a hard time. Especially, when trying to combine it with the BOR language.
 
I've got it basically working, but would still appreciate anything that has missiles that chase in the Y axis, and missiles that constantly update their targeting and direction.

So what I ended up doing was having WarMachine shoot a bunch of small missiles out in different directions with the 'shooter' command. These missiles have a lifespan of 0.26 seconds. Each of these missiles 'targets' and fires a 'targetedshot' of a second entity of the same missile with a longer life. It looks pretty cool. The missiles fan out and then all jet and at targets. I even made a couple shoot up out of the screen and target coming back down. But that was hard because no Y axis targeting so I had to cheat it by shooting with a -velocity Y.
 
Back
Top Bottom