city scripting

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
jonas
Posts: 779
Joined: Tue Jul 05, 2005 5:43 pm
Location: Texas, USA
Contact:

city scripting

Post by jonas » Tue Jul 05, 2005 9:11 pm

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

Guest

Post by Guest » Wed Jul 06, 2005 3:56 am

Have a bunch of change level doors on the level and jump to
the other levels from there.

User avatar
Spyrewolf
Posts: 450
Joined: Tue Jul 05, 2005 4:53 am
Location: Wellington::New Zealand

Post by Spyrewolf » Wed Jul 06, 2005 5:41 am

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!!

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
              }
       }
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.

User avatar
jonas
Posts: 779
Joined: Tue Jul 05, 2005 5:43 pm
Location: Texas, USA
Contact:

Post by jonas » Sat Jul 09, 2005 12:40 am

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

rgdyman
Posts: 84
Joined: Tue Jul 05, 2005 7:05 am

Post by rgdyman » Sat Jul 09, 2005 1:58 am

For a enemy to appear at certain times, use a "Trigger"

In the pawn entity there is a ( spawn trigger)
The pawn will only become interactive when the "Trigger" is set on.

Guest

Post by Guest » Tue Jul 12, 2005 1:15 pm

>>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.

User avatar
jonas
Posts: 779
Joined: Tue Jul 05, 2005 5:43 pm
Location: Texas, USA
Contact:

Post by jonas » Tue Jul 12, 2005 3:14 pm

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.


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.

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

User avatar
Spyrewolf
Posts: 450
Joined: Tue Jul 05, 2005 4:53 am
Location: Wellington::New Zealand

Post by Spyrewolf » Wed Jul 13, 2005 6:33 am

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!)

rgdyman
Posts: 84
Joined: Tue Jul 05, 2005 7:05 am

Post by rgdyman » Wed Jul 13, 2005 3:13 pm

jonas;

Your ganna want to take this slowly. Don't let the amount of triggers ,
Pawns, and the such confuse ya.

Make sure you name everything that you'll remember.

Also, I suggest making a layout on paper first. ( in pencil) :wink:
And write done the szEntityName's ,and the such,where they should be.

User avatar
jonas
Posts: 779
Joined: Tue Jul 05, 2005 5:43 pm
Location: Texas, USA
Contact:

Post by jonas » Wed Jul 13, 2005 5:48 pm

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. :shock:

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

User avatar
jonas
Posts: 779
Joined: Tue Jul 05, 2005 5:43 pm
Location: Texas, USA
Contact:

Post by jonas » Wed Jul 13, 2005 5:53 pm

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

Guest

Post by Guest » Mon Sep 12, 2005 2:15 am

Go on Google and get a satellite photo. :wink: There is bound to be somethig you could also look for maps of pc games for insperation.

User avatar
jonas
Posts: 779
Joined: Tue Jul 05, 2005 5:43 pm
Location: Texas, USA
Contact:

Post by jonas » Thu Sep 22, 2005 4:06 am

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

Post Reply