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 / Custom work and free models packs for help with scripts

Author
Message
Stevie
User Banned
Posted: 15th Dec 2008 13:22
Firstly, if i successfully get help with the below problem i will give a lifetime membership to arteria3d, plus model a character to the spec of the helper.

Requirements from me are, that help is given immediatally, as time is the esssence.

I have two problems with my scripts

The first problem, is that when the enemy takes damage, and falls to the floor, on respawning, it takes him a few seconds to re-attack the player, even if the player is close - here is the script:

;header

desc = Goblin3

;Triggers


:state=0:animate=2,state=1

:state=1,plrdistfurther=380:rotatetoplr,animate=1,state=1


:state=1,plrdistwithin=380:rotatetoplr,movefore=10,animate=2,movefore=10:state=1

:state=1,plrdistwithin=90:animate=95,setframe=95,state=5;attack

;attack


:state=5,framebeyond=95 16:plraddhealth=-9,state=8,sound=gamecore\guns\cartoonpack\punch\punch.wav
:state=5:incframe=95,rotatetoplr
:state=5,frameatend=95:state=8

:state=5,plrdistfurther=90:rotatetoplr,setframe=2,animate=2,state=1


:state=8:incframe=95
:state=8,frameatend=95:state=5
:state=8:setframe=2,animate=2,state=1






The second problem in the script below, is that when the player attacks the enemy and he falls to the floor, then to respawn, the enemy will start to play its idle animation, then repeat his fight animation, and then continue on his next path of action


;Triggers

;WALKING WAYPOINTS


:waypointstate=0:animate=2,waypointstart
:waypointstate=3:animate=2,waypointnext
:waypointstate=4:animate=2,waypointrandom
:waypointstate=5:animate=2,waypointreverse

;DETECT PLAYER
:state=0,plrdistwithin=900,plrcanbeseen:waypointstop,state=9,rotatetoplr,setframe=3

;DETECT DAMAGE
:shotdamage=1:waypointstop,state=9,rotatetoplr,setframe=3

;INTRO ANIMATION
:state=9:waypointstop,incframe=1
:state=9,frameatend=1:animate=1,state=1

;MELEE ATTACK 1

:state=1,plrdistfurther=70:waypointstop,rotatetoplr,movefore=2,animate=3
:state=1,plrdistwithin=70:waypointstop,rotatetoplr,setframe=94,state=7

:state=7,framebeyond=94 30,plrdistwithin=70:plraddhealth=-10,state=21,sound=gamecore\guns\cartoonpack\cartoonsword\steelsword.wav
:state=7:incframe=94,rotatetoplr
:state=7,frameatend=94:animate=1,state=9

:state=21:incframe=94,rotatetoplr
:state=21,frameatend=94:animate=1,state=9;this is the callback after the enemy dies to reset his aimation



My email is yertari@msn.com - or you can speak to me on msn messenger at the same email address

I look forward to your replies

Thanks

Steve
The Next
Web Engineer
16
Years of Service
User Offline
Joined: 3rd Dec 2007
Location: United Kingdom
Posted: 15th Dec 2008 15:46
should really have been in the scripts board you will get more answers there maybe a mod could move it for him.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 15th Dec 2008 22:48
Try to avoid putting comments at the end of a line of code. Not sure if it'll help, but if anything it's good practice.


Are your characters using custom animations?


The one and only,


Dar13
16
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 19th Dec 2008 21:19
Quote: ":plraddhealth=-"


there should be a number there

I know not with what weapons WWIII will be fought but WWIV will be fought with sticks and stones-Albert Einstein
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 22nd Dec 2008 20:20
I haven't looked yet at your second script, but I looked at the first one. And there were ISSUES with it:

1. You have to pay attention to when things happen in your script. For example, in state=1 you are first checking for plrdistwithin=380, and then the next line is plrdistwithin=90. When the engine runs through the code, it is going to hit the first line (plrdistwithin=380) first, and execute that code. It will NEVER get to executing plrdistwithin=90 as 90 is within 380. These 2 lines need to be swapped so that 90 is first.

2. Although the engine won't tell you this, you really shouldn't have comments at the end of a line. Ply pointed this out, but it is not only good scripting. It makes it easier for you (or anyone else) to read the code.

3. Some of your code makes no sense as to why you have it that way. For example, the first line checks the state, and then sets animate=2, and then moves to state 1. Why? Just use ::animate=2. Then you don't have to worry about moving to state 1 right away, and the engine will always make sure that you are starting in animate=2.

4. Not necessarily an engine issue, but you really should increment your state numbers 1 at a time. Why do you go from state 1 to state 5 to state 8? Why not 0, 1, 2, etc.?

Here is what I came up with for your code for # 1. I expect to be paid handsomely in models for this.

Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 23rd Dec 2008 22:02
Leon it's to late. He needed help with the scripts from his pack and i already helped. Sorry

]

Login to post a reply

Server time is: 2024-11-24 16:43:35
Your offset time is: 2024-11-24 16:43:35