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 / GRAW style order control over squad and giving orders?

Author
Message
X10 User
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location:
Posted: 27th Feb 2009 03:05 Edited at: 27th Feb 2009 04:49
Im not a genius when it comes to this scripting lark, im still finding mu feet and usually rush to get a new script out thinking ive hit upon a great idea only to find out theres a thread already about it so im looking before i leap this time.

now i understand there are a lot of 'ally' scripts out there for x9 but i was wondering if it might be possible to code in a sort of squad based behaviour, well maybe thats the wrong description, more sort of Ghost Recon order giving system, where with single keystrokes you could direct certain entities to perform pre programmed actions, see this i knocked up as an example


It gives you command over an entity with a preprogrammed target (altho theoretically if my mathes serves correctly, and there is the possibility for an infinite number of states then you could simply have multiple set target commands and number your targets correspondingly and give the player key strokes to adjust the targets state value manually effectively giving them control of the entities targeting system?see this example
for a basic idea?

The actions the above mentioned perform are very basic i didnt take any time to animate or plan out the movements so will occasionally get stuck at the edges if less than 8x8 squares when performing the autonomous actions (manouvre randomly and fire, and the manouvre randomly till orderd otherwise)

The Commands are:

-T (activate/deactivate)

While active

-Y (attack and move foreward) performs one per keystroke
-U (retreat) performs one per keystroke
-I (retreat and then fire once from safe distance) performs one per keystroke
-O (manouvre randomly round the map taking the odd pot shot) until deactivated
-P (randomly manouvre round the map)until deactivated
-k (self destruct)


Then using the activate option i used to put the entity in and out of standby you could control multiple enemies, say numbering them on the number pad, selecting a different number giving you control over a different 'squad' member

eg squad of four controlled by number keys 1 to 4

when 1 is pressed entity 1 is active and the generic keys are used to give orders, pressing 2 registers in entity 1's script to put it into standby (where the other 3 are at this point) so it will ignore the order keystrokes til active again, while at the same time in entity 2's script this registers as its cue to become active and begin responding to the generic command key strokes, and so on and so forth for the remainder of your squad

The point of this is being able to assign different entities to perform different actions, giving the impression of a somewhat cohesive and controllable AI team.

Come on, let me have it

Theory no More!

its 3;30am but i was so intrigued by this concept i had to go ahead and use the above command script, tweak it just the way i said it should be tweaked and bam! it worked first time!

place 4 character entities assign each one these scripts in order (the characters are selected using z,x,c,v but u must go through in that order at the moment, whn u get to v back to z again) give each character the script with the corresponding letter, eg squadz.fpi for the entity controlled by z, squadx.fpi for the entity controlled by x and so on (yes i know c is crouch but im to tired to worry now!) once ready, load up the level and select your characters (remember z>x>c>v back to z and on through is the order, later i will make it any order but for now, courage)

now as you go through each letter you can give corresponding orders to each entity

still a few glitches to be worked out but what d'ya think for a first draft?

Squadz.fpi

Squadx.fpi

Squadc.fpi

Squadv.fpi


once you have selecterd your unit, give it a command as described above and off you go, next unit give command, i only tested it with the forward backward commands as the script stil expects a target variable and altho that one should be easy enough to be able to let the player cycle through, i just am too tired to code

be gentle with it! its fragile lol, still working on the kinks, like you seem to need to wait for it to finish one command before moving to another command or unit

but go through it methodically and you should be surprised, i was! i cant believe it just worked first time lol, well all i did was change the scancodekey conditions to alternating letters instead of the same allowing different entities to use the same keystroke commands at different times, you could also play around for teams of two teams of two where in each pair follow the same keystrokes at the same time but randomise the action they take within the pairings?

on a side musing, i wonder if it would be possible using this command system to rip out chunks from the better ai scripts, ie strage, shoot close, pace etc, re number the states, edit in the scancode state selection eg order it to pace a waypoint, then manually order it over to attack, then send it a command to strafe, then when your finished order it back to waypoints etc?

GOD Im gonna have so many ideas now >.<

- Why is everyone on here so rude? -
Apple Slicer
16
Years of Service
User Offline
Joined: 14th Nov 2008
Location: Oregon, in the rain...
Posted: 27th Feb 2009 03:22 Edited at: 27th Feb 2009 03:22
That's really really cool. Have to mess with it later though.

Till Thy Migration Come...

Z 4SS4SS1N
16
Years of Service
User Offline
Joined: 30th Jul 2008
Location:
Posted: 10th May 2009 08:19
Sounds really cool. I cant wait to see the final version (no kinks).

Login to post a reply

Server time is: 2024-11-25 01:38:48
Your offset time is: 2024-11-25 01:38:48