Scripting "vehicles_thinkers"??
Moderator: Moderators
Scripting "vehicles_thinkers"??
Anyone know how to add the THINKERS for the tank??. I have look the scripts of m1l3b for the truck and m5l2a for the tank thinkers but they are not working proper for me, they are foggy. My map is named test_... and i`m familiar with making AI to work. Please someone give me a clue what to do?????????? My question is for SP maps only.
Thanks
-------------->JimmyJBO
Thanks
-------------->JimmyJBO
Last edited by jimmyjbo on Sun Oct 06, 2002 1:59 am, edited 1 time in total.
Hello man , thanks for trying to help
When i say "vehicle_thinkers" which is in pak0-->global/vehicle_thinkers i mean the AI enemys (animation) that are jumping out of the tank when this is destroyed, or they are standing on the back of the truck while its moving and when it stops, they are jumping out too. Or they are driving a bike. a jeep +++.....
For the truck thinkers its almost working, i`m very close to make it happen proper. But for the Tank is that i`m worrying about. Its making my nerves
Have any ideas????
Thanks
----------->JimmyJBO
When i say "vehicle_thinkers" which is in pak0-->global/vehicle_thinkers i mean the AI enemys (animation) that are jumping out of the tank when this is destroyed, or they are standing on the back of the truck while its moving and when it stops, they are jumping out too. Or they are driving a bike. a jeep +++.....
For the truck thinkers its almost working, i`m very close to make it happen proper. But for the Tank is that i`m worrying about. Its making my nerves
Have any ideas????
Thanks
----------->JimmyJBO
clues
You might get some help by studying the mods with working tanks. The latest one is called "Blitzchnee" and there is one just called "Tank".
-
Mirek
- Colour Sergeant
- Posts: 77
- Joined: Mon Jul 08, 2002 2:12 am
- Location: Melbourne, Australia
- Contact:
Hey Jimmyjbo,
I've had a good look at the vehicle_thinkers.scr and can get the truck to do all the right things but all the other vehicles is a different story.
From what I understand, the scripts in that file are more to do with the SP game itself rather then free thinking vehicles to use.
The tanks will drive, explode and have men comming out of it but are only designed to target and shoot at an entity called level.playertanktarget. So if you create a script origin, assign it to level.playertanktarget and bind it to $player they should start shooting at you. My theory as yet untested.
Otherwise the targetting is done via routines in the level scripts themselves using proximity, origins and triggers.
some of the other vehicles -
The bike can not be ridden or have riders from this script. It only sets up the explosion/death effects. If you try the normal drive routine on the bike, it moves but the wheels don't turn.
Same with tha halftrack, except that it does set up the MG42 which can be used, but I had to take apart and rewrite the Halftrack section in map m3l3 to get the halftrack to shoot at the player for my map.
Tha artillary is setup to blow up on death but need the level.playertanktarget to shoot.
Like tltrude said, there are other scripts around and if you take the vehicles_thinkers.scr apart, there is good solid ground to write your own script.
///////////////////
I have made moving tanks before which although don't shoot at the player (yet to try), will stop for the player and play the animation when killed. This is how I did it.
I used a vehicles/panzer_tank.tik
targetname - panzertank
then created info_waypoints to form a path with a targetname - panzertank_path
this line goes in the script -
$panzertank thread global/vehicles_thinkers.scr::enemy_tank_think 1 panzer
what it means -
$panzertank thread global/vehicles_thinkers.scr::enemy_tank_think --> calls the thread
1 --> this one is very important.
If you set this to 1, the tank will become a none attacking tank, it will only drive. When you destroy it the Germans will come out from the wreck.
If you set this number to 0, it will become an attacking tank, however if you do not have the level.playertanktarget in your map, it will stop the script and wait until it appears making your tank useless.
panzer --> this one has to do with the model of tank u are using so that the right damaged/destroyed models are used on death. In this case I used panzer as I am using a panzer tank.
the other ones are - empty_turretless_tiger, panzer_desert, empty_panzer_desert, empty_tiger or leave it blank for the plain tiger tank.
to make the tank drive I used the following -
$panzertank.health = 100 // for testing only
$panzertank drive tigertank_path 10 30 200 400 // nice and slow
$panzertank waittill drive
I changed the heallth of the tank to 100 so I can kill it with a rifle
also if you add -
$panzertank.driving = 1
before the - global/vehicles_thinkers.scr::enemy_tank_think 1 panzer
the tank will stop if the player is near it, otherwise it will just keep going.
//////////////////
I know your almost there but I thought I'd just post what I use to run the truck in my map.
My map has a model vehicles/opeltruckgreen.tik in it with targetname 'truck01'.
I have also set up info_waypoints with the first one targetname 'truck01_path'
My script goes like this -
$truck01 thread global/vehicles_thinkers.scr::enemy_truck_think 500 6 $truck01_path NULL green "human//german_wehrmact_soldier.tik"
$truck01 modifydrive 270 500 256
$truck01 waittill drive
$truck01 disconnect_paths
so if you break the vehicles_thinkers.scr thread activator into parts it would go like this -
$truck01 thread global/vehicles_thinkers.scr::enemy_truck_think 500 6 $truck01_path NULL green "human//german_wehrmact_soldier.tik"
$truck01 thread global/vehicles_thinkers.scr::enemy_truck_think--> calls thread
500 --> the health of the truck
6 --> The number of germans on the back
$truck01_path --> the path for the truck to drive
NULL --> targetname of the trigger to start driving, none in this case so the truck start moving straight away
green --> this is the refrence to the truck model type - either green or NULL, this is important when the truck is destroyed so the right destroyed model is placed on death.
"human//german_wehrmact_soldier.tik" --> this is the Ai model u wish to have on the truck.
The Germans will jump of the truck when it reaches the end of the path or u kill the truck.
Provided the info_waypoints are setup correctly it should work right.
Also if you add
$truck01.nolights = 1
in your script before you thread the vehicles_thinkers.scr, the trucks headlight will be turned off, a nice thing if it's daylight.
//////////////////////////
Phew, hope it all makes sense
Cheers
Mirek
I've had a good look at the vehicle_thinkers.scr and can get the truck to do all the right things but all the other vehicles is a different story.
From what I understand, the scripts in that file are more to do with the SP game itself rather then free thinking vehicles to use.
The tanks will drive, explode and have men comming out of it but are only designed to target and shoot at an entity called level.playertanktarget. So if you create a script origin, assign it to level.playertanktarget and bind it to $player they should start shooting at you. My theory as yet untested.
Otherwise the targetting is done via routines in the level scripts themselves using proximity, origins and triggers.
some of the other vehicles -
The bike can not be ridden or have riders from this script. It only sets up the explosion/death effects. If you try the normal drive routine on the bike, it moves but the wheels don't turn.
Same with tha halftrack, except that it does set up the MG42 which can be used, but I had to take apart and rewrite the Halftrack section in map m3l3 to get the halftrack to shoot at the player for my map.
Tha artillary is setup to blow up on death but need the level.playertanktarget to shoot.
Like tltrude said, there are other scripts around and if you take the vehicles_thinkers.scr apart, there is good solid ground to write your own script.
///////////////////
I have made moving tanks before which although don't shoot at the player (yet to try), will stop for the player and play the animation when killed. This is how I did it.
I used a vehicles/panzer_tank.tik
targetname - panzertank
then created info_waypoints to form a path with a targetname - panzertank_path
this line goes in the script -
$panzertank thread global/vehicles_thinkers.scr::enemy_tank_think 1 panzer
what it means -
$panzertank thread global/vehicles_thinkers.scr::enemy_tank_think --> calls the thread
1 --> this one is very important.
If you set this to 1, the tank will become a none attacking tank, it will only drive. When you destroy it the Germans will come out from the wreck.
If you set this number to 0, it will become an attacking tank, however if you do not have the level.playertanktarget in your map, it will stop the script and wait until it appears making your tank useless.
panzer --> this one has to do with the model of tank u are using so that the right damaged/destroyed models are used on death. In this case I used panzer as I am using a panzer tank.
the other ones are - empty_turretless_tiger, panzer_desert, empty_panzer_desert, empty_tiger or leave it blank for the plain tiger tank.
to make the tank drive I used the following -
$panzertank.health = 100 // for testing only
$panzertank drive tigertank_path 10 30 200 400 // nice and slow
$panzertank waittill drive
I changed the heallth of the tank to 100 so I can kill it with a rifle
also if you add -
$panzertank.driving = 1
before the - global/vehicles_thinkers.scr::enemy_tank_think 1 panzer
the tank will stop if the player is near it, otherwise it will just keep going.
//////////////////
I know your almost there but I thought I'd just post what I use to run the truck in my map.
My map has a model vehicles/opeltruckgreen.tik in it with targetname 'truck01'.
I have also set up info_waypoints with the first one targetname 'truck01_path'
My script goes like this -
$truck01 thread global/vehicles_thinkers.scr::enemy_truck_think 500 6 $truck01_path NULL green "human//german_wehrmact_soldier.tik"
$truck01 modifydrive 270 500 256
$truck01 waittill drive
$truck01 disconnect_paths
so if you break the vehicles_thinkers.scr thread activator into parts it would go like this -
$truck01 thread global/vehicles_thinkers.scr::enemy_truck_think 500 6 $truck01_path NULL green "human//german_wehrmact_soldier.tik"
$truck01 thread global/vehicles_thinkers.scr::enemy_truck_think--> calls thread
500 --> the health of the truck
6 --> The number of germans on the back
$truck01_path --> the path for the truck to drive
NULL --> targetname of the trigger to start driving, none in this case so the truck start moving straight away
green --> this is the refrence to the truck model type - either green or NULL, this is important when the truck is destroyed so the right destroyed model is placed on death.
"human//german_wehrmact_soldier.tik" --> this is the Ai model u wish to have on the truck.
The Germans will jump of the truck when it reaches the end of the path or u kill the truck.
Provided the info_waypoints are setup correctly it should work right.
Also if you add
$truck01.nolights = 1
in your script before you thread the vehicles_thinkers.scr, the trucks headlight will be turned off, a nice thing if it's daylight.
//////////////////////////
Phew, hope it all makes sense
Cheers
Mirek
Mapping !!! Who needs sleep anyway !?!?!?
I'm back
Hello Mirek
Sorry for the delayed reply, but i was out for the weekend.
Thanks so much for your help, i love big answers
Yes everything makes so much sence to me, and of course the vehicle thinkers for the Tank works now. Also what you wrote for the truck, helped me in some way, cause i was almost there. And the lights on/off is very cool
Tell me how can i help you back man?
Ask anything you want, You might be surprised!!
------------->JimmyJBo
Sorry for the delayed reply, but i was out for the weekend.
Thanks so much for your help, i love big answers
Yes everything makes so much sence to me, and of course the vehicle thinkers for the Tank works now. Also what you wrote for the truck, helped me in some way, cause i was almost there. And the lights on/off is very cool
Tell me how can i help you back man?
Ask anything you want, You might be surprised!!
------------->JimmyJBo
-
Mirek
- Colour Sergeant
- Posts: 77
- Joined: Mon Jul 08, 2002 2:12 am
- Location: Melbourne, Australia
- Contact:
Hey Jimmyjbo,
No worries
, I'm happy if it helped you out. By helping you out I helped myself out as it made me look at the script even closer, have a good play around with it and inspired me to do my first main 'mod', later on that one.
Further to what I posted before,
I checked my suspicion and to make the tank shoot at the player add this line before you call the vehicles_thinkers.scr
level.playertanktarget = $player
and change the 1 to a 0 in the thread caller.
so the map script should look something like this -
level.playertanktarget = $player
$tank1 thread global/vehicles_thinkers.scr::enemy_tank_think 0 panzer
$tank1 drive tank1_path 10 30 200 400
$tank1 waittill drive
now the tank will shoot at the player, blow smoke when damaged and get stunned etc
also the Germans that jump out of the tank will only happen if youre model is panzer or tiger
//////
This is all nice but playing around I found the script to be a bit impracticle against infantry as I belive it was made for the tank on tank. So I've had an idea to rewrite/expand on the vehicle_thinkers.scr, make it more suitable and to easily include a tank in infantry SP games.
My script is called tank_thinkers.scr and will live in the global directory of a map and accesed with a single thread from the map as the original is.
So far I've created four of what I call 'tank modes' -
1) Hunter - where the tank will shoot at the player or any friendlies in the game. When it acquires a target it stops and remain standing until the target is no longer alive or visible for a certain amount of time, it will then keep going on it's path.
2) Blitzcreig - same as above but the tank doesn't stop until it reaches the end on the path.
3) Passive - just drives the path with no attacking
4) Tank Battle - still working on this one but the name is pretty self explenatory. It's not for the player to drive the tank but rather have tanks fight each other around the player, to maybe include in an assualt map of some type.
It has the drive command built in so it starts moving with no extra commands necessary.
There are AI jumping out when the tanks explode.
Each tank can be looped so it travels the path over and over.
The tanks can be respawned after destraction making it posible to have waves of tanks that keep comming.
You can have as many tanks in the map as you like but at the moment each tank has to have it's own path to travel.
There are different skill levels you can apply which will change the amount of time a tank takes to reload or is stunned for.
Anyways, This is my first big project of this sort. I hope to be finished and done testing by the end of next week, and hopefully Surgeon will let me stick a tutorial up too
If you or anybody thinks of something that they would like to see the tanks do then please let me know.
cheers,
Mirek
No worries
Further to what I posted before,
I checked my suspicion and to make the tank shoot at the player add this line before you call the vehicles_thinkers.scr
level.playertanktarget = $player
and change the 1 to a 0 in the thread caller.
so the map script should look something like this -
level.playertanktarget = $player
$tank1 thread global/vehicles_thinkers.scr::enemy_tank_think 0 panzer
$tank1 drive tank1_path 10 30 200 400
$tank1 waittill drive
now the tank will shoot at the player, blow smoke when damaged and get stunned etc
also the Germans that jump out of the tank will only happen if youre model is panzer or tiger
//////
This is all nice but playing around I found the script to be a bit impracticle against infantry as I belive it was made for the tank on tank. So I've had an idea to rewrite/expand on the vehicle_thinkers.scr, make it more suitable and to easily include a tank in infantry SP games.
My script is called tank_thinkers.scr and will live in the global directory of a map and accesed with a single thread from the map as the original is.
So far I've created four of what I call 'tank modes' -
1) Hunter - where the tank will shoot at the player or any friendlies in the game. When it acquires a target it stops and remain standing until the target is no longer alive or visible for a certain amount of time, it will then keep going on it's path.
2) Blitzcreig - same as above but the tank doesn't stop until it reaches the end on the path.
3) Passive - just drives the path with no attacking
4) Tank Battle - still working on this one but the name is pretty self explenatory. It's not for the player to drive the tank but rather have tanks fight each other around the player, to maybe include in an assualt map of some type.
It has the drive command built in so it starts moving with no extra commands necessary.
There are AI jumping out when the tanks explode.
Each tank can be looped so it travels the path over and over.
The tanks can be respawned after destraction making it posible to have waves of tanks that keep comming.
You can have as many tanks in the map as you like but at the moment each tank has to have it's own path to travel.
There are different skill levels you can apply which will change the amount of time a tank takes to reload or is stunned for.
Anyways, This is my first big project of this sort. I hope to be finished and done testing by the end of next week, and hopefully Surgeon will let me stick a tutorial up too
If you or anybody thinks of something that they would like to see the tanks do then please let me know.
cheers,
Mirek
Mapping !!! Who needs sleep anyway !?!?!?
-
LT.BARNES
-
Mirek
- Colour Sergeant
- Posts: 77
- Joined: Mon Jul 08, 2002 2:12 am
- Location: Melbourne, Australia
- Contact:
hey LT.Barnes,
Thanks to Surgeon when it's done it will be posted on .map under the tutorial section with a tutorial file and an example map.
It wont be a fancy map but it will work.
Keep watching the thread below, I'll post info on it when it's done. First one comming very soon.
http://dynamic4.gamespy.com/~map/phpBB2 ... .php?t=444
Cheers,
Mirek
Thanks to Surgeon when it's done it will be posted on .map under the tutorial section with a tutorial file and an example map.
It wont be a fancy map but it will work.
Keep watching the thread below, I'll post info on it when it's done. First one comming very soon.
http://dynamic4.gamespy.com/~map/phpBB2 ... .php?t=444
Cheers,
Mirek
Mapping !!! Who needs sleep anyway !?!?!?
-
Guest
Passenger slots??
I got the half track thinkers working but does somebody know where the passengerslots for a vehicle are defined?? For all I can see the Halftrack only has 1 slot available for the gunner .
I tried with the AttachPassengerSlot the values 2 and 3 but they don't work. The Opel truck has six slots and I want more passengers in the half track. I've got a solution for that which involves some binding and glueing but I wondered if we can define real passengerslots.
I tried with the AttachPassengerSlot the values 2 and 3 but they don't work. The Opel truck has six slots and I want more passengers in the half track. I've got a solution for that which involves some binding and glueing but I wondered if we can define real passengerslots.
-
Mirek
- Colour Sergeant
- Posts: 77
- Joined: Mon Jul 08, 2002 2:12 am
- Location: Melbourne, Australia
- Contact:
Hey,
My experiments where the same as yours, only found one spot. Maybe they never made anymore.
What gets me is that the tracks and wheels don't move when the halftrack is driving.
Unless someone knows or has a better idea then binding and glueing is the way to go.
Cheers,
Mirek
My experiments where the same as yours, only found one spot. Maybe they never made anymore.
What gets me is that the tracks and wheels don't move when the halftrack is driving.
Unless someone knows or has a better idea then binding and glueing is the way to go.
Cheers,
Mirek
Mapping !!! Who needs sleep anyway !?!?!?
-
Guest
Bummer, I was hoping that it was something if forgot when the tracks and wheels didn't move.
Anyway , I'm now improving the collisionmask for the halftrack that will contain 5 more passengers besides the gunner and hopefully with some extra features ...
I had a look at the opel_truck thinkers . I think I can more or less reuse the same basic code except instead of Attach/ Detach we do the magical glueing and unglueing ..
Way I reckon is that passengerslots are nothing more but pre defined glued points that occupies a gun turret..
If you look at M3|1, the complete higgins crew is glued so MOH is also not that consistent in the use of slots
Anyway , I'm now improving the collisionmask for the halftrack that will contain 5 more passengers besides the gunner and hopefully with some extra features ...
I had a look at the opel_truck thinkers . I think I can more or less reuse the same basic code except instead of Attach/ Detach we do the magical glueing and unglueing ..
Way I reckon is that passengerslots are nothing more but pre defined glued points that occupies a gun turret..
If you look at M3|1, the complete higgins crew is glued so MOH is also not that consistent in the use of slots
-
Mirek
- Colour Sergeant
- Posts: 77
- Joined: Mon Jul 08, 2002 2:12 am
- Location: Melbourne, Australia
- Contact:
I recon your right about the glue points, maybe just need to find the right refrence to them.
The hopefull thing is that during my travells through the animation files I did infact find animations related to halftracks, and one would assume that if the animations exist so must the way to use them.
There are 6 files inside the the Pak0.pk3 -
the path is models/human/animation/vehicle_artillery
halftrack_passenger1.skc
halftrack_passenger2.skc
halftrack_passenger3.skc
halftrack_passenger4.skc
halftrack_passenger5.skc
halftrack_passenger6.skc
All of them are haltrack exit animations and must correspond to the slot locations on the halftrack.
usage :
I tried them all and they work, so at the very least u can use the exit animations.
The door on the halftrack also looks like it could possibly open, but how?
Cheers,
Mirek
The hopefull thing is that during my travells through the animation files I did infact find animations related to halftracks, and one would assume that if the animations exist so must the way to use them.
There are 6 files inside the the Pak0.pk3 -
the path is models/human/animation/vehicle_artillery
halftrack_passenger1.skc
halftrack_passenger2.skc
halftrack_passenger3.skc
halftrack_passenger4.skc
halftrack_passenger5.skc
halftrack_passenger6.skc
All of them are haltrack exit animations and must correspond to the slot locations on the halftrack.
usage :
Code: Select all
$halftrackguy anim halftrack_passenger6The door on the halftrack also looks like it could possibly open, but how?
Cheers,
Mirek
Mapping !!! Who needs sleep anyway !?!?!?
