|
What is This?
This tutorial will show you how to make the random pager messages we all love from the original GTA1 maps. The best way to start is to explain quite how they work.
There are a network of TRIGGER objects around the city with a range of 4 blocks. When the player runs over these, it starts a routine which waits for a couple of minutes, then makes the pager message. The reason it waits so long is so that you never really know quite where the pager message got triggered from, thus making them seem random. It's a neat feature.
Where's the Stuff Responsible for This?
I will be using San Andreas as the example here as it's pager messages are in capitals so are easy to find. (Plus they're bloody hilarious!) So open up the original mission.ini file, SanA.cmp in J25 1.6 and the original English.FXT file to view the text.
To locate the text we will be working with, search the FXT file for:
[2610]Man gives birth to dog. Shocked wife has kittens. Film at eleven
LOL, it's a great one I know. Now to find the TRIGGER that will set it off. We have to reverse-engineer this from the message back trhough the code to the object, it's a very common technique for finding out how the mission file ticks.
If you search the mission file for:
P_BRIEF 0 -1 0 0 2610
That will find the line that makes the pager show that message. Easy. Now if you look around that lne, you'll see the procedure:
28300 DISABLE 9700 0 0 0 0
28301 KEEP_THIS_PROC 0 0 0 0 0
28310 SURVIVE 0 0 0 2500 0
28320 P_BRIEF 0 -1 0 0 2610
But What is it Doing?
Now to work through this code. The DISABLE 9700 part means that it was TRIGGER 9700 that started this procedure. We'll bear that in mind.
The KEEP_THIS_PROC is used so that the pager routine won't get killed. It would get killed if you complete a mission in this time, as at the end of the mission it does a RESET which stops all routines apart from the the reset is in.
The SURVIVE 0 0 0 2500 0 makes the command processor wait there for 2500 frames. now there are 25 GTA frames per second, and 2500 divided by 25 is 100. Therefore the timer actually waits 100 seconds. Wow, that's like looking into the brain of the original mission writers, scary huh?
The -1 in the P_BRIEF statement is put there to stop the command processor from falling out of the bottom of the routine. Not something you want to happen!
Now that we understand the code we can go have a look at where this object is. To search for this trigger sucessfully, we can take 2 approaches. We can search the whole docment for it's object number and hope that we can fgure out which obejct 9700 it is, or we can search for this:
TRIGGER 28300 4
This is likely to work better, because we only want trigger objects, we only want a trigger that points to line 38300, and also we know (because I told you) that the radious has to be 4. So serch for that and it'll jump straight to the right line:
9700 (77,10,1) TRIGGER 28300 4
We see that it's coords are (77,10,1) and if you go check this on the SanA.cmp map you'll see this trigger is located in Richman and covers and area which only includes half the width of the east-west road. You'll find this happen a lot, because the programmers figured that if you only use half the road then there's half the chance the palyer will get the trigger each time, thus prolonging the time to get through all the pager messages AND increasing the randomness.
It's times like this you realise how much the GTA1 mission coders cared.
How do I Try This Myself?
I know, this is perhaps the greatestthe moment of your life. You've realised that snazzy wireframe maps and lense flares aren't the best thing about games, it's the dedication and inginuity of the coders.
Here's the code you'll need to get off the ground, you'll have to custimise the co-ords of objects and the line in the FXT file that the P_BRIEF is set to display (or make a new line and use that nummr in the P_BRIEF command - whoa, you're a full-on modder now!) and tinker with the time it waits for...
Well here ya go, you crazy diamond:
[1]
Pager Briefs, 22, yourmap.cmp, 0,
100 1 1 1 1 0
0 (0,0,0) DUMMY 0 0
1 1 (1,1,1) TRIGGER 10 255
100 (5,5,4) PARKED 04 768
1000 (126,16,4) TRIGGER 25000 10
1001 (200,36,3) TRIGGER 2 25010 2
1002 (102,40,3) TRIGGER 4 25020 4
1003 (31,125,3) TRIGGER 25030 2
1004 (113,109,3) TRIGGER 25040 1
1005 (231,129,3) TRIGGER 25050 1
1006 (145,155,3) TRIGGER 25060 4
1010 (131,166,3) TRIGGER 25100 4
1020 (207,172,3) TRIGGER 25200 4
1021 (170,170,3) TRIGGER 25210 2
1022 (248,176,3) TRIGGER 25220 2
1023 (180,200,3) TRIGGER 25230 4
32100 1 (4,5,4) PLAYER 100 256
-1
0 DONOWT 0 0 0 0 0
10 STARTUP 1 0 0 0 0
12 MESSAGE_BRIEF 0 0 0 0 8001
98 DONOWT 0 -1 0 0 0
25000 DISABLE 1000 0 0 0 0
25001 KEEP_THIS_PROC 0 0 0 0 0
25002 SURVIVE 0 0 0 250 0
25004 P_BRIEF 0 -1 0 0 2600
25010 DISABLE 1001 0 0 0 0
25011 KEEP_THIS_PROC 0 0 0 0 0
25012 SURVIVE 0 0 0 250 0
25013 P_BRIEF 0 -1 0 0 2601
25020 DISABLE 1002 0 0 0 0
25021 KEEP_THIS_PROC 0 0 0 0 0
25022 SURVIVE 0 0 0 250 0
25023 P_BRIEF 0 -1 0 0 2602
25030 DISABLE 1003 0 0 0 0
25031 KEEP_THIS_PROC 0 0 0 0 0
25032 SURVIVE 0 0 0 250 0
25033 P_BRIEF 0 -1 0 0 2603
25040 DISABLE 1004 0 0 0 0
25041 KEEP_THIS_PROC 0 0 0 0 0
25042 SURVIVE 0 0 0 250 0
25043 P_BRIEF 0 -1 0 0 2604
25050 DISABLE 1005 0 0 0 0
25051 KEEP_THIS_PROC 0 0 0 0 0
25052 SURVIVE 0 0 0 250 0
25053 P_BRIEF 0 -1 0 0 2605
25060 DISABLE 1006 0 0 0 0
25061 KEEP_THIS_PROC 0 0 0 0 0
25062 SURVIVE 0 0 0 250 0
25063 P_BRIEF 0 -1 0 0 2606
25100 DISABLE 1010 0 0 0 0
25101 KEEP_THIS_PROC 0 0 0 0 0
25102 SURVIVE 0 0 0 250 0
25103 P_BRIEF 0 -1 0 0 2610
25200 DISABLE 1020 0 0 0 0
25201 KEEP_THIS_PROC 0 0 0 0 0
25202 SURVIVE 0 0 0 250 0
25203 P_BRIEF 0 -1 0 0 2620
25210 DISABLE 1021 0 0 0 0
25211 KEEP_THIS_PROC 0 0 0 0 0
25212 SURVIVE 0 0 0 250 0
25213 P_BRIEF 0 -1 0 0 2621
25220 DISABLE 1022 0 0 0 0
25221 KEEP_THIS_PROC 0 0 0 0 0
25222 SURVIVE 0 0 0 250 0
25223 P_BRIEF 0 -1 0 0 2622
25230 DISABLE 1023 0 0 0 0
25231 KEEP_THIS_PROC 0 0 0 0 0
25232 SURVIVE 0 0 0 250 0
25233 P_BRIEF 0 -1 0 0 2623
-1
Tutorial by cerbera MSN identity: cerbera@gtahq.com
|