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 / Countdowns spanning across levels/maps?

Author
Message
kms
17
Years of Service
User Offline
Joined: 9th Jan 2009
Location:
Posted: 14th Jul 2010 17:56
I've seen many threads about short-term countdowns, but I was wondering if it was possible to have a countdown last over a couple of levels/maps. I've had problems in the past with my maps getting too physically large and crashing the engine, so I was looking into a redesign where I'd expand them over multiple levels. Unfortunately, I no longer know how to implement the timer system I once had in place. (I was using the stock variables system.) Does anyone have any solutions/suggestions? I know there are mods out there, but I am unclear what information holds over between maps for any number of them. Thanks in advance! As always with my many inquiries, any suggestions are appreciated.
ctm
21
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 14th Jul 2010 18:38 Edited at: 15th Jul 2010 15:36
That should work if you safe the elapsed time in a global variable:

This is qick made script which shows how it could be done:
(It's a 10 minutes timer (600 seconds))



The second and third line:
Quote: "
:state=1,varless=600,vargreater=0:state=2
:state=1:setvar=600,state=2
"

If the scrip starts in the "next" level the value of the variable will be less than 600. So it will not get set to 600 again.

Edit: Or maybe more easy: Make a version of the script without these 2 lines for the other "levels" and change line 1 to:
:state=0,globalvar=0:state=2

These lines save the time every second by decreasing the global var by 1:
Quote: "
:state=3:timerstart,state=4

:state=4,timergreater=1000:decvar=1,state=5
"


Not tested but should work..

p.s. rawtext works only with FPSC v.1.16 or 1.17
ctm
21
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 15th Jul 2010 15:29 Edited at: 15th Jul 2010 15:30
I was curious and tested it.

Bad news: It does not work with FPSC v.1.16

The global variable gets initialised with 0 again when the new level loads.
Tried to add the globalvar declaration to the setuplevel.fpi and loadingpage.fpi but didnt help.

Lets hope the new variable system in v.1.17 works better
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 15th Jul 2010 19:17 Edited at: 15th Jul 2010 20:59
When Lee first included variables they didn't even maintain their values when you saved the level. It reset all the variables to zero. He fixed that but never did allow the variable to retain their values(edited) across levels.

My variables in RPG Mod will retain values. In fact you can go from say level 2 to level 4 and then back to level 2. It hasn't been tested thoroughly but in theory you can jump from level to level at will as long as it is scripted properly.

You can also retain weapons if they are picked up in level 3 and you go back to level 1. Again, scripting is necessary.

ctm
21
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 15th Jul 2010 20:17
Quote: "It reset all the variables to zero"

ouch
I dont regret that i missed these times

RPG Mod sounds very very interesting..i didnt know that it is possible to load the levels nonlinear.
Imo a powerful scripting language is more important for making a good game than visual stuff like bloom.

I think i read somewhere that RPG Mod will get adapted to 1.17...would be great!
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 15th Jul 2010 20:54 Edited at: 15th Jul 2010 20:58
Yes it will and I am biting at the bit to give it a try before the official is released. Every time I'm about to start a new beta is either released or talked about. I'm looking at beta 5 at the moment. However, I'm thinking of waiting til the weekend to see if any other betas are released by Saturday.

Quote: ".i didnt know that it is possible to load the levels nonlinear."


Modifying source code makes it possible. You have to take into consideration how Lee goes from one to the next level. Making three or four new commands takes care of the jumps and by-passes Lees code that increments the levels by 1. However, if you want to allow Lees incrementation you don't do anything except win the current level.

ctm
21
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 15th Jul 2010 21:08 Edited at: 15th Jul 2010 21:09
Quote: "Making three or four new commands takes care of the jumps and by-passes Lees code that increments the levels by 1"


Ah, i think i understand. Sounds logical.

To be honest..i did only one time take a look at the source.
I am not fimiliar with dark basic...got headache while scrolling down these ten thousonds lines of code
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 16th Jul 2010 00:14
And my code added another ten thousand plus lines of code.

It took me a whole year to accomplish.

ctm
21
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 16th Jul 2010 12:46
I read the rpg mod docu...wow, could take a year to try what can be done with this mod

Variables with strings and math functions like mult and div, questsystem, inventory system, and and and..

There is even a compass and the possibility to use a additional numeric hud...very cool for things like remaining oxygen in a outer space level or armor.

Thats a awesome mod.
Plystire
23
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 17th Jul 2010 01:20
I thought I had posted in here... but I see no post from me.

Anyway, the jist of what I thought I ahd said before:

I'm not entirely sure if this is true or not but is worth looking into. I don't believe the Timer is reset when changing levels. You could theoretically use the timer to track how much has past over multiple levels. This would, of course, include time taken to load levels, but the idea is always there.


Quote: "My variables in RPG Mod will retain values. In fact you can go from say level 2 to level 4 and then back to level 2. It hasn't been tested thoroughly but in theory you can jump from level to level at will as long as it is scripted properly."


I was doing it before it was cool.

Lol, sorry, couldn't resist.


The one and only,


kms
17
Years of Service
User Offline
Joined: 9th Jan 2009
Location:
Posted: 28th Sep 2010 03:22
I'm sorry that I seem to come and go in such waves, but now that I'm back in my lab, I would first like to thank everyone who responded! Wow! I usually have to tease stuff out of my threads, since they're often such specific questions. I've looked into both the F l a t l a n d e r's RPG Mod and Plystire's Mod (which I presume is now Project Blue?) and they both seem impressive.

For Ply: Do you know if anyone has yet tried to hold a timer across levels (I don't necessarily mind if the loading screen is counted, actually)? If so, I'd love to talk to them to see how they did it. Also, we talked briefly about this over e-mail once before, but if variables hold, does this mean that I can make sure that characters killed once stay dead if I return to the same level again?

For F l a t l a n d e r: I noticed your questusetimer. Does this even hold between levels or if you go back and forth between levels? That would be really great if it did. Also, I ask the same as I did for Ply about whether or not I can make sure enemies dead once stay dead for good.

For both of you: I presume there's no way to get elements of both your mods, correct? Everything I've read seems to suggest otherwise, but I thought I ought to check. Both offer such awesome elements that I'd want, since my game is certainly an FPS but also does have strong quest-style elements.

Also, this was not in the thread, but if I do happen to snag either of your two's attention (I know it's been a while, so I'm not banking on it), I also asked in another thread if it was possible to make character entities unresponsive to my attacks here, and I was wonder if either of your mods could handle such a thing. I would use this in NPC creation, but it seemed from responses that this was not possible in vanilla FPSC, even after trying Ply's idea.
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 28th Sep 2010 04:46 Edited at: 28th Sep 2010 05:12
Flatlander does not frequent the forums much, so I can answer your questions regarding RPG Mod on his behalf, since I am also one of the developers.

Quote: "
For both of you: I presume there's no way to get elements of both your mods, correct? Everything I've read seems to suggest otherwise, but I thought I ought to check. Both offer such awesome elements that I'd want, since my game is certainly an FPS but also does have strong quest-style elements."


You are correct, there is no way (no disrespect intended towards Plystire or PB). When you take two different mods ans attempt to merge them, a lot of work goes into getting code to work, etc. One mod may get hacked apart and then there is the issue of which method(s) are best to use. Too many headaches, and we just do not have the need or inclination to do so.

Quote: "
possible to make character entities unresponsive to my attacks"


Did you assign a script like the following to the character?



I use the above in one of our outdoor scenes for civilians to mill about the town and it worked for what we needed.

Quote: "
I noticed your questusetimer. Does this even hold between levels or if you go back and forth between levels? That would be really great if it did. Also, I ask the same as I did for Ply about whether or not I can make sure enemies dead once stay dead for good."


We did a demo of RPG Mod (demo # 7 part 1 & part 2) that shows going to and from levels collecting both weapons and inventory. That works perfect. I have not done extensive testing for NPCs, but that is currently underway to ensure that any NPCs killed in level 2 stay dead if the player goes back to level 1 and returns to level 2.

The quests are coded to work forwards, not backwards. You can have quests that have a time limit, track start time, or no tracking at all. I have not done any extensive testing to see if the quest started in level 2 will be retained if I return to a previous level. Inventory and weapons are retained. I will test the quests part out to see the absolute behavior and work on a solution if needed.

- BlackFox

RPG Mod- Create a world full of adventure
kms
17
Years of Service
User Offline
Joined: 9th Jan 2009
Location:
Posted: 28th Sep 2010 06:20
Quote: "You are correct, there is no way (no disrespect intended towards Plystire or PB). When you take two different mods ans attempt to merge them, a lot of work goes into getting code to work, etc. One mod may get hacked apart and then there is the issue of which method(s) are best to use. Too many headaches, and we just do not have the need or inclination to do so."


Thanks, BlackFox! It's a shame that mods can't be used together, but I figured it'd be complicated like that. Oh well; no harm in asking, heh.

Quote: "Did you assign a script like the following to the character?"


Yes, I have done that, but the problem is that I can still run up to them and kill them, if I want. Even if I make them have tons of health, they'll still bleed or get pushed around from my "body" if I get close. You know how in some games, there'll be characters just walking around, and even if you try to go after them, they do nothing? I was trying for that effect to distinguish between NPCs and enemies.

Quote: "We did a demo of RPG Mod (demo # 7 part 1 & part 2) that shows going to and from levels collecting both weapons and inventory. That works perfect. I have not done extensive testing for NPCs, but that is currently underway to ensure that any NPCs killed in level 2 stay dead if the player goes back to level 1 and returns to level 2.

The quests are coded to work forwards, not backwards. You can have quests that have a time limit, track start time, or no tracking at all. I have not done any extensive testing to see if the quest started in level 2 will be retained if I return to a previous level. Inventory and weapons are retained. I will test the quests part out to see the absolute behavior and work on a solution if needed."


Thanks for that information. I tried those links on the website, and the quests do not appear to be retained. In part 2, I would go two levels 2 and 3, and they would tell me that I got the items, but each time I went back to level 1, it claimed I hadn't started them. Also, there did not appear to be a way to go back and forth freely between levels. Is this the case, or did I make a mistake? For example, in part 1 of the game, I would start in section 1, go to section 3, get the sword and then go back to section 1, but I could never go back to section 3 again. Similarly, in part 2, if I left level 1 for level 2 or 3, I could not go back to level 1 until I had the proper item. Am I doing something wrong or is this just the way that it works? I tried it a couple of times. Also, even though it says "Left click" to go to a respective level, when I right click to cancel out of it, it still takes me there. It's still really cool, but I just thought you'd like to know what I found.

Thanks, again!
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 28th Sep 2010 06:31
Quote: "
Thanks for that information. I tried those links on the website, and the quests do not appear to be retained. In part 2, I would go two levels 2 and 3, and they would tell me that I got the items, but each time I went back to level 1, it claimed I hadn't started them."


Ok, that tells me the quests are coded to go forwards. Will look more closely at that.

Quote: "
Also, there did not appear to be a way to go back and forth freely between levels. Is this the case, or did I make a mistake? For example, in part 1 of the game, I would start in section 1, go to section 3, get the sword and then go back to section 1, but I could never go back to section 3 again. Similarly, in part 2, if I left level 1 for level 2 or 3, I could not go back to level 1 until I had the proper item. Am I doing something wrong or is this just the way that it works? I tried it a couple of times. Also, even though it says "Left click" to go to a respective level, when I right click to cancel out of it, it still takes me there. It's still really cool, but I just thought you'd like to know what I found.
"


No, it was nothing you did. It was how I coded it. To traverse from level 1 to level 2, we use a trigger zone and script. When you start level 2, you go to pick up the item, which then spawns the trigger where you first entered- this trigger takes you back to level 1. However, I coded the scripts so once they each did their thing, they were done and destroyed. To traverse back and forth, back and forth, I'd have to change the scripts to "reset" back to their beginning state.

As I said, these were ideas we came up with to add to RPG Mod and will need a bit of fine-tuning. Some things may not be possible to achieve (such as starting a quest in level 2 and having it show in level 1 as started), but we are working on them.

- BlackFox

RPG Mod- Create a world full of adventure
kms
17
Years of Service
User Offline
Joined: 9th Jan 2009
Location:
Posted: 28th Sep 2010 08:54
Alright, thanks!

I'll be looking forward to see what happens in the future, since it seems like it has a lot going for it. I, personally, was envisioning something where you could go back and forth between levels, perhaps looking for various items, and not knowing which levels hold which things, you know? That way, there's more room for exploration and error before the time runs out. (I know how, when I play RPGs, I sometimes alternate between towns for forever before I realize what I missed way back in the beginning, you know, heh?) Anyway, I have no idea how that could be accomplished, but it might be cool.

Login to post a reply

Server time is: 2026-07-26 05:23:01
Your offset time is: 2026-07-26 05:23:01