AI Controlled Vehicles (sort of)
-
- Scarf-wearing n00b
- Posts: 30
- Joined: Thu Dec 18, 2003 8:55 pm
AI Controlled Vehicles (sort of)
As far as I know I haven't seen this done. I've figured out a way to do AI controlled vehicles, even though it looks kind of goofy.
At first I had the idea to create an uniqueother actor and use the vehicle sprite for it. This made a vehicle that could sit there and spin in place. I figured this was because the animation was called something different than StandWalk.
I opened up the file in the hex editor and tried renamed driving to StandWalk, but that didn't fit. However reversing and standwalk have the same number of letters. I changed that and that did the trick.
So now there raiders can tear ass around the wasteland in dune buggies with the wheels going backwards. I need to do more testing though.
At first I had the idea to create an uniqueother actor and use the vehicle sprite for it. This made a vehicle that could sit there and spin in place. I figured this was because the animation was called something different than StandWalk.
I opened up the file in the hex editor and tried renamed driving to StandWalk, but that didn't fit. However reversing and standwalk have the same number of letters. I changed that and that did the trick.
So now there raiders can tear ass around the wasteland in dune buggies with the wheels going backwards. I need to do more testing though.
- Forty-six & Two
- Wandering Hero
- Posts: 1109
- Joined: Thu May 09, 2002 11:52 pm
- Location: Out of sight
- Contact:
- requiem_for_a_starfury
- Hero of the Wastes
- Posts: 1820
- Joined: Tue Oct 29, 2002 11:13 am
Pity spray can't handle the vehicle sprites then all we'd need to do is reverse the animation sequence and we'd be laughing. I'm assuming you're editing the buggy sprite?
I don't know anything about Hex editing but perhaps you might be able to swap the driving and reversing sequences and then change the header?
I don't know anything about Hex editing but perhaps you might be able to swap the driving and reversing sequences and then change the header?
If you can bear to hear the truth you've spoken
Twisted by knaves to make a trap for fools,
Twisted by knaves to make a trap for fools,
-
- Scarf-wearing n00b
- Posts: 30
- Joined: Thu Dec 18, 2003 8:55 pm
I'm not really that good at hex editing beyond finding a text string and replacing it. But that could work. Or if there was a way to change the length of the headers. Red would probally be able to figure it out if anyone.
It works for all of the vehicles I've tried so far (Buggy, APC, hummer). No crashes or major bugs. I haven't tried it with the tank yet, but I doubt the turret will show up on it. The vehicles follow waypoints well and look pretty good doing it at least over long distances. I haven't figured out how to get them to fire yet.
They also leave blood splatter when you shoot them, but that's what you get for driving with the windows down.
I'll post sprites and entities when I get home from work.
It works for all of the vehicles I've tried so far (Buggy, APC, hummer). No crashes or major bugs. I haven't tried it with the tank yet, but I doubt the turret will show up on it. The vehicles follow waypoints well and look pretty good doing it at least over long distances. I haven't figured out how to get them to fire yet.
They also leave blood splatter when you shoot them, but that's what you get for driving with the windows down.
I'll post sprites and entities when I get home from work.
- requiem_for_a_starfury
- Hero of the Wastes
- Posts: 1820
- Joined: Tue Oct 29, 2002 11:13 am
If you change the race to Robot you'd probably have to rename the sprite to replace one of the robots. Not a problem if you are using it under a path.
Personally I'd prefer an AI controlled Buggy to the tank bot anyday of the week.
Bert if you want to get them to fire you're probably going to have to equip them with a kick weapon (like the non-humanoid robots have) then they should fire if they've got ammo and are hostile.
Personally I'd prefer an AI controlled Buggy to the tank bot anyday of the week.
Bert if you want to get them to fire you're probably going to have to equip them with a kick weapon (like the non-humanoid robots have) then they should fire if they've got ammo and are hostile.
If you can bear to hear the truth you've spoken
Twisted by knaves to make a trap for fools,
Twisted by knaves to make a trap for fools,
-
- Scarf-wearing n00b
- Posts: 30
- Joined: Thu Dec 18, 2003 8:55 pm
yeah that did the trick. I think when I tried that the first time I just tried changing the sprite in the editor and not actually replacing the original sprite.requiem_for_a_starfury wrote:If you change the race to Robot you'd probably have to rename the sprite to replace one of the robots. Not a problem if you are using it under a path.
- requiem_for_a_starfury
- Hero of the Wastes
- Posts: 1820
- Joined: Tue Oct 29, 2002 11:13 am
Yeah it works, I don't think the tires are that noticeable though but as there's no dust animation it doesn't appear to be going very fast.
Anyone who does know something about Hex editing, can you implement the StandRun sequence as well, because if you set the movement priority above 8 the vehicle(actor) will just keep turning in place and as I said it doesn't appear to be travelling very fast.
I doubt you will be able to get the vehicles to attack though, as none of them have an attack animation sequence. They won't even be able to ram people.
Anyone who does know something about Hex editing, can you implement the StandRun sequence as well, because if you set the movement priority above 8 the vehicle(actor) will just keep turning in place and as I said it doesn't appear to be travelling very fast.
I doubt you will be able to get the vehicles to attack though, as none of them have an attack animation sequence. They won't even be able to ram people.
If you can bear to hear the truth you've spoken
Twisted by knaves to make a trap for fools,
Twisted by knaves to make a trap for fools,
- Red
- Hero of the Glowing Lands
- Posts: 2085
- Joined: Wed May 15, 2002 11:58 am
- Location: Nowhere (important anyway)
- Contact:
that's interesting... So the engine accepts the sprite having 32 frames? Does it use them, or just 16 of the 32?
I don't get that whole turning around thing.
As for strings, there are two types used in the headers: 0 ended (normal C strings wich end with the value 0x00) variable length strings which start with a number specifing it's length (nowadays this is a long - eg 4 bytes) followed by the characters. Obviously you'll need to update the length of the string if you shorten it. And until I make an editor of some kind it'll be quite difficult to make them longer since that'll screw up the rest of the data.
I don't get that whole turning around thing.
As for strings, there are two types used in the headers: 0 ended (normal C strings wich end with the value 0x00) variable length strings which start with a number specifing it's length (nowadays this is a long - eg 4 bytes) followed by the characters. Obviously you'll need to update the length of the string if you shorten it. And until I make an editor of some kind it'll be quite difficult to make them longer since that'll screw up the rest of the data.
...
- requiem_for_a_starfury
- Hero of the Wastes
- Posts: 1820
- Joined: Tue Oct 29, 2002 11:13 am
Well it appears to, but it's hard to tell.Red wrote:that's interesting... So the engine accepts the sprite having 32 frames? Does it use them, or just 16 of the 32?
Well the turning around thing is what entities do when you try to get them to do something they can't, for instance I've just buggered the stairs, in my map, I widened them (and updated the tiles) but now the actor won't go up them it'll just turn in place. Same goes if you try and make the actor travel across a gap in the tiles or past the camera boundry.Red wrote:I don't get that whole turning around thing.
If you can bear to hear the truth you've spoken
Twisted by knaves to make a trap for fools,
Twisted by knaves to make a trap for fools,
- PaladinHeart
- Strider
- Posts: 747
- Joined: Sun Feb 02, 2003 5:28 am
- Contact:
RE
I've noticed the same phenomenon on caps before.
-
- Scarf-wearing n00b
- Posts: 30
- Joined: Thu Dec 18, 2003 8:55 pm
really the only thing I plan on using these for are escort missions convoy attack where you escort or convoy attack missions with APCS, which move pretty slow anywayrequiem_for_a_starfury wrote:Yeah it works, I don't think the tires are that noticeable though but as there's no dust animation it doesn't appear to be going very fast.
(