Skip to main content

Are

Struct Are 

Source
pub struct Are {
Show 81 fields pub unused_id: i32, pub creator_id: i32, pub version: u32, pub comment: String, pub name: GffLocalizedString, pub tag: String, pub on_heartbeat: ResRef, pub on_user_defined: ResRef, pub on_enter: ResRef, pub on_exit: ResRef, pub flags: u32, pub camera_style: i32, pub default_envmap: ResRef, pub unescapable: bool, pub restrict_mode: u8, pub chance_rain: i32, pub chance_snow: i32, pub chance_lightning: i32, pub wind_power: i32, pub chance_fog: i32, pub moon_ambient_color: u32, pub moon_diffuse_color: u32, pub moon_fog_color: u32, pub sun_ambient_color: u32, pub sun_diffuse_color: u32, pub sun_fog_color: u32, pub dynamic_ambient_color: u32, pub moon_fog_near: f32, pub moon_fog_far: f32, pub fog_near: f32, pub fog_far: f32, pub moon_fog_enabled: bool, pub fog_enabled: bool, pub moon_shadows: bool, pub shadows: bool, pub day_night_cycle: u8, pub is_night: bool, pub shadow_opacity: u8, pub lighting_scheme: u8, pub no_rest: bool, pub mod_spot_check: i32, pub mod_listen_check: i32, pub grass_diffuse_color: u32, pub grass_ambient_color: u32, pub grass_density: f32, pub grass_size: f32, pub grass_texture: ResRef, pub grass_prob_ll: f32, pub grass_prob_lr: f32, pub grass_prob_ul: f32, pub grass_prob_ur: f32, pub alpha_test: f32, pub stealth_xp_max: u32, pub stealth_xp_current: u32, pub stealth_xp_loss: u32, pub stealth_xp: bool, pub trans_pending: u8, pub trans_pend_next_id: u8, pub trans_pend_curr_id: u8, pub loadscreen_id: u16, pub rooms: Vec<AreRoom>, pub expansion_list: Vec<AreExpansionEntry>, pub map: AreMap, pub mini_game: Option<AreMiniGame>, pub disable_transit: bool, pub no_hang_back: bool, pub player_only: bool, pub player_vs_player: u8, pub grass_emissive_color: u32, pub dirty_argb_one: i32, pub dirty_size_one: i32, pub dirty_formula_one: i32, pub dirty_func_one: i32, pub dirty_argb_two: i32, pub dirty_size_two: i32, pub dirty_formula_two: i32, pub dirty_func_two: i32, pub dirty_argb_three: i32, pub dirty_size_three: i32, pub dirty_formula_three: i32, pub dirty_func_three: i32,
}
Expand description

Typed ARE model built from/to Gff data.

Fields§

§unused_id: i32

Legacy area id (ID).

§creator_id: i32

Legacy creator id (Creator_ID).

§version: u32

Area format version (Version).

§comment: String

Toolset/comment field (Comments).

§name: GffLocalizedString

Localized area name (Name).

§tag: String

Area tag (Tag). Engine always lowercases this on load.

§on_heartbeat: ResRef

Heartbeat script resref (OnHeartbeat).

§on_user_defined: ResRef

User-defined event script resref (OnUserDefined).

§on_enter: ResRef

Enter script resref (OnEnter).

§on_exit: ResRef

Exit script resref (OnExit).

§flags: u32

Area flags (Flags).

§camera_style: i32

Camera style ID (CameraStyle).

§default_envmap: ResRef

Default environment map resref (DefaultEnvMap).

§unescapable: bool

Unescapable area flag (Unescapable).

§restrict_mode: u8

Restrict mode (RestrictMode) - triggers UnstealthParty on non-zero change.

§chance_rain: i32

Chance of rain (ChanceRain, K2). Engine discards if interior. Truncated to byte (0-255) at runtime.

§chance_snow: i32

Chance of snow (ChanceSnow, K2). Engine discards if interior. Truncated to byte (0-255) at runtime.

§chance_lightning: i32

Chance of lightning (ChanceLightning, K2). Engine discards if interior. Truncated to byte (0-255) at runtime.

§wind_power: i32

Wind power (WindPower). Engine discards if interior. Truncated to byte (0-255) at runtime.

§chance_fog: i32

Chance of fog (ChanceFog).

§moon_ambient_color: u32

Moon ambient color (MoonAmbientColor).

§moon_diffuse_color: u32

Moon diffuse color (MoonDiffuseColor).

§moon_fog_color: u32

Moon fog color (MoonFogColor).

§sun_ambient_color: u32

Sun ambient color (SunAmbientColor).

§sun_diffuse_color: u32

Sun diffuse color (SunDiffuseColor).

§sun_fog_color: u32

Sun fog color (SunFogColor).

§dynamic_ambient_color: u32

Dynamic ambient color (DynAmbientColor).

§moon_fog_near: f32

Moon fog near distance (MoonFogNear). Clamped to >= 0.0 by the engine.

The absent value is far enough out that fog is effectively off, which is a different outcome from the 0.0 a reader reaching for a plain zero would produce. All four *FogNear/*FogFar reads resolve to it.

§moon_fog_far: f32

Moon fog far distance (MoonFogFar). Clamped to >= 0.0 by the engine.

§fog_near: f32

Sun fog near distance (SunFogNear). Clamped to >= 0.0 by the engine.

§fog_far: f32

Sun fog far distance (SunFogFar). Clamped to >= 0.0 by the engine.

§moon_fog_enabled: bool

Moon fog enabled (MoonFogOn).

§fog_enabled: bool

Sun fog enabled (SunFogOn).

§moon_shadows: bool

Moon shadows enabled (MoonShadows).

§shadows: bool

Sun shadows enabled (SunShadows).

§day_night_cycle: u8

Day/night cycle flag (DayNightCycle).

§is_night: bool

Is-night flag (IsNight).

§shadow_opacity: u8

Shadow opacity (ShadowOpacity).

§lighting_scheme: u8

Lighting scheme (LightingScheme).

§no_rest: bool

No-rest flag (NoRest).

§mod_spot_check: i32

Mod spot-check modifier (ModSpotCheck).

§mod_listen_check: i32

Mod listen-check modifier (ModListenCheck).

§grass_diffuse_color: u32

Grass diffuse color (Grass_Diffuse).

§grass_ambient_color: u32

Grass ambient color (Grass_Ambient).

§grass_density: f32

Grass density (Grass_Density).

§grass_size: f32

Grass quad size (Grass_QuadSize).

§grass_texture: ResRef

Grass texture resref (Grass_TexName).

§grass_prob_ll: f32

Grass probability lower-left (Grass_Prob_LL).

§grass_prob_lr: f32

Grass probability lower-right (Grass_Prob_LR).

§grass_prob_ul: f32

Grass probability upper-left (Grass_Prob_UL).

§grass_prob_ur: f32

Grass probability upper-right (Grass_Prob_UR).

§alpha_test: f32

Alpha test threshold (AlphaTest).

§stealth_xp_max: u32

Stealth XP max (StealthXPMax).

§stealth_xp_current: u32

Current stealth XP counter (StealthXPCurrent, save-state).

A chained default, not an independent one: the engine’s read falls back to whatever StealthXPMax just resolved to. A plain zero here starts an area with no stealth budget where the engine would start it with the full one, which is why the read is this view’s.

Not clamped to the max afterwards, though the engine does clamp. That happens after the read and is resolution rather than the file’s own content, and this view projects the file.

§stealth_xp_loss: u32

Stealth XP loss (StealthXPLoss).

§stealth_xp: bool

Stealth XP enabled (StealthXPEnabled).

§trans_pending: u8

Transition pending flag (TransPending, save-state).

§trans_pend_next_id: u8

Transition pending next ID (TransPendNextID, save-state).

§trans_pend_curr_id: u8

Transition pending current ID (TransPendCurrID, save-state).

§loadscreen_id: u16

Load screen ID (LoadScreenID).

§rooms: Vec<AreRoom>

Embedded room metadata (Rooms list).

§expansion_list: Vec<AreExpansionEntry>

Area expansion entries (Expansion_List list).

§map: AreMap

Embedded map metadata (Map struct).

§mini_game: Option<AreMiniGame>

MiniGame struct (MiniGame).

§disable_transit: bool

Disable transit flag (DisableTransit). Toolset/K2-specific, ignored by K1 engine.

§no_hang_back: bool

No-hang-back flag (NoHangBack). Toolset/K2-specific, ignored by K1 engine.

§player_only: bool

Player-only flag (PlayerOnly). Toolset/K2-specific, ignored by K1 engine.

§player_vs_player: u8

Player-vs-player mode (PlayerVsPlayer). Toolset/K2-specific, ignored by K1 engine.

§grass_emissive_color: u32

Grass emissive color (Grass_Emissive).

§dirty_argb_one: i32

Dirty overlay color one (DirtyARGBOne).

§dirty_size_one: i32

Dirty overlay size one (DirtySizeOne).

§dirty_formula_one: i32

Dirty overlay formula one (DirtyFormulaOne).

§dirty_func_one: i32

Dirty overlay func one (DirtyFuncOne).

§dirty_argb_two: i32

Dirty overlay color two (DirtyARGBTwo).

§dirty_size_two: i32

Dirty overlay size two (DirtySizeTwo).

§dirty_formula_two: i32

Dirty overlay formula two (DirtyFormulaTwo).

§dirty_func_two: i32

Dirty overlay func two (DirtyFuncTwo).

§dirty_argb_three: i32

Dirty overlay color three (DirtyARGBThree).

§dirty_size_three: i32

Dirty overlay size three (DirtySizeThree).

§dirty_formula_three: i32

Dirty overlay formula three (DirtyFormulaThre).

§dirty_func_three: i32

Dirty overlay func three (DirtyFuncThree).

Implementations§

Source§

impl Are

Source

pub const SCHEMA: [Field; 81]

This view’s schema, one entry per declared field.

Source

pub const PARTS: &'static [&'static [Field]]

This type’s schema in parts, which is what a container holding it references.

Own fields first, then one part per flattened child in the order they are declared.

Source

pub fn read_declared(root: &GffStruct) -> Self

Reads every declared field off root.

Absent fields take the entry’s own answer, so a fallback is derived from the declaration rather than restated beside it.

A field declaring a hand-written read is left at that answer for the view to overwrite.

Source

pub fn write_declared(&self, root: &mut GffStruct)

Writes every declared field onto root, leaving out the ones their entry says the engine’s own writer leaves out.

A field declaring a hand-written write is not touched here.

Source§

impl Are

Source

pub fn new() -> Self

Creates an empty ARE value.

Source

pub fn from_gff(gff: &Gff) -> Result<Self, AreError>

Builds typed ARE data from a parsed GFF container.

§Errors

Returns AreError::UnsupportedFileType when the container is not an ARE or a bare GFF .

Source

pub fn to_gff(&self) -> Gff

Serializes typed ARE data back into a GFF container.

Trait Implementations§

Source§

impl Clone for Are

Source§

fn clone(&self) -> Are

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Are

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Are

Source§

fn default() -> Self

What a file omitting every label loads to, which is what makes an authored file land in a known state rather than at zero.

Source§

impl FromGff for Are

Source§

const MAGIC: [u8; 4]

The four bytes a container of this format carries. Read more
Source§

type Error = AreError

What reading this view out of a tree can fail with.
Source§

fn from_gff(gff: &Gff) -> Result<Self, Self::Error>

Reads the view. Anything the view does not model stays in gff. Read more
Source§

impl HasSchema for Are

Source§

fn schema() -> &'static [Field]

The root field schema for this resource type.
Source§

fn parts() -> &'static [&'static [Field]]

The same schema in parts, own fields first. Read more
Source§

impl PartialEq for Are

Source§

fn eq(&self, other: &Are) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Are

Auto Trait Implementations§

§

impl Freeze for Are

§

impl RefUnwindSafe for Are

§

impl Send for Are

§

impl Sync for Are

§

impl Unpin for Are

§

impl UnsafeUnpin for Are

§

impl UnwindSafe for Are

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.