Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Animated Tank Script

Author
Message
007
13
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 10th Sep 2011 07:13
Animated Tank Script

Hello Dudes,

I have an animated tank enemy (character), it is animated (the wheels and the turret rotate).

It is working good, however it has some bugs and i ask help to the more experienced folks here that understand well fpi scripting, because i am studying hard, i have read the oficial community guide, but still have a LOT of doubts and difficulties with fpi scripts

I took the idea of the old tank script from this thread:

http://forum.thegamecreators.com/?m=forum_view&t=165945&b=24

But i changed the script a bit, i removed the waypoint part. I decided to don`t make the tank follow waypoints because it does behave very strange when the tank turn at the end of the waypoint.

I added "movefore=300" after the "useweapon" at the main script, so this way the tank will chase the player and fire at him.

So the tankk works fine until player shoots it, because when the player shoots at the tank, the tank freezes and the animation stops. I don`t know how to make the tank keep chasing the player, firing at him and shooting at the player.

Here is the fpe:



Here is the main fpi:



Please, can someone do this favour of fixing this bug to me?

I know the bazzoka is not placed correctly at the turret, i placed a firespot, but i will correct this later, i will apply a transparent texture in the bazooka so this way it won`t be visible, but at the right moment my problem is with the script.

I am attaching the tank with its scripts.

Cheers.

Goldenye 007 N64

Attachments

Login to view attachments
Pirate Myke
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 10th Sep 2011 20:37
I was fiddeling with it a bit. This thing chases and shoots. Needs more animations.

Like an idle with turret moving back and forth.
Forward - wheels moving turrets sweeping.
Fire at player
hit or damage animation

Its a great model once again.

When you shoot it the internal throwback.fpi script is engaging freezing your animations.
Try putting nothrowscript = 1 in the fpe file under the script section.

Set this script in the download button to be the main ai of your tanks.

I put it on 10 x 20 grid common floor with a cople of sections of the ww2 bunkerfull segment for a quick test.

What I found. The main reason I think it fails is because the flak it is firing is causing damage to the tank also. Turn on the debug stuff under file preferences and look at the tanks readout. Notice the H with a number that drops fast. That is its health. Flak is destroying the tank as it fires. The player firing at it just kills it quicker.

Also the lack of maybe 3 to 4 second spans of animation in the plans. Have a 3 second Idle 75 - 90 frames of animation. FPSC plays them really fast with nothing happening and sometimes slow when there is a lot happening.
Set up maybe 60 frames for the fire sequence.
60 frames for the chase player.
so on and so on. Having this time also give the engine a chance to catchup.

I have some crued logic set up in the at the bottom of the script for flow idea example. Create the logic for each of these section of tasks wanted or put your code into these spots. it makes things clearer and keeps the code easy to read and debug.

Hope this makes it easier to complete.


Attachments

Login to view attachments
007
13
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 10th Sep 2011 22:00
Hello my friend Pirate Myke,

Thanks again my friend for your support

As i said, my main objective now is learn FPSC, learn FPI Script before i can create a game of mine.

I now it needs more animations, i will do this, however, as i said, my problem i with controlling animations via script.

But i am very happy that you already created in the fpi code those states where animation changes, in example:

:state=1,ifweapon=1,rateoffire:state=2,animate=2,useweapon,movefore=300

So i know that animate=2 is the shoot animation that i will create, now i think it is easier to finish it.

I will try the nothrowscript = 1 and see what happens, and also will tweak the animations using 60 frames for each, and then i post the results.

Thanks,

007

Goldenye 007 N64
007
13
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 10th Sep 2011 22:34


THANKS MY FRIEND, hehehehhehe

It worked, yeah! I am so happy! The problem was solved just by adding this line:

nothrowscript = 1

And voilla!

Now i will tweak the animations and then post here for you.

Cheers!!!!!!!!!!!!!!!

Goldenye 007 N64
Pirate Myke
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 11th Sep 2011 12:50
Cool, glad it worked for that part.
You can have your custom animations at whatever frames you want. You can have anim0 be fly off into the sunset. it does not matter.
As long as you know which animations frames do what, and point your scripts to those animations where needed.


Tirnam
13
Years of Service
User Offline
Joined: 18th Sep 2011
Location:
Posted: 18th Sep 2011 19:49
Hello Dear 007
in this script ( Textured = [Empty] )
Why ?
scorpionmk9
13
Years of Service
User Offline
Joined: 18th Sep 2011
Location: netherealm
Posted: 18th Sep 2011 21:45
Tirnam: At my knowledge people usually do this when they want to use the texture information that is embeded in the model. I do this when want to use a model that has multiple textures, i export from 3dsmax using Panda Exporter.

As long as the textures that you exported are in the same location of the x file, this work.

Hope answers your question

Login to post a reply

Server time is: 2024-11-24 05:39:41
Your offset time is: 2024-11-24 05:39:41