city scripting
city scripting
I know this has been discussed in the old forum but it when down and I can't get to it! How can you use one level and have missions off of that level. I plan on making a large city and I don't want to have to set up 20 or 30 of the same level with different scripts attached to each one.
Jonas
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
I've started that idea and abandoned it, (city was to big got out of hand.)
First off get good at scripting, (im not about to write large scripts here)
the easiest way to this is use attributes, Im guessing you want to create a GTA style of play, game.
if you want to have a main story, with sub missions ect, ect,
Create mission scripts which control the events, and track them with attributes,
I'm guessing you have a basic idea how to script
PLEASE NOTE THIS IS PSUEDO CODE, THIS WONT WORK IN A SCRIPT!!
By using this type of layout you can control the missions ect but you will need to write fairly large scripts or break it down into several smaller ones, either way this will take time, but by doing it this way you can control; events in a level; when to trigger a fmv
there are other ways to do this but by doing it through scripting you have more control.
First off get good at scripting, (im not about to write large scripts here)
the easiest way to this is use attributes, Im guessing you want to create a GTA style of play, game.
if you want to have a main story, with sub missions ect, ect,
Create mission scripts which control the events, and track them with attributes,
I'm guessing you have a basic idea how to script
PLEASE NOTE THIS IS PSUEDO CODE, THIS WONT WORK IN A SCRIPT!!
Code: Select all
mission#(1)
{
if mission# == 1 then
{
firstmission
{
DoWhile Mission =! complete
{
Missionobjectives
if Missionobjectives == Completedmission
firstmission == complete
}
if firstmission == complete then
GoTo 2nd Mission
else
failed misson // go to start of first mission
}
}
there are other ways to do this but by doing it through scripting you have more control.
So lets say I want a certian guy to appear in a certian mission, would it be possible to create him as soon as That mission comes? or would I need to have that guy hid in a solid building with no way in and have him goto the right location? Yes It will be a GTA style game but your the cop!
Jonas
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
>>I plan on making a large city and I don't want to have to set up 20 or 30 of the same level with different scripts attached to each one.<<
You want to make one level with 20 or 30 scripts. Not the other way around.
Each 'submission' should be a pawn that is spawned by a Trigger as Spyrewolf and rgdyman suggest. A 'level control pawn' detects the events asociated with these pawn scripts and then triggers other pawn scripts.
You system would require:
:A single level
: A player.
: A controller pawn
: 20-30 pawns that will be spawned and destrtoyed one at a time. each running the script for the submission.
: 20-30 Trigger etnities.
You want to make one level with 20 or 30 scripts. Not the other way around.
Each 'submission' should be a pawn that is spawned by a Trigger as Spyrewolf and rgdyman suggest. A 'level control pawn' detects the events asociated with these pawn scripts and then triggers other pawn scripts.
You system would require:
:A single level
: A player.
: A controller pawn
: 20-30 pawns that will be spawned and destrtoyed one at a time. each running the script for the submission.
: 20-30 Trigger etnities.
I guess that wouldn't be to bad. But that would be a lot of triggers laying around. I will have to have triggers for all my good and bad guys plus pedestrians and cars. Does anyone have any suggestions on how to make cars at randam drive to different locations without driving through buildings.Anonymous wrote: You want to make one level with 20 or 30 scripts. Not the other way around.
Each 'submission' should be a pawn that is spawned by a Trigger as Spyrewolf and rgdyman suggest. A 'level control pawn' detects the events asociated with these pawn scripts and then triggers other pawn scripts.
Would I need to put a trigger at each corner, and name the ones on the right r_streetname and on the left l_streetname? Then when a car gets to were a stop sign is at the trigger randamly choose to goto the next trigger on that street or go L or R! Then do a low level check to were when the players going above a certain speed and heads at them they swerve?
I will have to make a very similiar script for the pedestrians!
Jonas
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
again read up on scripting, also you will want to use the script point entities, these are use for controlling pawns, have a series of triggers around the level, the srcipt point guides a pawn to a specific location or to peform a specific task.(again can't write a script to much too do
)
================================================
streets, to have an effective traffic and pedestrian system, they really are not that hard to produce, you just have to be logical in your approach, these are seemingly complex, but if you use a reality based model the system will work themselves out
for example:
first off setup a traffic light sytem attached to a trigger, if trigger is off, light is red for car1 and light is green for ped1, have the traffic light change status in a script every 10 seconds or so. you could use a material switch entity here as well to change the colours of the lights. have both car and pedscripts do a check at a script point by using an attribute called lightstatus and values 1 being green, 0 being red.
ped1 and car1 both arrive at a set of traffic lights, both should be at a script point on arrival to the script point they both do a check on light status: if red the wait/play idle animation, if green vice versa (read up on triggers and scripting)
you can throw random elements (i.e don't do a check) in some cases, to cause accidents/ect for extra laughs can have a car run a red and smash head on into a person or another car(HA-AH MAYHEM!)

================================================
streets, to have an effective traffic and pedestrian system, they really are not that hard to produce, you just have to be logical in your approach, these are seemingly complex, but if you use a reality based model the system will work themselves out

for example:
first off setup a traffic light sytem attached to a trigger, if trigger is off, light is red for car1 and light is green for ped1, have the traffic light change status in a script every 10 seconds or so. you could use a material switch entity here as well to change the colours of the lights. have both car and pedscripts do a check at a script point by using an attribute called lightstatus and values 1 being green, 0 being red.
ped1 and car1 both arrive at a set of traffic lights, both should be at a script point on arrival to the script point they both do a check on light status: if red the wait/play idle animation, if green vice versa (read up on triggers and scripting)
you can throw random elements (i.e don't do a check) in some cases, to cause accidents/ect for extra laughs can have a car run a red and smash head on into a person or another car(HA-AH MAYHEM!)
Yea I am taking the game process its self slow, but I'm trying to get all the info I can.
I'm going to make a list so I can keep track of everthing in the level and scripting. I know you guys are probably sick of my question but. Say I wanted to make an ambulance script, like your driving down the street and you hit a ped and the ambulance comes. I think I have a general idea of how to make a fairly decent police script. I've been reading all the scripting docs I can. I'm practicing by making little small trashy scripts, just to get the hang of it.
If you guys know of any more docs for scripting, besides the one in the new 072a manual please let me know. After I figure it out and am good with scripting I plan on trying to make a tutorial to help others along.


If you guys know of any more docs for scripting, besides the one in the new 072a manual please let me know. After I figure it out and am good with scripting I plan on trying to make a tutorial to help others along.
Jonas
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
Oh yea.... Does anyone have an idea on how to start making my city? Like as in the map and stuff.
Jonas
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
Good idea! Now to pick a town that would be easiest to make!
Jonas
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack