Scripts / help needed with tank script.

Author
Message
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 20th Mar 2015 19:07 Edited at: 20th Mar 2015 19:29
I am working on a animated tank,
First i am going to try is make the Tracks spin go forward.
This is what i got so far, but the tracks animate and turns but not going forward. any help with this.





Gr
Harry
Harry
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 20th Mar 2015 19:58
Are you using some trigger to run script?
You are calculating PlayerDist, but you are not using it, ie: If PlayerDist<100 then....
Non expert scripter, but till one coming, ago ttime I had writted this one for move jeep, but I'm working with StartTimer(e).



so, you can control when move/stop animated tank. Although mine is not rigged (animated), since jeep model is not mine.
HTH

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 8.1 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 20th Mar 2015 20:35
i will give it a try..
Thanks

Harry
PM
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 20th Mar 2015 20:51
I found out that if i set collision off in the fpe file, then the moveforward command works, and the tank goes forward.. Bu not when i set collision on.
I tried mode 1, 2,3 etc etc. but it get stuck on the ground.

Harry


Harry
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 20th Mar 2015 21:21
Maybe you has to play with collision off/on via script, in order to fit yours needs.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 8.1 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 20th Mar 2015 21:51
well i got it moving forward, with collision off, but how do i made it stop. my code is in a loop.
i don't know much of coding , so i have been trying for a couple of hours now, but i don't get it.
any help Please...
The code i've got so far:



Thanks
Harry
Harry
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 20th Mar 2015 22:03
depends why you want it to stop
what are you trying to make the tank do? or is this only to test the animation?

you will need to give the moveforward command a condition

something like
if GetPlayerDistance(e) > 500 then
RotateToPlayer(e)
MoveForward(e,100)
end

note you seem like you need to add
Fixnewy = 180
in your fpe file if the tank is facing the wrong direction
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 20th Mar 2015 23:58 Edited at: 20th Mar 2015 23:59
Hello smallg,
What i want is to test all my anims and try to make a tank more alive.
Follow a path and when the player is in range rotate at player and shoot. etc
I have anim frames from 0-360 both tracks turning. 361 to 720 right track, 721 to 1080 left track.


I changed the code a bit and now it is following the player the only thing is that the animtion plays when the player is in range, and when i walk away the animation stops.
It should be the other way around.
Here is my code.


many Thanks
Harry
Harry
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st Mar 2015 09:48 Edited at: 21st Mar 2015 11:09
You didn't close the first if distance statement before the next 1, edit; that second statement is never true while inside the first - it'll never be greater than 500 AND less than 500

Also try using loopanimation instead of playanimation



try that
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 21st Mar 2015 23:41
Ive got the basic working. if it follows then the tracks animate and stops.

Is it possible to let the tank follow waypoints?
And how do i set that up?

Gr
harry
Harry
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 22nd Mar 2015 16:59

I fear that currently only the characters follow a waypoint.

For this reason I used the time instead of a waypoint in the above script.
I used the river as a waypoint, and measured the time it took the raft to reach a bend, then I used this measure to rotate the raft conveniently and so on, until the end of the river. Although this is not a very nice way, but it is achievable.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 8.1 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 22nd Mar 2015 18:31
as 3com said you can make your tank a character and then it will follow waypoints with a script that includes the following code

life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 23rd Mar 2015 14:12
I saw youre remore car script and tried it with the tank.
Now i got a remote control tank


Gr
harry
Harry
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 23rd Mar 2015 16:03
haha nice, that was the initial idea for my script but i changed it after a few minor issues with the camera control (no easy way to control the camera angle being the main issue), looks good there though
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Login to post a reply

Server time is: 2024-05-20 00:39:16
Your offset time is: 2024-05-20 00:39:16