#1 29-12-2010 17:53

Deji
From: UK
Registered: 09-11-2008
Posts: 189
Website

[CLEO].RRR Path Loading

Posted this and thought it might be of interest to people here.

Just to confirm, this doesn't replace existing .rrr files. If you do this:

0AB1: call_scm_func @LoadCustomPathFromFile  num_params 2 file 0@ pathID 899 store_path_data_to 1@
0811: 2@ = actor $PLAYER_ACTOR car_nosave
05EB: assign_car 2@ to_path 899
repeat
    0ACD: show_text_highpriority "Playing recorded path" time 1
    003D:
until 860E:   not car 2@ assigned_to_path
0AC9: free_allocated_memory 1@
0873: release_path 899
07C0: load_path 899

The path 899 from the IMG will be loaded. The SCM Function merely sets the path data that is used by a slot (SA is dumb and assigns a separate slot for each .rrr file), which makes the game think the path is already loaded and uses the data read from the file.

This means no limits on using .rrr files (you can also add more slots for paths, but I don't think it's needed), no IMG editing and what's more.. loading paths is now instant.

Offline

#2 30-12-2010 03:42

Seemann
Registered: 07-08-2006
Posts: 2,155

Re: [CLEO].RRR Path Loading

Nicely done! Love this kind of scripts good

Offline

#3 02-01-2011 17:03

Deji
From: UK
Registered: 09-11-2008
Posts: 189
Website

Re: [CLEO].RRR Path Loading

Thanks, I had fun writing it.

It also seems that driver behaviour flags are actually used during car paths, but the value set by the SCM is overwritten at 0x45AAB0. It might be interesting to see whether NOP'ing this brings any advantages when playing recorded paths...

Offline

Board footer

Powered by FluxBB