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 / multiple scripts

Author
Message
antsrocks
10
Years of Service
User Offline
Joined: 6th Jul 2013
Location:
Posted: 29th Aug 2013 14:14
can 1 entity ccharecter be assigned 2 scripts
Corno_1
13
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 29th Aug 2013 14:17
Yes:
1. appear script
2. main script
3. destroy script
4. shoot script

Make this forum to something a little bit better and release more stuff. So we can push the Request/NoobHelp threads aside.
antsrocks
10
Years of Service
User Offline
Joined: 6th Jul 2013
Location:
Posted: 29th Aug 2013 14:31
;Header

desc=none

;Triggers
; *** YOU MUST GET WITHIN RANGE TO PICK UP YOUR ENTITY :state=0,plrdistwithin=60:state=1,rotatetoplr,animate=1
; *** ENTITY FOLLOWS YOU :state=1,plrdistfurther=150:animate=5,followplr
:state=1,plrdistwithin=75:freeze ;:state=1,plrdistwithin=75:freeze,animate=51
; *** Press Z TO ENGAGE ATTACK :state=1,scancodekeypressed=44:state=3,animate=5
; *** ENTITY REPOSITION TO ENGAGE ENEMY :state=3:rotatetoplr,rotatey=30,animate=5,runfore=60,rotatey=-30,state=4
; *** RANDOMIZE ANIMATIONS :state=4,random=1:state=10,setframe=3 :state=4,random=1:state=11,setframe=4
;*** ENTITY RETURNS FIRE :state=5,ifweapon=1,plrdistwithin=300:useweapon,rundecal=6 :state=5,ifweapon=0:state=6,setframe=6 :state=5,plrdistfurther=160:state=1
***IF PLAYER SHOOTS ENTITY, ENTITY SHOOTS PLAYER :shotdamage=1:shootplr
;***Press X TO DISENGAGE ATTACK (Seth Black) :state=5,scancodekeypressed=45:state=1,animate=1
;***Press END TO DROP OFF YOUR ENTITY (Seth Black) :scancodekeypressed=207:state=0,animate=1
; *** ENTITY RELOAD IF EMPTY :state=6:incframe=6 :state=6,frameatend=6:state=4,reloadweapon,sound=audiobankgunsreload.wav
; *** PLAY ANIMATION :state=10:incframe=3 :state=10,frameatend=3:state=5 :state=11:incframe=4 :state=11,frameatend=4:state=5
;End of Script dosent work why
antsrocks
10
Years of Service
User Offline
Joined: 6th Jul 2013
Location:
Posted: 29th Aug 2013 15:21
i dont have shoot script
in my fpsc
Snake675
FPSC Reloaded TGC Backer
12
Years of Service
User Offline
Joined: 6th Apr 2012
Location: Planet Earth
Posted: 29th Aug 2013 17:20
Hi

That depends on what kind of entity you are refering to. Only character entities do have a shoot script.






Greetings, Snake67

------------------------------------------------------------
i5 2.8 GHz 64bit / 4G ram / W7 home sp1 / geforce gts 250
FPSC 120 Beta 3
Pirate Myke
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 29th Aug 2013 20:59
You could in theory link other script by using the runfpi=(path to script and file) action also.

Just keep using this command to call another script.

antsrocks
10
Years of Service
User Offline
Joined: 6th Jul 2013
Location:
Posted: 30th Aug 2013 14:25
thnx why isnt the big script i posted not working
Pirate Myke
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 31st Aug 2013 08:39
I ran this script thru FPI Editpad for syntex error and found and corrected a few. Try this script in this format for starters and see if it functions for you.



If not then maybe you can supply the entity and fpe file and fpi files you are using to determine the issue.

Script in download button also.

Attachments

Login to view attachments
antsrocks
10
Years of Service
User Offline
Joined: 6th Jul 2013
Location:
Posted: 1st Sep 2013 16:39
i need help making the script

it shld be like a hud appears on the right hand side on the door in that it will ask a question
if u answer right the door will open
i am sorry for asking i know to make the hud but i dont how how to script it and how do i make entity of a small screen type in which if i press enter and then the hud comes and all tht

this is totally different from scripting characters so i dont know
Pirate Myke
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 2nd Sep 2013 07:13 Edited at: 2nd Sep 2013 07:13
Why dont you email the assets and fpi file and texture you have to my email. And maybe a test map.

That will give me a better handle on what you really need.

antsrocks
10
Years of Service
User Offline
Joined: 6th Jul 2013
Location:
Posted: 2nd Sep 2013 13:58
in the email the question is the king of chemical in below ans is written i want the answer next to it if the answer is right then the door opens i have no idea how to create the fpe file so i am just sending the hud
antsrocks
10
Years of Service
User Offline
Joined: 6th Jul 2013
Location:
Posted: 2nd Sep 2013 14:02
actually i can make the fpe file but it isnt ready yet
Pirate Myke
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 2nd Sep 2013 21:25
Email sent to you with a possible solution. Check it out and let me know if this is what you were looking for.

antsrocks
10
Years of Service
User Offline
Joined: 6th Jul 2013
Location:
Posted: 3rd Sep 2013 16:17
thanx this is what i wanted but u have to press enter for the hud to appear and no options u have to type the correct answer these were big changes so i could not redesign the script
Pirate Myke
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 3rd Sep 2013 16:43 Edited at: 3rd Sep 2013 16:43
Your Welcome. Press enter (plrusingaction) for hud to appear 1st time is easy enough.

Instead of using scancodekeypressed to make a answer choice you could desplay the other HUD and use plrusingaction, But that does not really make a choice of right or wrong for the engine to do 2 different actions.

http://forum.thegamecreators.com/?m=forum_view&t=180924&b=23
The above link has .pdf files containing all the condition and actions up to the latest beta version. It is definetly worth having around when you script.

I am posting the script here and maybe someone will have a better way of scripting this for you.



Give me a better example of the question and answer you are looking for and I can revise the script.

s4real
VIP Member
17
Years of Service
User Offline
Joined: 22nd Jul 2006
Location:
Posted: 4th Sep 2013 02:47 Edited at: 4th Sep 2013 02:49
You can use multi scripts also by linking scripts to other scripts but this is pretty advanced stuff for example :-

:state=1,plrcanbeseen,runfpi=folderofscript\subfolder\script.fpi,state=0

The script its calling would be in folderofscript\subfolder\script.fpi.

so you could have a main script call say :-

Shotting
hiding
runaway

Hope this helps

best s4real

Pack ya games with vishnu packer its free. Vishnu game launcher is now released.
Help keep vishnu free by pledging now :- http://vishnu.chipin.com/vishnu
Snake675
FPSC Reloaded TGC Backer
12
Years of Service
User Offline
Joined: 6th Apr 2012
Location: Planet Earth
Posted: 4th Sep 2013 06:00
Hi

Yes, i tried this too and it works. But be carefull not to loop link them because this will make the game hang.

Greetings, Snake67

------------------------------------------------------------
i5 2.8 GHz 64bit / 4G ram / W7 home sp1 / geforce gts 250
FPSC 120 Beta 3
s4real
VIP Member
17
Years of Service
User Offline
Joined: 22nd Jul 2006
Location:
Posted: 4th Sep 2013 13:29 Edited at: 4th Sep 2013 13:30
Quote: "Yes, i tried this too and it works. But be carefull not to loop link them because this will make the game hang."


Yes Snake675 right and should of said about that you do need to make sure things don't loop forever as it eats memory and will drop framerate or hang as Snake675 said thats why its pretty advanced scripting.

@Snake675 thanks for pointing that out.


best s4real

Pack ya games with vishnu packer its free. Vishnu game launcher is now released.
Help keep vishnu free by pledging now :- http://vishnu.chipin.com/vishnu
antsrocks
10
Years of Service
User Offline
Joined: 6th Jul 2013
Location:
Posted: 4th Sep 2013 13:51
i am sorry but i dont get wt u guys are saying cause i am a beginnnnnnnner

any ways so let me explain again

player goes in front of door and presses enter a hud appears he will have to type the answer no options if it is right door open or else lose health
Pirate Myke
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 4th Sep 2013 17:09 Edited at: 4th Sep 2013 17:13
Here is the problem with the player typing the info. scancodekeypressed condition only scans for individual keypress on the keyboard by waiting for asci code to be received.

Their for to type in a correct answer instead of a choice would take the script to wait for multiple scancodekeypressed to be recieve in the proper order. What do you do for people who cant spell.

It could be done but would take a bit of scipting to be accomplished and might be rather laggy in response to the players keypresses, especially if this was a large level or had a lot of scripts in it.

Take this piece of code for an example Written by Mr Game a while back. It is looking for 6 number combo to open a lock.



Once the code is entered in the right order then the code is unlocked.

The results where to make an object spin back and forth to simulate a lock beng open.

Not impossible, but will take a bit of work to get it going and working. Take the script I started with and keep adding the scancodekeypress looking for the right letters you desire.

There is not a condition that looks for a wrong scancodekeypress, so you will have to come up with a way to deal with wrong choices made in the specific order that you want the player to type in.

Looks like you will have to learn scripting sooner then you expected. But when you complete it, then you will be armed with an invaluable tool for enhancing your games capabilities.

I will keep looking at this thread to see if I can help down the road.

BlackFox
FPSC Master
15
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 5th Sep 2013 01:19
Quote: "You can use multi scripts also by linking scripts to other scripts but this is pretty advanced stuff for example :-

:state=1,plrcanbeseen,runfpi=folderofscript\subfolder\script.fpi,state=0

The script its calling would be in folderofscript\subfolder\script.fpi."


Quote: "Yes, i tried this too and it works. But be carefull not to loop link them because this will make the game hang.
"


Quote: "Yes Snake675 right and should of said about that you do need to make sure things don't loop forever as it eats memory and will drop framerate or hang as Snake675 said thats why its pretty advanced scripting.
"


It would be better to do this with the command "runfpi=x"...



Even though the script has called the "secondscript.fpi", the one that is the "caller" will still terminate at "state=2". The caller script terminates each time when reaching the "none" command.


There's no problem that can't be solved without applying a little scripting.
antsrocks
10
Years of Service
User Offline
Joined: 6th Jul 2013
Location:
Posted: 5th Sep 2013 19:33
i jus started and then think of all the big ideas without crossing the small ones first so i would like to thank all people for giving so much value to this post i think ill close it now

last question can i keep 3rd person view

Login to post a reply

Server time is: 2024-04-20 13:45:30
Your offset time is: 2024-04-20 13:45:30