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 / Scripting/Coding Question - Configurable Waypoints

Author
Message
NCfan
16
Years of Service
User Offline
Joined: 7th Jul 2008
Location:
Posted: 8th Jul 2008 05:15
First post! So exiting....

So I'm not quite sure if what I want to do with waypoints is possible. I'm not asking anyone to do this for me, but it'd be nice to know if this is possible and get a hint or two on how to actually go about doing it.

Here's what I want to do:

I want to be able to have a file (sort of configuration file) that my .exe reads every time it's run. The file would store the position of waypoints in the game (x,y format perhaps?). Every time you run the game, the position of the waypoints that a certain set of NPCs follows would be different based on what was in the file.

What would I do in the FPS creator to create a final product that does the above? I'm not averse to delving into scripting or even the source code (can you do that?) so if that's what I'd have to do, I'll do it.

So if you could tell me if this kind of thing is even possible, and maybe how one would go about doing it, that'd be great.

Thanks a bunch!!
Robert F
User Banned
Posted: 8th Jul 2008 08:17 Edited at: 8th Jul 2008 08:17
I dont really think its possible in fpsc to read an outside file. Well not an exe anyway. But anyway Welcome to the FORUMS!

NCfan
16
Years of Service
User Offline
Joined: 7th Jul 2008
Location:
Posted: 8th Jul 2008 08:27
Thanks for the reply. Just to clarify though, I don't want to read an .exe, I want my game, once I have outputted it to an .exe, to read an outside file every time it runs.

To phrase my question a bit differently, if my game has a bunch of waypoints, where is that data stored in the game files and can I modify it?
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 9th Jul 2008 04:01
Well, if you're comfortable with diving into the source, I may be able to point you a way into wonderland... perhaps to a path that may lead to the area you're looking for.

Only problem with altering the source is that the only source available right now is the source code for V1.07 of FPSC. Kinda out of date, but once the migration is over I'm sure Lee would release the source for that.


The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
NCfan
16
Years of Service
User Offline
Joined: 7th Jul 2008
Location:
Posted: 9th Jul 2008 04:39
Sure, I'll take the red pill

Mini-slightly related question - a tech support guy told me that the DX10 version supports NPC instancing-something, which allows for massive amounts of NPCs. What kind of difference are we talking about in terms of max NPCs in non-dx10 vs dx10 versions?

So when will the most current source be released do you think?

Anyhow, sure, I'll take any advice or help I can get. I've got good programming knowledge but near zero FPSC knowledge, especially when it comes to the limits of the software.

Thanks!
Dar13
16
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 9th Jul 2008 21:39 Edited at: 9th Jul 2008 21:41
I'd say the best thing you can do in FPSC as for NPC's is maybe 10 to 20 spawning from the start but pretty much about 40 to 50 enemies that get destroyed after spawning.
note: the main drag on fps is the character scripts not amount of characters in a level but among that is poly leaks and several other things.
as for the source...no clue but it will be after the migration has happened and as far as i know it's by maybe the end of summer as Lee has retreated into the coding cave.
-EDIT- for the limits try a full outside level and see if you can get any higher than 10 fps(entities,characters,and lights)

I know not what WWIII will be fought but I do know that WWIV will be fought with sticks and stones-Albert Einstein
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 9th Jul 2008 23:02
Alright, since you're gonna be doing a serious make-over on the way waypoints are used in FPSC, then here's where the waypoint stuff happens:

Search the source for:


That's the beginning of the subroutine that handles a single entity's waypoint logic.

Now, where you want to stick the file reading stuff is entirely up to you, but I'd suggest reading either at the beginning of the executable, or near the waypoint structure; depending on if you want to have the file effect the executable as a whole, or if the file may be changing during execution (unlikely).


The path has been lit. Tread lightly.


The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
NCfan
16
Years of Service
User Offline
Joined: 7th Jul 2008
Location:
Posted: 10th Jul 2008 00:09
I see...

Before I go too far down the rabbit hole, I'd like to make sure that there isn't an easier way. The following scenario may or may not be possible:

I create a game in FPSC. All it contains is one NPC with a waypoint set so that it walks to the end of a hallway when I run the game. When a drag a waypoint in FPSC, I am giving the game the x,y coordinates of the point(s) that I want the NPC to walk to. Presumably the NPC AI works something like this (very simplified):
1)Check to see what the next action should be
2)See that it has to go to the next waypoint
3)Check to find the location of that waypoint
4)Do some kind of pathfinding to get there
I then "build" my game (is this the correct term for making an .exe of the game?). Let's forget about FPSC for a moment. I install my game on some random PC.

Every time I run the game, it has to look somewhere to get the location of that one waypoint. When the game reaches my simplified step 3 (above), it has to look somewhere for that info. That information has to be part of the game files and is stored in some file. Do you know where that somewhere is? Assuming I know where that somewhere is and figure out how the info is stored, I can go and change the location of the waypoint just by changing that file. Of course, I could mess up and make the game unplayable by accidentally setting the waypoint inside a wall, but if I did it right couldn't I for example change the waypoint so the character only walked half way down the hallway?
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 11th Jul 2008 05:29 Edited at: 11th Jul 2008 05:30
Wait. So, you want to have NPC spawn in different locations and follow different waypoints in a different way each time the game is played? Why not just have a few identical characters in different locations, but with different manes, and then use the randomfunction in a script to spawn a different cheracter. They all look the same, and as far as the player could tell, they are the same, but they spawn in different areas. Also, just group waypoints so that the paths would be randomized.

Buy, no. Without modding, the file-bases system wouls not be possible.

Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 11th Jul 2008 17:52 Edited at: 11th Jul 2008 17:55
Yes, it hased to look somewhere, but the somewhere you are suggesting is encrypted and password protected in a zip file.

It is called map.way I believe and it is encrypted in a password protected ZIP archive in the levelbank folder in the final build game.

Login to post a reply

Server time is: 2024-11-24 10:55:58
Your offset time is: 2024-11-24 10:55:58