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 / newbie looking for basic scripting help.

Author
Message
ironman21
User Offline
Joined: 9th Dec 2016
Location:
Posted: 10th Dec 2016 04:40
I'm not looking for someone to do the scripting for me. I am just looking to make sure i have the basics down and maybe a lil push here and there.
But for starters for each condition there has to be a action before there can be another condition right? Or can there be like one condition = 2 actions like persay enemyhealthbelow50% < condition ; enemyrundistance , findscover < 2 actions . or would that action just be one whole action instead of 2 seperate actions?
ncmako
5
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 10th Dec 2016 15:25
Hi ironman21, and welcome
Quote: " for each condition there has to be a action before there can be another condition right"

Yes, mostly. but you can trick it with just a action. There are a few commands that do this. But your correct per-say.
A good reference to start with is the complete syntax list available here...https://forum.thegamecreators.com/thread/180924
And Black Fox's script examples, avail here...https://forum.thegamecreators.com/thread/192148
Some are also already in your doc's folder.
Quote: " Or can there be like one condition = 2 actions "

Yes and no. Most scripts run like you said, one condition, then one action. But a lot of the commands
allow for two actions to follow, like the player actions. ( if player health is too low, player speed slows and crouches and others things..then yes)
Looking thru the syntax list gives an idea of what's possible with each condition.
That's why I love the .fpi language. It's very versatile, nothing is set in stone (unless it's hard coded)
If you need more help. just ask
best
My games never have bugs. They just develop random features..
Lots and lots of random features...
ironman21
User Offline
Joined: 9th Dec 2016
Location:
Posted: 10th Dec 2016 16:58
so for Healthless=x and Healthgreater=x << can they be certain percent or does it have to be a number
ironman21
User Offline
Joined: 9th Dec 2016
Location:
Posted: 10th Dec 2016 18:06
is it possible for me to use parts of darkai with normal ai? or doe this program not allow it?
ncmako
5
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 11th Dec 2016 10:23
ironman21
Quote: "Healthless=x and Healthgreater=x << can they be certain percent or does it have to be a number"

These have to whole numbers. But remember, you can start the entities health with any number.
Quote: "possible for me to use parts of darkai with normal ai"

Yes, I have seen some members take it to the extreme. Personally I have found Dark AI
buggy but that has not stopped others from working things out.
My games never have bugs. They just develop random features..
Lots and lots of random features...
ironman21
User Offline
Joined: 9th Dec 2016
Location:
Posted: 11th Dec 2016 16:55
yea i know that but that not what im getting at i want a AI , that when a enemies health is lower than like 50, he stops engaging the player or ally AI and runs to find cover , than while at cover, fires at random ally AI or player targets. but i'm not sure idf since im doing a new script if im going to have to reenter the animations for this or not. or will it automatically use the premade animation to make it work? im not sure if this program can even do all of that or not. or even if what im saying makes sense lol
ironman21
User Offline
Joined: 9th Dec 2016
Location:
Posted: 11th Dec 2016 17:03
ANd when the enemy health is greater the 51 he engages the player or Ally AI
ncmako
5
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 11th Dec 2016 18:21
ironman21
Quote: "when a enemies health is lower than like 50, he stops engaging the player or ally AI and runs to find cover "

Like I said, I haven't played to much with the Dark AI. But I opened the "main-weapon.fpi script. Looks like around code line state=30
if the npc's healthless=50 you could take it to another state like say state=60? (Fall back to cover while returning fire)
Of course that "cover" (such as crates, boxes..ect) has to be available to fall back to.
My games never have bugs. They just develop random features..
Lots and lots of random features...
ironman21
User Offline
Joined: 9th Dec 2016
Location:
Posted: 11th Dec 2016 20:03
i went to school for a diploma in game design and theory . but for the coding part i really suck at . in order for him to fall back do they have to be labeled as "safe zones" ?like trigger zone types or no? ahh ok found main wep fpi script in dark ai. but i dont see the code line dealing with npc health anywhere
ncmako
5
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 11th Dec 2016 22:43 Edited at: 11th Dec 2016 22:46
ironman21
Look down code until you get to state=30, about half way down.
I also looked in the syntax list, this is what's listed for "aimovetocover"
The syntax list is a valuable resource !
+ Code Snippet

After reading thru it, your correct. A trigger zone labeled "Safe Zone" is where an NPC would move to.
My games never have bugs. They just develop random features..
Lots and lots of random features...
ironman21
User Offline
Joined: 9th Dec 2016
Location:
Posted: 12th Dec 2016 00:01
yea ive been slowly reading through the syntax, buts it almost 200 pages so its gonan be read all in one day lol, im on page 66 atm . yea i spotted the AIMOVETOCOVER part i galned at the dark AI pages and some basic commands and conditions
ironman21
User Offline
Joined: 9th Dec 2016
Location:
Posted: 12th Dec 2016 01:24
OH wow i missed it liek 20 times , it just kinda blended in there . my mistake now i saw it. so by changing the state to 60 . it will make the AI fire while moving to cover.
ncmako
5
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 12th Dec 2016 10:37
ironman21
Like I said, I haven't worked with Dark AI much. They should work as is?
I would do test runs and see how they work. As I have heard Dark AI can be tricky.
For problems I usually search around if someone else has worked them out before.
Here's a video link to an interesting one...https://www.youtube.com/watch?v=WT8AZK6lyJw
This link is by member hukuta94, he did an amazing job using Dark AI with zombies...https://forum.thegamecreators.com/thread/206627
My games never have bugs. They just develop random features..
Lots and lots of random features...
ironman21
User Offline
Joined: 9th Dec 2016
Location:
Posted: 12th Dec 2016 17:49 Edited at: 12th Dec 2016 17:50
hmm wierd why is it that model pack 53 i think it is , the one with the modern war characters . IT doesnt show all of the characters in the entity bank. It only shows like 5 of them and the rest have the lil brain symbol over them instead of showing the actual character
ncmako
5
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 12th Dec 2016 18:24 Edited at: 12th Dec 2016 18:31
ironman21
Ah yes, that little symbol indicates a missing "thumbnail" view picture. For what ever reason
they didn't download or install. If you click on the symbol and you still get the character to show
in the editor, that means all the files are there except the "thumbmnail" pic.
It's only a 64x64px or 128x128px .bmp pic

Just noticed this in another thread, by Nomad Soul, he helped develop Black Ice mod.
"Its true, Dark AI is very resource hungry and it would improve load times and overall performance if removed. There is also an issue with Dark AI not following waypoints across multiple layers.
We've added a bot AI demo in Black Ice Mod which does not use Dark AI and provides a more consistent and aggresive AI. Ideally this can be extended to support allies in the future so we don't need to rely on Dark AI for that"

Like I said before, Dark AI can be buggy/glitchy alot of times
My games never have bugs. They just develop random features..
Lots and lots of random features...
ironman21
User Offline
Joined: 9th Dec 2016
Location:
Posted: 12th Dec 2016 19:07 Edited at: 12th Dec 2016 19:15
Well i havent installed Black ice mod yet, i reinstalled fps creator. hmm yea i just noticed that. wel crud i coulda really used these characters. Yea there missing alot of the images. What if i just give say warmacht unarmed a weapon script and use that script will it still show him as a unarmed when i put him on the map or will he have the weapon once i placed him on the map.
ncmako
5
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 12th Dec 2016 23:27
ironman21
I really wish TGC had left the old forum the way it was. They had a lot of good tutorials available, now all gone.
What you do is once you place your character, right click on him, property settings opens up.
Look down a bit till you see "Has Weapon" this opens up a list of all weapons in your gamecore\guns directory.
Add a weapon. Now you have to add the proper Ai-Main script to attach player and also the "shoot" script
(like shoot.fpi or shoot10.fpi or maybe getinrange.fpi) they each have different effects and actions
My games never have bugs. They just develop random features..
Lots and lots of random features...
ironman21
User Offline
Joined: 9th Dec 2016
Location:
Posted: 14th Dec 2016 05:41
is it possible for me to use the animated safe , to make a weapon and ammo appear when i unlock it? or possibly change one of the two main scripts to it? if so would i change the second so it says like appearcolt45.fpi or something?
or is there more that it would entail a lil more than that to make a weapon appear inside the safe
ncmako
5
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 14th Dec 2016 10:26
ironman21
Quote: "to use the animated safe , to make a weapon and ammo appear when i unlock it"

Yes, easier than you think. Open your script for the chest ( I think I have the same one also) Look and see if
it has a command already that says "activateifused=1" If not you add it after animation opens chest. Here's mine.
Look at line state=1,you'll notice that command.
+ Code Snippet
Now place your weapon and ammo. Right click and change BOTH to the EXACT SAME name!
( a simple unique name that you wont use anywhere else in your map)
Set BOTH in their property settings "Spawn At Start" set to "NO"
Now in the "chest" property settings in the "If Used" field type the name that you gave to the
weapon and ammo. When chest opens the command "activateifused=1" will trigger it's
If Used field and the weapon and ammo will appear.


My games never have bugs. They just develop random features..
Lots and lots of random features...

Login to post a reply

Server time is: 2017-06-25 11:20:49
Your offset time is: 2017-06-25 11:20:49