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 / Advanced scripting help (willing to work but need help)

Author
Message
8thsinner
15
Years of Service
User Offline
Joined: 3rd Jun 2009
Location:
Posted: 12th Jun 2009 04:43
Okay so I want to try making my own script. Please read all of this.
I am a complete noob here when it comes to scripting so it probably won't be easy, Despite the excellent advice in the manuals of which I have three, the official release, the community guide and revision 8...

i will say first that they do indeed break things down quite nicely but they are pre writtin scripts which for a noob doesn't mean much without extensive study and by that I mean printing out a hundred different things and cross examining them and what not...
Like most noobs I want to try and get stuck in, I reckon I will learn better, So I would like to dedicate this thread to myself and other beginners.

I DO NOT WANT codes and scripts copied from your own collection, I only may need tips and advice on where to look for things I need, thus giving me all the relevant information and leaving out the complete guess work. I am happy to test my own scripts, upload them for analysis and take advice on why they are or are not working...

So to begin
I want a script that does the following...
1) Spawns a character when near a certain area. (in order to reduce cpusage)
2) Character, will do nothing initially bar wait for payer to be withing certain distance
3) If a second alarm is set off, second trigger? character hunts player if seen or follows way points if not seen
4) If player is found during movement then entity hides if possible, loads a weapon and fires from cover.
5) does not move from cover without a full reload of weapon.
6) selects levels of cover based on nearness and moves to it whilst firing
7) takes cover again, reloads and continues pursuit using doors if needs be
8) if player lost, then walk around randomly for set duration of time
9) If plr not found within time frame then continue to waypoints as per normal
10) if player found then continue using cover and firing

First issue (scripts relating to each other)

Now thats a hell of a lot of things to try and script, And I believe I understand a little of what goes into it, However I am still unsure of a lot of things.
Firstly, I believe that all scripts used in relation to working the AI must be designed to work together, for example
Must I have a script for ?
Triggering appearance of entity from say 1500 units? sending plr through a corridor of some sort > trigger zone (ifused)?
Triggering the hunt or follow waypoint script? entity > (appearance)?
triggering the crouch and approach using cover...+ waypoint control... Entity (main)?
Triggering the crouch, cover and keep in a certain distance script entity > (Shoot)?


Now, Is that the right way/order to try and sort all of this stuff out? Or am i misunderstanding the order scripts work in?
The number of states used is only relevent to these scripts? By that I mean state 7 isn't reserved in maincode understanding to a paticular type of action such as animating right? Except when talking about waypoints, It seems to me that there are only five in total allowed. Is that true?


Second issue

Some codes I am coming accross multiple times but still have no idea what they mean
1)framestatart? I see this all over the place and the official manual leaves a lot to be desired in controling it's use. or what it does.?
2)Animations > A lot of them are listed in the guides but some scripts refer to animations such as 102-106, being all the same. WHAT? I see in a few of the animations lists some things say SAME, eg 32 33 34 45, does this mean different animations for similar actions? Such as crouch? If so, Can I randomise the crouch animations, and the movefore animations etc?
3) How do the animations work? are all entities given the same skeleton therefore the animations will always control the same structure? and if not, are all official characters able to follow the same animation codes?

I think, If I can understand some of the above issues I can go about trying to write this code. thats the thing, a noob simply does not understand the limitations of lack there of of coding potential. I have been hapily playing away with changing certain things in working scripts and some times things work sometimes they don't, But I have no idea what can be added, what, when added renders others useless, and what makes my entities freeze at times...

I really hope theres a few of you advanced scripters out there that can work with me during the testing and education of my scripting adventure. I thank you for your time thus far in reading alone, and hope we can work together and possibly help other noobs too.

Sincerely
8th
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 13th Jun 2009 11:49
I think the best way for you to approach this would be to get each piece working at a time.

Start with getting the entity to spawn when you want it to, then move on to getting it to follow waypoints or chase after the player.


Quote: "The number of states used is only relevent to these scripts? By that I mean state 7 isn't reserved in maincode understanding to a paticular type of action such as animating right? Except when talking about waypoints, It seems to me that there are only five in total allowed. Is that true?"


The state of a script is nothing more than a variable to help you control what's happening. You set the variable and check it yourself, it means nothing more than that. There are no state values reserved or anything like that. You can set the state value to whatever number you like (within the limits of an integer, but I doubt you're going to be needing that many states, especially when your script cannot exceed 150 lines) and you may use as many different values as you like.



The one and only,


8thsinner
15
Years of Service
User Offline
Joined: 3rd Jun 2009
Location:
Posted: 13th Jun 2009 21:37
Okay,
Well I knew nothing about the 150 lines rule, good to know.
As for the approach, thats how I have started, not that that was my intention, I believed I had worked out waypoints, and started adding other conditions and actions, with a null result... And the tested waypoint rules seemed to work but I found a number of false animations or damaged perhaps...

Are there any particular entities that do not quite work right?
I was using the ww2 thug with pistol as my test.

And can we say brain fry...seriously...
DarkFrost
15
Years of Service
User Offline
Joined: 3rd May 2009
Location: ON, Canada
Posted: 13th Jun 2009 23:53
My god that sounds like a nice script to use for AI. But i agree with Ply take your time,and work through it peice by peice. I would help but im a beginner when it comes to scripting.

8thsinner
15
Years of Service
User Offline
Joined: 3rd Jun 2009
Location:
Posted: 15th Jun 2009 22:17
Okay, so I have spent the last five days nearly everyday, and I have a few more questions.
1) Why do my enemies become invisable during certain things, Eg after a shotdamage=1:state=5 redirecting to shoot code?

2) I have had some success, creating a randomly choosen attack and defensive operations based on player distance but using shootplr,useweapon, etc, I am having some troubles..Can some one explain exactly what they do. and when they are best used?

3) My entity sometimes shoots me through the walls, Might be related to above issues?

4) How do you use the timerstartdelay codes? can someone display to me a simple script showing how to for example...ifplayerseen, wait ten seconds then go to state X?
shadowfire
15
Years of Service
User Offline
Joined: 24th Mar 2009
Location: England
Posted: 16th Jun 2009 22:28
a lot of those scripts already exist in the normal scriptbank.
for example, cover, in scriptbank:people makes the character go to cover when it sees the player, and the original zombie scripts only activate when the player is close.

the onion mind probes are coming for your soul...
they take your humanity... and give you...
onionity.
8thsinner
15
Years of Service
User Offline
Joined: 3rd Jun 2009
Location:
Posted: 18th Jun 2009 23:16
Yeah, theres loads of scripts options already there. But I am trying to learn how to do it all, and probably the hard way at that. Copying even elements of scripts doesn't teach me anything what so ever...

Still need help

Login to post a reply

Server time is: 2024-11-25 02:57:15
Your offset time is: 2024-11-25 02:57:15