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 / Variables not working.

Author
Message
starmind 001
FPSC Reloaded Backer
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 27th Nov 2009 07:01 Edited at: 28th Nov 2009 01:00
I have been working on this script today and I cannot make it do what I want. Maybe someone on here will see my mistake or know how to fix it. What I am trying to do is using conjured's cash script I changed it to a score board, what I need this script to do is recognize the plr's score. If the plr has say only 1500 points then it kills the plr and restarts the level, but if the plr say has 5000 points or more then he or she moves to the win zone and advances to the next level. I realize that this might be simple for some, but it is getting late here and I am not seeing my mistake. Right now the script kills you no matter what when the timer is up. Also is it possible to have a timer on screen counting down?


Here is the script that I have so far:



[/b][/u]EDIT:

Thanks for your help! Here is the final scripts for all to enjoy. There is three scripts written by hockeykid for me to act as a scoring system for fpsc. I will place these in my first post to make it easier for all to download.

[b][u]Three scripts are:


:fenixmodtriggerzoneshowscore.fpi - Place this one in a Trigger Zone. I named my trigger zone "score" to keep track.

:fenixmodscoretimer.fpi - put this one in another trigger zone and name it timer. This will give the plr only so long to complete the level or die. In the activateifused type "win" and place an entity somewhere in the level that will be destroyed when spawned and name that entity "win" and make it objective=1. Now place your win zone and make it objective=1 as well.

:fenixmodrepeatingtargets.fpi - Give this one to your target. I animated a target with 10 frames. Set your value of points and how long you want between the time the target is shot and when it pops back up again.

I hopes this helps in making fpsc alittle better for all to enjoy! Be sure to give hockeykid the credit for this if you use it in you games. Enjoy!

Attachments

Login to view attachments
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 27th Nov 2009 07:20
you never told the script what variable to check.

starmind 001
FPSC Reloaded Backer
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 27th Nov 2009 07:24 Edited at: 27th Nov 2009 07:28
How do I do that? Would I put in " globalvar=1 " and then "varless" ?

Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 27th Nov 2009 07:40
Quote: "How do I do that? Would I put in " globalvar=1 " and then "varless" ?"


At the top of the script put

:always:globalvar=1

starmind 001
FPSC Reloaded Backer
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 27th Nov 2009 07:45
I tried that and it won't send the plr to the win zone even with the required points.

Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 27th Nov 2009 07:49
wheres the variable getting set?

starmind 001
FPSC Reloaded Backer
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 27th Nov 2009 07:50
In the first cash script from conjured.

Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 27th Nov 2009 07:54
And your sure its setting globalvar 1?

starmind 001
FPSC Reloaded Backer
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 27th Nov 2009 07:58 Edited at: 27th Nov 2009 08:00
No. Here's the first script That I have been going off of.


Here is the script that I have set up for my targets.



Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 27th Nov 2009 08:02
And just so i know what is the point of using conjured's money system?

starmind 001
FPSC Reloaded Backer
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 27th Nov 2009 08:07
I am using it for a point system for targets. For each target shot the plr earns 100 points. If the plr cannot reach a certain goal for each level say 500 points then the plr loses a life, but if the plr reaches the goal or goes above it the plr moves on to the next level.

Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 27th Nov 2009 08:11
Quote: "I am using it for a point system for targets. For each target shot the plr earns 100 points. If the plr cannot reach a certain goal for each level say 500 points then the plr loses a life, but if the plr reaches the goal or goes above it the plr moves on to the next level."


And i'm guessing your using it to display the points? (you using any mods)

starmind 001
FPSC Reloaded Backer
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 27th Nov 2009 08:15
Quote: "to display the points?"
Yes and no mods for this one, just ver 1.15. I use your mod most of the time, but when I am testing stuff like this I use the stock engine. The original script was for the stock engine, if my memory is working right.

Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 27th Nov 2009 08:16
Quote: "Yes and no mods for this one, just ver 1.15. I use your mod most of the time, but when I am testing stuff like this I use the stock engine. The original script was for the stock engine, if my memory is working right."


Well I would suggest using the newest update of my mod. If you decide to I can do the script for you in a matter of minutes.

starmind 001
FPSC Reloaded Backer
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 27th Nov 2009 08:19
I have your newest mod, so if you don,t mind I can do alittle upgrade for it, but I did want to see if I can make this one work.

Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 27th Nov 2009 08:20
Quote: "but I did want to see if I can make this one work."


Sorry can't help you then, never understood how Conjured did it.

starmind 001
FPSC Reloaded Backer
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 27th Nov 2009 08:26
Well I do have your newest mod I can do a quick change over to that for this, if not how does it work in your mod? And why I still have you here, I talked to lee about the radar and he said look for a line and dot in the source. I have yet to look through it since I received his email and thanks for a great mod.

Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 27th Nov 2009 20:19
Quote: "Well I do have your newest mod I can do a quick change over to that for this, if not how does it work in your mod? And why I still have you here, I talked to lee about the radar and he said look for a line and dot in the source. I have yet to look through it since I received his email and thanks for a great mod."


Sorry for the late response, here you go.

For your target(s)





And on a trigger zone put



starmind 001
FPSC Reloaded Backer
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 27th Nov 2009 22:38
Thanks, but even with conjured's scripts those two that you made worked just fine. The one I needed was this one to see the score and either send the plr to the next level when a certain amount of points have been made or if the plr didn't make the required it restart the level and take away a life. This is what have done so far:



This is the script I needed and I will use your other scripts, but I need one similar to this script to make the game interesting otherwise it will just be a regular old fpsc game.

Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 27th Nov 2009 22:57


Give that a go (for use with my mod)

starmind 001
FPSC Reloaded Backer
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 28th Nov 2009 00:12
It works, but won't sent the plr to the win zone and end the level.

starmind 001
FPSC Reloaded Backer
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 28th Nov 2009 00:29
Ok I fixed it. I removed "plrmoveto " with "activateifused" and made a exploding barrel and made it objective. This worked, but I noticed that there is a bug either with ver116 or fenix mod where if you run the weapon begins firing at random, but does use any ammo or impact anything. It is just the sound, If you run and jump at the same time, sometimes you get both the fire sound and the reload sound. Funny.

starmind 001
FPSC Reloaded Backer
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 28th Nov 2009 00:59
Thanks for your help! Here is the final scripts for all to enjoy. There is three scripts written by hockeykid for me to act as a scoring system for fpsc. I will place these in my first post to make it easier for all to download.

Three scripts are:

:fenixmodtriggerzoneshowscore.fpi - Place this one in a Trigger Zone. I named my trigger zone "score" to keep track.

:fenixmodscoretimer.fpi - put this one in another trigger zone and name it timer. This will give the plr only so long to complete the level or die. In the activateifused type "win" and place an entity somewhere in the level that will be destroyed when spawned and name that entity "win" and make it objective=1. Now place your win zone and make it objective=1 as well.

:fenixmodrepeatingtargets.fpi - Give this one to your target. I animated a target with 10 frames. Set your value of points and how long you want between the time the target is shot and when it pops back up again.

I hopes this helps in making fpsc alittle better for all to enjoy! Be sure to give hockeykid the credit for this if you use it in you games. Enjoy!

Attachments

Login to view attachments
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 29th Nov 2009 19:12 Edited at: 29th Nov 2009 19:59
Quote: "Here's the first script That I have been going off of."

That is "cash1.fpi", and should never be edited no matter how you are using the script. (unless you need to use a global variable other than #1)

The cash1.fpi through cash6.fpi are the six scripts used to display the value of Global Variable 1 onto the screen.
I had to use six of them because of the line limits in FPSC for scripts.
They all call each other in sequence so they are really acting as one big script by moving from one to the other in order.

To use the system for things other than cash, then you would need to simply restructure the scripts that change the value of that global variable. (NOT the scripts that display it)

Let's take a look at the custom death script included with the system for an example of how we use the display...



As we can see from the code, the first thing to do is settargetname=cs1 in state=0. (we don't need to use state=0 for this but I did since it is the only target being used)

:state=0:settargetname=cs1,state=1

That cs1 is the name of the first painting that is running the cash1.fpi
We do not need to fool with calling any others since they call each other internally.
All we need to do is activate the first one which sets them off in a chain motion.
We do that after we make the variable adjustment, which we can see in state=1.

:state=1:plrsound=$0,globalvar=1,incvar=100,activatetarget=13,state=2

We play a sound (optional) then name the variable to be adjusted, then increment the variable, then activate the target that we named in state=0 (cs1) to an activated state of 13.
Activating “cs1” to 13 starts the display scripts, and it is all you need to do to display the value of global variable 1 using my cash system.
There you have it, those two states are a fine example of the bare minimum to alter the variable and then display it.
It is so simple that some people get confused by thinking it has to be complicated.
The display scripts are a bit complicated, but using them is really easy.

Quote: "Sorry can't help you then, never understood how Conjured did it."

I summoned the spirits for help, so it's magic! (you know it's magic, how else do I get these kind of things working in vanilla?)


Quote: "Sorry for the late response, here you go."

Yeah me too, if I had seen this earlier, then I could have explained the simplicity of it so a Mod wouldn't have been necessary.
But, I am sure he will enjoy the other great features of your Mod, so it worked out for the best.
Anyway, I hope my brief explanation above will help others who are trying to play with variables and my cash system using the stock engine (vanilla FPSC).

   Conjured Entertainment

 WARNING: Intense Madness
starmind 001
FPSC Reloaded Backer
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 30th Nov 2009 01:49
I just noticed this and Thanks for your help as well conjured.

Login to post a reply

Server time is: 2024-11-25 05:16:35
Your offset time is: 2024-11-25 05:16:35