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 / Pickup 5 items open door - my first variables script

Author
Message
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 23rd Apr 2008 20:05 Edited at: 23rd Apr 2008 20:29
Remember the old way of opening the door after picking up the 5 items? Here is the code for the door to refresh your memories.



Here is the new code using variables.





You will not be able to use global variable #1 for anything else. Also, you can now easily modify this to have the player pick up any number of items. Hopefully, this will also give everybody a glimpse of how to use global variables. How many global variables one can have is still a question.

There is one other thing I am hoping for and that is all of the global variables are saved when user saves game and not reset. I will be testing that one soon. Otherwise we still won't be able to let the user save the game if the variables are reset.

BTW, this only works starting with v1.09 beta 3.
Nomad Soul
Moderator
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location: United Kingdom
Posted: 23rd Apr 2008 20:39 Edited at: 23rd Apr 2008 20:43
Thanks Flatlander

I can see how variables are going to add a lot of benefit to FPSC for things like inventories and triggering events.

Will it be possible to implement these variables into the actual gameplay mechanics like if you have a pistol and collect a particular entity, the gun does +10 more damage etc?

What about money. Are you able to use calculations with these variables to add / subtract or multiply / divide for them.

I'm hoping yes because I know you can already add and subtract for things like player health.

Is it possible to check for new variables in scripts to see if you have a certain amount of money to pay for something for example?

Also I'm assuming it will be possible to use variables in conjunction with huds so you can have certain stats being updated in real time on the screen whilst your playing?

This really is quite exciting but I just want to check I'm not expecting too much before dropping everything to try and make a first person RPG.
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 23rd Apr 2008 21:08 Edited at: 23rd Apr 2008 21:09
I have just started looking at ways to be able to use variables so am not up to snuff with it. What I have seen so far is that there are definite limitations.

Quote: "Will it be possible to implement these variables into the actual gameplay mechanics like if you have a pistol and collect a particular entity, the gun does +10 more damage etc?"


No.

Quote: "What about money. Are you able to use calculations with these variables to add / subtract or multiply / divide for them."


Only add or subtract by using incvar and decvar.

Quote: "Is it possible to check for new variables in scripts to see if you have a certain amount of money to pay for something for example?"


You will have to use a global variable for the amount of money you have and then use incvar and decvar in entity scripts that will add or subtract from that.

Quote: "Also I'm assuming it will be possible to use variables in conjunction with huds so you can have certain stats being updated in real time on the screen whilst your playing?"


Only Ply's Mod can do that. Won't be able to do it with v1.09. There is a way to do it but it gets messy and you have to create a lot of huds to display. The problem is that you need to be able to actually display the value that is in the variable and I don't believe there is a way to do that.
Scurvy Lobster
18
Years of Service
User Offline
Joined: 3rd Mar 2006
Location: Denmark
Posted: 23rd Apr 2008 21:12 Edited at: 23rd Apr 2008 21:14
What about killing X number of enemies before a door opens? Or killing some specific enemies before it opens?

This could be done earlier but not in a simple way. Would be interesting if the variables made this easier.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 24th Apr 2008 00:38
@Scurvy Lobster:

To do enemies would be the same as it is for picking up items.

Just alter a destroy script and do this before it actually gets "destroy"ed.



Then give your altered script to the enemies that you want to be destroyed for the door to open.


The one and only,
~PlystirE~

Scurvy Lobster
18
Years of Service
User Offline
Joined: 3rd Mar 2006
Location: Denmark
Posted: 25th Apr 2008 09:21
Thanks! I am looking forward to trying this.

Login to post a reply

Server time is: 2024-11-24 07:46:02
Your offset time is: 2024-11-24 07:46:02