Elaztek Developer Hub
Blamite Game Engine - blam!  00423.10.27.24.0533.blamite
The core library for the Blamite Game Engine.
script.h
Go to the documentation of this file.
1 // script [hsdt] - Tag Definition //
3 // -------- //
4 // Part of the Blamite Game Engine //
5 // Copyright (c) Elaztek Studios 2013 - 2023 //
7 
8 
9 #pragma once
10 
11 #include <string>
12 #include <blam/api/v1/types/tags.h>
14 
15 #ifndef BLAM
16 #define BLAM
17 #endif
18 
19 enum class variable_type : uint32_t
20 {
21  int,
22  string,
23  real,
24  bool,
25 };
26 
27 
28 #pragma pack(push, 1)
29 struct script
30 {
31  TAG_ENUM(type,
32  {
33  hsc,
34  cpp,
35  cs,
36  vs,
37  });
38 
39  TAG_BLOCK(hs_script_data,
40  {
41  //not yet implemented
42 
43  });
44  TAG_BLOCK(c_script_data,
45  {
46  //C++ Script Data
47 
48  data_reference extension;
49  data_reference script_class_name;
50  TAG_BLOCK(script_methods,
51  {
52  data_reference name;
53  variable_type return_type;
54  TAG_BLOCK(parameters,
55  {
56  data_reference name;
57  variable_type type;
58  });
59  });
60  });
61  TAG_BLOCK(c_script_data,
62  {
63  //not yet implemented
64 
65  });
66  TAG_BLOCK(visual_script_data,
67  {
68  //not yet implemented
69 
70  });
71 };
72 #pragma pack(pop)
73 
75 {
76 public:
78  {
79  class_name_long = "script";
80  class_name_short = "hsdt";
81  version = 0;
82 
83  revisions = {
84 
85  };
86 
87  tag_size = 132;
88 
89  fields =
90  {
91  new Enum32Field("type", "",
92  {
93  "haloscript",
94  "c++ script",
95  "c# script",
96  "visual script",
97  }),
98  new BlockField(0, "hs script data", "",
99  {
100  new CommentField("not yet implemented",
101  ""),
102  }),
103  new BlockField(96, "c++ script data", "",
104  {
105  new CommentField("C++ Script Data",
106  ""),
107  new DataReferenceField("extension", ""),
108  new DataReferenceField("script class name", ""),
109  new BlockField(68, "script methods", "",
110  {
111  new DataReferenceField("name", ""),
112  new Enum32Field("return type", "",
113  {
114  "int",
115  "string",
116  "real",
117  "bool",
118  }),
119  new BlockField(36, "parameters", "",
120  {
121  new DataReferenceField("name", ""),
122  new Enum32Field("type", "",
123  {
124  "int",
125  "string",
126  "real",
127  "bool",
128  }),
129  }),
130  }),
131  }),
132  new BlockField(0, "c# script data", "",
133  {
134  new CommentField("not yet implemented",
135  ""),
136  }),
137  new BlockField(0, "visual script data", "",
138  {
139  new CommentField("not yet implemented",
140  ""),
141  }),
142 
143  };
144  }
145 };
146 
147 namespace Blam::Content::Tags
148 {
149  BLAM script* GetScriptTag(std::string tag_path);
150 }
variable_type::int
@ int
variable_type
variable_type
Definition: script.h:19
ScriptTagClass::ScriptTagClass
ScriptTagClass()
Definition: script.h:77
Blam::Content::Tags
Namespace containing functions related to tag data.
Definition: bitmap.h:197
variable_type::real
@ real
DataReferenceField
Class representing a data reference, or dataref for short.
Definition: dataref.h:19
BLAM
#define BLAM
Definition: script.h:16
variable_type::bool
@ bool
Enum32Field
Definition: enum.h:46
Blam::API::v1::Tags::GetTagData
BLAM_EXT_API BlamTagData * GetTagData(std::string tag_path)
Retrieves information for a given tag.
Definition: api.cpp:197
BlamTagClass::fields
std::vector< BlamTagClassField * > fields
A series of tag fields that store the layout of the tag.
Definition: tags.h:200
BlamTagClass::revisions
std::vector< BlamTagClassRevision > revisions
List of all tag class revisions. Does not get written to tags, but is included in plugin files.
Definition: tags.h:199
plugins.h
BlamTagClass::class_name_short
std::string class_name_short
The short, 4-character name of the tag class.
Definition: tags.h:197
BlamTagClass::version
int version
The tag class version. Should be incremented any time a tag class is modified whatsoever.
Definition: tags.h:198
BlamTagClass::class_name_long
std::string class_name_long
The longer class name. Typically shown alongside short name for user-friendliness.
Definition: tags.h:196
uint32_t
unsigned int uint32_t
Definition: stdint.h:17
ScriptTagClass
Definition: script.h:74
variable_type::string
@ string
Blam::Content::Tags::GetScriptTag
BLAM script * GetScriptTag(std::string tag_path)
Definition: script.cpp:13
data_reference
Structure representing a data reference.
Definition: tags.h:323
BlamTagClass::tag_size
int tag_size
The size of the tag's data. Used on loading/writing tag files.
Definition: tags.h:201
script::TAG_ENUM
TAG_ENUM(type, { hsc, cpp, cs, vs, })
BlamTagData::address
void * address
The address pointing to the start of the tag's data.
Definition: tags.h:130
script::TAG_BLOCK
TAG_BLOCK(hs_script_data, { })
tags.h
script.h
BlamTagData
Class used to contain and access tag data.
Definition: tags.h:124
CommentField
Class representing a comment field.
Definition: comment.h:29
BlockField
Class representing a tag block field, also sometimes referred to as a struct or reflexive in the modd...
Definition: block.h:19
script
Definition: script.h:29
BlamTagClass
Class representing a tag class.
Definition: tags.h:193
api.h