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 / attack animation script help

Author
Message
dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 13th Mar 2011 03:28


Thats the script i based off a existing melee attack one - i barely know about fpi scripting.

I have a model, animated (not based off TGC bones).
With the following keys:
0-30 walk-01
0-120 walk-02
150-190 run-01
150-210 run-02
250-333 attack-01
320-400 attack-02
390-418 death-01
478-500 growl-01
500-550 death-02
565-650 death-03


The creatures first attack is with claws, 2nd is bite.

Tho i have no idea how to properly script the animations so it can attack, die and walk around if waypoints are set.
The script above did nothing - it was just standing in one spot.
Wolf
17
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 13th Mar 2011 04:10
Could you please post the creatures .fpe?



-Wolf

God Helps the Beast in Me!
Pirate Myke
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 13th Mar 2011 04:25 Edited at: 13th Mar 2011 04:26
;DETECT
:state=0,plrdistwithin=300,plrcanbeseen:waypointstop,state=9,rotatetoplr,setframe=478
:state=0,shotdamage=1:waypointstop,state=12,rotatetoplr,setframe=478

First off this script will never get out of state=0

Neither of the two line point to another state that exists in the current code.

Download the FPI Edit pad in the top section of the script section.
That will at least give you the commands and basic meanings.

This script was probably the worse one you could start with.
It is incomplete.

On a piece of paper Do This:
What do you want the Character to do when spawned. (Idle or Intro)

How close do you want the player to be when this character is activated? 100, 200, 300, then what do you want it to do (Walk towards player or attack or what ever)

When a set distance from the player within 100. What do you want the character to do to the player. (random Melee attacks) Player loses points, HUDs display.

Can the player inflict damage back

When the player inflicts enough damage to the character, Play death animation and destroy the character. Respawn new ones, Unhide Keys, Open doors, What ever.

Can the character kill the player.

__________________________

Use a script like this one I modified:




Adjust the distances to your taste. Replace the anim numbers with yours or adjust your FPE file to accomidate this script.

This should get you started.
You will still need to do some changes for your situation.

Download FPI Edit pad it is a great tool. I had uploaded the actions and conditions to 118.8 at the end of the file.

Scripting hints. Pay attention to the :'s

:Condition,Condition:Action,Action
:Condition:Action,Action

Hope this helps out a bit

Nothing but coffee in my veins 'Insomnia is Coming'
dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 13th Mar 2011 10:35

creatures fpi.

Yea iv got the fpi edit pad.

Id just want to start with basic script first (can change distance later), and can keep it idle in the beginning.

So framebeyond 2 values are start frame and then the number of frames to play right?
Pirate Myke
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 13th Mar 2011 11:18 Edited at: 13th Mar 2011 11:28
Framebeyond is a condition, checking an animation for when it gets beyond frame number stated.

Framebeyond=2 13
Would be Frame beyond in anim 2, 13 frames from start

Framebeyond=2 25
Would be frame beyond in anim 2, 25 frames from start

Start with this then.

:state=0,plrdistwithin=100: Do Something,State=10
:state=0,plrdistfurther=100:animate=IdleAnimNumber,state=0

:state=10,Some condition if needed:Setframe=WalkAnimNumber,state=11
:state=11:incframe=WalkAnimNumber,state=12
:state=12,framebeyond=2 15:plrsubhealth=-30,sound= some sound,state=13
:state=13,frameatend=WalkAnimNumber: Do something,Send to a different state or send back to state=0

What it does:
If player is within 100 unit, do something then goto state=10
If player is further then 100, Just do Idle animation and check to see the players distance and loop until player get within 100 units of character.

State=10, 11, 12 just run through a walk animation or something else you want it to do. Or you can just loop it back to state=0 to check player dist from character.

Just think of it as a big circle with a bunch of thing to check and react to, then loops it all over again.

Save different versions of your script incase one is working then all of a sudden does not.

Nothing but coffee in my veins 'Insomnia is Coming'
dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 13th Mar 2011 13:18
oh, yeah fpi didnt have enough info about that command

Btw, i do notice that quite often ppl jump from step 1/2 to 10... any reason for that? Besides leaving room for additional code in between.

Also, it would be stupid to make just another thread for this:


Im trying to show message after the item is picked up (a document etc) but cant find a condition that would check if item was picked up. Everything i find seems to work before its picked up.
Pirate Myke
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 13th Mar 2011 17:21
Cantake, is the condition to check that a player can take an object.

Move this part of the first line.
fpgcrawtext=You feel a gentle breeze. to the state=4 line.
That would try and show it after the plr has come within 40 from the object and the player has taken the object. But you need to set timerstart action somewhere in State=10 line. You have not started the timer yet. Storyteller has done a lot with these commands.

http://forum.thegamecreators.com/?m=forum_view&t=171157&b=23

Try this:

desc =Pickup Text for clue 1

;Triggers
:state=0:fpgcrawtextsize=32,fpgcrawtextfont=Arial,fpgcrawtextr=255,fpgcrawtextg=255,fpgcrawtextb=255,fpgcrawtextx=50,fpgcrawtexty=80,state=10
:state=10,plrdistwithin=40:state=1,playertake,coloff,timerstart,plrsound=audiobank\misc\ping.wav,state=4
:state=1:rundecal=5

;WAIT
:state=4,timergreater=5000:fpgcrawtext=You feel a gentle breeze,state=12
;DESTROY TRIGGER
:state=12:destroy


The nice thing about FPgcrawtext is it can be called from the entitys script also. You do not have to have it work from only a trigger zone. But people percieve it as a cheap work around and dont really like it. HUDS are more acceptable.

Look through Storytellers stuff on this.

Nothing but coffee in my veins 'Insomnia is Coming'
dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 13th Mar 2011 18:05
hmm, yeh the fpgcrawtext=You feel a gentle breeze, should actually be before the timergreater, else it just destroys it faster then i can read.

Yeah i saw hes work, but sample alone was already 100 lines of code makes me dizzy right now to follow it all.

I did get it once to display first word for a fast moment - it possibly stops the script cuz the item disappears when u pick it up.
dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 13th Mar 2011 18:11
dang no edit button.. forgot the script that gave me the first word for a sec.

as if the timer doesn't work..
Pirate Myke
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 13th Mar 2011 18:24
Its not going to work that way. Timergreater is a condition and has to be within the first two :'s. FPGCrawtext is an action and it needs to be after the second : in a line.

Yes it will display it, but only till the state changes
the 'fpgcrawtext=You feel a gentle breeze.,' part needs to be in a different spot:

Try this:

;Triggers
:state=0:fpgcrawtextsize=32,fpgcrawtextfont=Arial,fpgcrawtextr=255,fpgcrawtextg=255,fpgcrawtextb=255,fpgcrawtextx=50,fpgcrawtexty=80,state=10
:state=10,plrdistwithin=40:state=1,playertake,coloff,plrsound=audiobank\misc\ping.wav,state=4
:state=1:rundecal=5

;WAIT
:state=4:timerstart,fpgcrawtext=You feel a gentle breeze.,state=12
;DESTROY TRIGGER
:state=12,timergreater=8000:destroy

Try this


Look back at the first sample I gave you. That works calling the text. If you want the text to stay on the screen longer then thats what the timer will do for you.

Nothing but coffee in my veins 'Insomnia is Coming'
dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 13th Mar 2011 19:37
yea the real problem is that after the item has been picked up, the plrdistwithin=40 will be false, since there is no item andthe whole script basically seems to stop.
Pirate Myke
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 14th Mar 2011 04:50
Is this not a one shot deal?
Yes it is true that after the item is picked up in the above script it will display the text then after 8sec the text and the trigger should be gone forever.

Nothing but coffee in my veins 'Insomnia is Coming'
dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 14th Mar 2011 18:21
yeah but it doesent display at all. U pick it up and done. No message.

I thought of trying it based of the storyteller scripts but well attaching one to the main ai just did nothing (guess the objects could stay there, so player can go back and read it).

So i looked and found a "textease" tool and got a script:


tho all that happens is that i can see the firt word for a moment and done. It wont display it again.
Perhaps set it back to state=0 in the end would do it?
dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 14th Mar 2011 18:38 Edited at: 14th Mar 2011 21:04
sry for double, no edit button. But yea, setting it back to 0 works.. .but it still only displays the first word...
EDIT:
nvm, the edit wasn't a button and was in a such a unusual place -_-

Anyways, i got this far:



Made the code easier to read too, splitting onto several lines.

Ill be working on it, if anyone got any ideas, tell me.
If i get it optimized and nicely working ill post it as a separate thread for others to use, since i doubt im the only one who needs somethign like this.

But the problem remains. It only displays the first word not the whole sentence as if everything after a space is ignored. And when im out of distance it seems to blink the text every 1 sec until timer is done. As far as i can tell, it loops through the state 2 every 1 sec until condition is true.

EDIT2:


Its basically ok, but still displays only the first word. And i see nothign wrong with the code.
dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 15th Mar 2011 11:36
the oen word is a dang Wasp v2 bug :/
Pirate Myke
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 15th Mar 2011 19:20
Hey, Sorry for the delay. Project keeping me busy.

Anyway try this script in the main of an entiy.
Works on my side and tested.

change it for what you need or just use as an example.

File in download button.

Nothing but coffee in my veins 'Insomnia is Coming'

Attachments

Login to view attachments
dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 15th Mar 2011 20:35
yeah i got it workign when i didnt use wasp... but i need flashlight from wasp + few other things in my lvl so.. kinda no win situation.
Pirate Myke
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 15th Mar 2011 21:51
Sorry. Post on there thread for a response. This was part of the 116 or 117 codes. they should work.

Good Luck

Nothing but coffee in my veins 'Insomnia is Coming'
dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 15th Mar 2011 22:16
rawtext was 117 i think - but one of the devs for wasp did say hes got reports about that issue before.

Login to post a reply

Server time is: 2024-11-24 11:17:09
Your offset time is: 2024-11-24 11:17:09