Quantcast

Jump to content

» «
Photo

Tutorial Links and Mission Coding Information

  • This topic is locked This topic is locked
112 replies to this topic
Y_Less
  • Y_Less

    629

  • Members
  • Joined: 14 Mar 2004

#61

Posted 26 December 2004 - 12:42 PM

QUOTE (random_download @ Dec 25 2004, 22:34)
QUOTE
3@ - These are local variables, they are only used within 1 thread and range from 0 - 17 (apparently there is a 19, but that only works between waits, and I don't know about 18). These can be floating-point or integer, and have their own OpCodes which work for both types.

16@ and 17@ are timers, so they increase by 1 for every milisecond that passes. Didn't think that was clear in that section.

Yeah, I should have mentioned that.

So does anyone yet know what 18@ does?

Demarest once said something about 19@ being another special variable, but that still left a gap (18) and I never understood what he was on about. Dem?

Barton Waterduck
  • Barton Waterduck

    retired modder

  • Members
  • Joined: 12 Feb 2002

#62

Posted 27 December 2004 - 06:35 AM

In the VC MB, local vars higher than 17 aren't supported and can't be used.

sleeper777
  • sleeper777

    Mission Coder | Help Guru | Tech Ninja

  • Members
  • Joined: 28 Mar 2003

#63

Posted 27 December 2004 - 10:30 AM Edited by sleeper777, 26 January 2005 - 08:29 AM.

There has been some talk about maximum sizes for the sections of the Main.scm file. According to the gurus the sizes are follows

Vice City
The First four segments can be no bigger than 225,512 bytes.
and Missions can be no bigger than 35,000 bytes.

If there is any reason to doubt this information or if there is any new information i don't know about please feel free to PM me about it.

ph34r.gif

ayrton2388
  • ayrton2388

    Player Hater

  • Members
  • Joined: 10 Feb 2005

#64

Posted 19 February 2005 - 04:00 PM

I want to add some working clothes pickup to my game. How do i do this?

ayrton2388
  • ayrton2388

    Player Hater

  • Members
  • Joined: 10 Feb 2005

#65

Posted 19 February 2005 - 04:02 PM

...and what are the floating-points? (just curious)

Justin
  • Justin

    have a cigar

  • Members
  • Joined: 30 Jun 2004
  • None

#66

Posted 22 February 2005 - 09:33 AM

@ Guy above me - You'd be better posting a new topic about it in this forum. This topic is supposed to be just for tutorials and links.

Y_Less
  • Y_Less

    629

  • Members
  • Joined: 14 Mar 2004

#67

Posted 23 February 2005 - 10:17 AM

I wrote a whole topic on floating point numbers, its in my topic in the tutorial section.

SMG
  • SMG

    Street Cat

  • Members
  • Joined: 13 Nov 2002

#68

Posted 05 July 2005 - 08:57 AM

How about updating this for San Andreas?

I have no modding experiance before, and I see all these main.scm mods coming out, but I don't know what tools I need to do it!

DuPz0r
  • DuPz0r

    BushkaUK

  • Members
  • Joined: 24 Jun 2005
  • None

#69

Posted 18 July 2005 - 11:11 AM

I can spawn stuff for SA now, i wanna learn something new, what would be the best thing to try now?
suggestions/links would be good.

Demarest
  • Demarest

    what could be

  • BUSTED!
  • Joined: 12 Jul 2003

#70

Posted 18 July 2005 - 11:48 AM

Do some while loops. Try manually spawning a car, executing a fade and fade back, etc. All depends on what you're looking to accomplish. Maybe grab somebody else's mod, use it in game and see if you can on your own figure out how they did it. Then look at their code, notice the differences between what they used and what you expected to see and try to determine if you understand why it was implimented the way it was. If not, ask, etc. Many directions to go smile.gif

DuPz0r
  • DuPz0r

    BushkaUK

  • Members
  • Joined: 24 Jun 2005
  • None

#71

Posted 19 July 2005 - 11:11 AM

I wanna be able to make a racing minigame, and i want to be able to put the modshop markers anywhere i wish.
That would be ideal.
I just need to know where to start...

Xanarki
  • Xanarki

    Li'l G Loc

  • Members
  • Joined: 21 Jul 2005

#72

Posted 29 July 2005 - 05:57 AM

It'd be great if there was a version of this for San Andreas.

Y_Less
  • Y_Less

    629

  • Members
  • Joined: 14 Mar 2004

#73

Posted 29 July 2005 - 09:49 AM

Alot of the coding is the same, you just need to convert it slightly.

Xanarki
  • Xanarki

    Li'l G Loc

  • Members
  • Joined: 21 Jul 2005

#74

Posted 29 July 2005 - 11:41 PM

Since I can't convert worth a crap.

XD

Demarest
  • Demarest

    what could be

  • BUSTED!
  • Joined: 12 Jul 2003

#75

Posted 30 July 2005 - 01:43 AM

First of all, coding is coding. Doesn't matter what language it's in, an if/then statement is still an if/then statement. Loops, variables, and gosubs are the same, etc...

As for "converting", I don't know why so many people shriek at the mention. It's really quite simple. Let's say you're going for a direct conversion of a VC mod. Say the line in MB 0.22 for VC is
CODE
01AF:   car  4016??  0? ()near_point  95.3! -1468.3!  9.5! radius  1.5!  1.5!  3!
...search the SA code for opcode 01AF. In MB 0.33 for SA, it's
CODE
01AF:   car @74  0 ()near_point @143 @150 @157 radius  .2  .2  1.0
Looks as if all that's changed is the lack of datatypes. Assuming you've read the readme for both apps, making that conversion should be a breeze. Tedious, but easy as.

Xanarki
  • Xanarki

    Li'l G Loc

  • Members
  • Joined: 21 Jul 2005

#76

Posted 30 July 2005 - 11:29 AM

Hmm, intersting. But you see, I can't convert a turf coding from Vice City into San Andreas...cause Vice City didn't have turfs (to take over).

I looked at all the other data files, and there is nothing about taking over turfs in San Andreas (I made a topic bout this in the Misc Forum). And so, the last file I need to check is main.scm and all the blocks are gettin' in meh way.

Demarest
  • Demarest

    what could be

  • BUSTED!
  • Joined: 12 Jul 2003

#77

Posted 30 July 2005 - 01:38 PM

I've seen topics made on the subject. Did you check them out?

Going back to the original idea you brought up, this tutorial is meant to be a starter's guideline. So to cover every single aspect of the games in question is not only outside the scope of this thread, but I would think it to be a task far grander than a single thread could handle. Maybe check those threads out, see who's in the know, and encourage them to post a thread in the tutorial section on how to manipulate those.

Xanarki
  • Xanarki

    Li'l G Loc

  • Members
  • Joined: 21 Jul 2005

#78

Posted 02 August 2005 - 11:06 PM

I've looked at msot of those topics. Not many topics talk about the gang turfs and such.

alexrw
  • alexrw

    Peon

  • Members
  • Joined: 10 Feb 2005

#79

Posted 04 September 2005 - 10:26 AM

i'm realy wanting to learn coding but i don't know where to start
i can't find a tutorial for SA
what am i supposed to do?

random_download
  • random_download

    :o

  • Members
  • Joined: 07 Mar 2004

#80

Posted 04 September 2005 - 11:57 AM

Read a VC tutorial, most things still apply in SA, or you could wait until a coding tutorial for SA is released.

YeTi
  • YeTi

    S'up Bitches?

  • Andolini Mafia Family
  • Joined: 28 Mar 2005

#81

Posted 04 September 2005 - 12:26 PM Edited by YeTi, 04 September 2005 - 04:35 PM.

QUOTE (random_download @ Sep 4 2005, 12:57)
Read a VC tutorial, most things still apply in SA, or you could wait until a coding tutorial for SA is released.

Funnily enough i have wrote a SA coding tutorial today and am just waiting for it to be approved. Although it is similar to VC Coding i have also wrote tutorials about that too links in my sig smile.gif .

EDIT: It's been approved. Here.

Y_Less
  • Y_Less

    629

  • Members
  • Joined: 14 Mar 2004

#82

Posted 02 February 2006 - 06:00 PM

How to make a mission for n00bs who expect you to explain it in a single post cos they can't be bothered to read the long tutorials and want it put simpler.

By Alex "Y_Less" Cole


Note the ammusing annecdotes at the bottom smile.gif .

Open Mission Builder and either decompile your main.scm or use a provided text mission file. Add a number of OpCodes in a certain order to achieve the desired ingame effect. The OpCodes are detailed in opcodes.txt or at vc-db.webtools4you.net, there is an SA version. Properties are defined at the top of the file and missions at the bottom. The code still running while you are not in a mission is called MAIN and uses ££ to define jump addresses over the MISSION segments £ (except when referencing labels in MAIN when they too use ££), labels are defined by a ':' prefix and are one word. Code run at the games start mostly comes before the first create_thread line. That line is used to create a looping thread at a given label, this is most likely where your code will go. All loops must have a wait command, wait 0 is valid. Models must be loaded before use. Savegames are not compatible except when using Darkpact (appending to MAIN and using mission code to run threads and rewite code). The mission structure is documented in the MB readme. To run a mission you will need a sniffer thread to trigger it. Naming threads is advisable.

Float structure:

[\d]+\.[\d]+

If structure:

if (#args-1)
arg 0
agr 1
...
jf £[£]?[\w]+

Annecdotes:

The create thread lines are null delimited and may thus have up to 16 parameters (engine limited).

You can create your own OpCodes by hooking the pointer for 0124 using "setplayerhandlingresponsiveness -5035& 8524424&&" (note the MB o.22 syntax) to set an address according to the formula "param1*114h+7DBCB0h+68h". Then just save some ASM into 32bit ints in MB (signed, little endian, 8?? on - you will need to comment out all the variables in VICESCM.INI) to run your OpCode then admire in-game.

Further reading:

Manipulating game memory for fun and profit revisited - contains links to the original topic by CyQ.
Link, link - applications of mem hacking.
Darkpact - SA version.

Sorry, those tutorials are long to make it simple. But as you wanted it in a post, here it is. I had to skimp a bit on some areas but you should get the idea.

chaosislife
  • chaosislife

    Member title?

  • Members
  • Joined: 01 Feb 2006

#83

Posted 27 February 2006 - 02:13 PM

Actually I kind of see Barton's point(at least I hope this is what he was thinking),it's prolly better to have newbies use the newest programs as they're usually the most stable and easiest to start with.If you already use the earlier ones then fine,but it might be more helpful to us newer folk to use something that doesn't die on us for no apparent reason or seem to require you to already be a master coder to use it.---------ok so apparently i'm replying to something that was written about a year ago when the topic was started...oh well

Y_Less
  • Y_Less

    629

  • Members
  • Joined: 14 Mar 2004

#84

Posted 27 February 2006 - 04:55 PM

Err, well to which post are you reffering? BW removed alot of useful functionality in the later versions, meaning it is no longer possible to decompile and recompile the script and reproduce it exactly the same due to gaps now ignored in variables. He also removed DMA which doesn't affect most people but does some.

I have also never had a problem with 0.22 wheras I can crash 1.5 trying to make up for lost functionality.

chaosislife
  • chaosislife

    Member title?

  • Members
  • Joined: 01 Feb 2006

#85

Posted 19 March 2006 - 04:03 AM Edited by chaosislife, 19 March 2006 - 04:42 AM.

QUOTE (Barton Waterduck @ Jun 18 2004, 12:28)
Posting old links to old files should be against the forum rules. It's not a secret that the newest mission builder is version 1.3 for Vice and 5.0 for GTA 3. The links are in my signature.

New users: I'm sorry you have to read crap like this. Some people think they own this forum, so they post what their egos dictate. Just read the readme included with the latest versions and forget you ever heard about this forum.

Oh, and since this topic is pinned, the 0.22 version of the Vice mission builder doesn't work at all with some of the newer opcodes because the number of parameters are wrong. Your game WILL CRASH if you use them.

If somebody were to build a wodden hammer, label it "PRE ALPHA TEST VERSION" and hit you in the head with it, would it hurt ? If it does, keep it to yourself please.

That was what i was talking about,and yeah i'm begining to wonder about the funtionality myself as i've just opened up the editor and tried to find where to put the new code thread so I can add Demarest's steed mod and maybe amorall to my SCM.....Dem's GTA3 tutorial say's to search for "genstuf" with the finder, but when i search for it I get nothing.Maybe it truly isn't in there but I'd think Dem would have edited his tutorial to state that if this was indeed the case.I'm going to have to try opening up the 0.22 version and see if I can find it with that one I guess


Yay! i figured out how to quote! I was worried just how that'd turn out for a while.


ummm..editing again to save a new post.... A question.. I've seen these symbols(££) used in the SCM in order to add the new thread,but where exactly on the keyboard would I find those keys? Cuz I'm looking and I ain't findin em'.do I just cut and paste them or what here?It looks to me like the sign brits use for money so I WAs thinkin to use my $ sign but thats also used in the coding so now I'm clueless(or should that be clue less?)

Y_Less
  • Y_Less

    629

  • Members
  • Joined: 14 Mar 2004

#86

Posted 19 March 2006 - 11:45 AM

It is a pound sign yes, and is used for jump locations. It should be alt-0163 if you don't have it as shift-3

Also, 0.22 doesn't work with GTA 3, it was never even intended to, you need a GTA 3 builder for that.

chaosislife
  • chaosislife

    Member title?

  • Members
  • Joined: 01 Feb 2006

#87

Posted 19 March 2006 - 02:25 PM Edited by chaosislife, 20 March 2006 - 01:25 AM.

ah ok thanks Y_less,tho on my key board it should come up as a tictactoe board ( # )so i wonder if it will work like that in the builder.(tho cut and paste works fine too)also I should have stated that i was working on Vice's SCM and not gta which is what Dem's tutorial was written for.But i found a tutorial for vice here that helped,got the code in,and got it working.Now my only issues going to be getting the game to work properly as i'm trying that out for the Vice City Deluxe mod

Y_Less
  • Y_Less

    629

  • Members
  • Joined: 14 Mar 2004

#88

Posted 24 May 2006 - 02:01 AM

This is sort of Mission Coding Information, so I've put it here so it doesn't get lost.

Stripped SA SCM, curtousy of Demarest:

CODE
DEFINE VERSION SA 0.33

0002: jump ££Second_Segment
DEFINE MEMORY 43800; Equals Mission Builder type global variable range $2 to $10949

:Second_Segment
0002: jump ££Third_Segment
DEFINE OBJECTS 3
DEFINE OBJECT MOO; This is an unused object. You can put anything here.
DEFINE OBJECT BRIBE; Object number -1
DEFINE OBJECT HEALTH; Object number -2

:Third_Segment
0002: jump ££Fourth_Segment
DEFINE MISSIONS 0

:Fourth_Segment
0002: jump ££Fifth_Segment
DEFINE EXTERNAL_SCRIPTS 0

:Fifth_Segment
0002: jump ££Sixth_Segment
DEFINE UNKNOWN_FIFTH_SEGMENT
DEFINE UNKNOWN1 0

:Sixth_Segment
0002: jump ££MAIN_1
DEFINE UNKNOWN_SIXTH_SEGMENT
DEFINE UNKNOWN3 574

;-------------MAIN---------------


:MAIN_1
03A4: name_thread 'MAIN'
016A: fade 0 () 0 ms
01F0: set_max_wanted_level_to 6
0111: set_wasted_busted_check_to 0 (disabled)
00C0: set_current_time 10 0
0007: @10 = -300.0
0007: @11 = -150.0
0007: @12 = 0.0
04E4: unknown_refresh_game_renderer_at @10 @11
03CB: set_camera @10 @11 @12
0053: $PLAYER_CHAR = create_player #NULL at @10 @11 @12
01F5: $PLAYER_ACTOR = create_emulated_actor_from_player $PLAYER_CHAR
0629: change_stat 181 (islands unlocked) to 4; integer see statdisp.dat
01B6: set_weather 1
070D: $PLAYER_CHAR
04BB: select_interior 0;; select render area
01B4: set_player $PLAYER_CHAR frozen_state 1 (unfrozen)
01B7: release_weather
016C: restart_if_wasted at @10 @11 @12 angle 0.0 unknown 0
016D: restart_if_busted at @10 @11 @12 angle 0.0 unknown 0
016A: fade 1 () 1000 ms
0001: wait 200 ms
03E6: remove_text_box

:MAIN_3
0001: wait 2500 ms
0002: jump ££MAIN_3

azzza
  • azzza

    Square Civilian

  • Members
  • Joined: 03 Feb 2004

#89

Posted 14 July 2006 - 04:56 AM

hi all, I am woundering if you can help me out with timers for gta3, vice city and sa. It's been i long time since i worked with timers and i've got afew questions about them, and the are ->

1) what are the timer? eg 16@ 17@?

2) what is a minute for gta3, vc, sa?

3) how are timer's are used?

Some more questions for sa ->

1) how can i get the player to lift an object from a point to a car?

Note: i woundd look this information up myself, but my pc is getting reparied and i'm use public access pc's to access the internet. And thanks in advance, if you can help me out.

Demarest
  • Demarest

    what could be

  • BUSTED!
  • Joined: 12 Jul 2003

#90

Posted 14 July 2006 - 06:31 AM

Long time no see. Correct me if I'm wrong, but you've ripped me in the past, tossed out the advice given to you repeatedly by many coders, etc. You're on your own.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users