Attaching Scripts to Objects

Discuss the creation and scripting of new fan-made games and mods for the Fallout series of games.
Post Reply
Temaperacl
Vault Veteran
Vault Veteran
Posts: 292
Joined: Fri Apr 19, 2002 11:51 am

Attaching Scripts to Objects

Post by Temaperacl »

I've been trying to get scripts associated with objects I create or change which script is associated with a given object/entity. When I change the 'Map script ID' that should be associated with a pre existing entity, that change is not having any effect. When I create an entity and alter the 'Map script ID', I'm getting an Error attaching script to object in the debug log, and the script doesn't work. The MSG file is referred to, however, when looking at the entity, since the name is correct.

Anyhow, anyone gotten this to work correctly or have any ideas I might not have considered yet?
Silent
SDF!
SDF!
Posts: 1
Joined: Mon Nov 25, 2002 5:53 pm

Post by Silent »

I tried the same thing and had some success simply switching scripts around. For example, I turned Joey in the Den into Flick without any problem. I am now trying to figure out exactly how the Map Script Id is associated with the order of the scripts in the Script list. I have no idea unfortunately....
If someone could figure this out, or explain it, then we could really get flying on new maps etc.

By the way, I haven't been able to get the Decompiler, + its patch, to work at all. Anyone else having this problem?

OH yah, i almost forgot...i didn't switch the Map Script Id ...that had no effect..i changed the other number..uhh...in Mapper obect properties it is the number above the Map Script Id numbers position..that seems to determine which script actually gets associated with an object..

sorry..i am working from a public computer, otherwise I would have been more specific...
seawolf
SDF!
SDF!
Posts: 2
Joined: Mon Nov 25, 2002 4:57 pm

Script descriptors section of map-file

Post by seawolf »

There is so-called "script descriptors" section in map file right after
the tile arrays.
Each object in the map has link to its ScriptDescriptor (DWORD in its
properties right after its ScriptID) if object has attached script.
ScriptDescriptor has same ScriptID as in Object and same ScriptDescriptorID
in its fields.
You can find some beginning info on "script descriptors" section on this page http://members.fortunecity.com/noid84/formats/map.html

What you need to change Script M to Script N for Object X:
1) Find needed ScriptDescriptor in "script descriptors" section;
2) Change M to N in both object's ScriptID and in its ScriptDescriptor;
3) After that your changed script should work fine.

ScriptID is a number of string in Scripts\scripts.lst file (ScriptID=Number-1)
in hexadecimal presentation.
For scripts attached to the whole map (Location-script) ScriptID=Number
of string in Scripts\scripts.lst file.

Description for process of adding new or deleting not needed descriptors not
found by me on the Net but fully understood now.
Maybe Dims in his mapper realizes editing of the "script descriptors" section
in upcoming updates... (www.hot.ee/fallout)

Or you can contact me on this topic - mailto:seawolf@fallout.ru
(maybe it will encourage me to describe "script descriptors" section fully :)
seawolf
SDF!
SDF!
Posts: 2
Joined: Mon Nov 25, 2002 4:57 pm

To Temaperacl:

Post by seawolf »

To Temaperacl:

your problem is:
For every object with attached script there 2 places in the map where it should be changed to took effect:
1) in objects's ScriptID field;
2) in ScriptDescriptor associated with this object through its property "Map Script ID" (as it is named in Dims's mapper).

change ScriptID in both places and it will took effect.
Our Host!
Post Reply