<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://developer.vellocetsoftware.com/index.php?action=history&amp;feed=atom&amp;title=Grimwar%2FVSig</id>
	<title>Grimwar/VSig - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://developer.vellocetsoftware.com/index.php?action=history&amp;feed=atom&amp;title=Grimwar%2FVSig"/>
	<link rel="alternate" type="text/html" href="https://developer.vellocetsoftware.com/w/index.php?title=Grimwar/VSig&amp;action=history"/>
	<updated>2026-10-21T20:46:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://developer.vellocetsoftware.com/w/index.php?title=Grimwar/VSig&amp;diff=209&amp;oldid=prev</id>
		<title>DocumentationBot: Version 1</title>
		<link rel="alternate" type="text/html" href="https://developer.vellocetsoftware.com/w/index.php?title=Grimwar/VSig&amp;diff=209&amp;oldid=prev"/>
		<updated>2026-10-01T04:13:05Z</updated>

		<summary type="html">&lt;p&gt;Version 1&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{GameNav}}&lt;br /&gt;
&lt;br /&gt;
Use VSig to connect Grimwar entities and react to map or round events. Start with a working map from [[Grimwar/Mapping]]. [[Vertex/VSig]] explains the editor and language basics; [[Grimwar/VSig reference]] covers expressions, schedules, modules, and the standard library.&lt;br /&gt;
&lt;br /&gt;
== Make a door open from a trigger ==&lt;br /&gt;
&lt;br /&gt;
# Place a &amp;lt;code&amp;gt;func_door&amp;lt;/code&amp;gt; named &amp;lt;code&amp;gt;main_door&amp;lt;/code&amp;gt; and parent its geometry underneath it. Set a useful Move Direction and leave Start Locked off.&lt;br /&gt;
# Place a &amp;lt;code&amp;gt;trigger_multiple&amp;lt;/code&amp;gt; named &amp;lt;code&amp;gt;entry_trigger&amp;lt;/code&amp;gt; in front of it. Set Allowed Activators to Participants and Allowed Teams to Order and Union.&lt;br /&gt;
# Keep those entity names at the hierarchy root for this example.&lt;br /&gt;
# Save the map and open &amp;#039;&amp;#039;&amp;#039;Code → Map script&amp;#039;&amp;#039;&amp;#039;. Enter the script below.&lt;br /&gt;
# Build with &amp;#039;&amp;#039;&amp;#039;Play in Game&amp;#039;&amp;#039;&amp;#039;. Enter the trigger, leave it, and check that the door opens and closes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
scene &amp;quot;Door test&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ref entry: trigger_multiple match entry_trigger&lt;br /&gt;
ref door: func_door match main_door&lt;br /&gt;
&lt;br /&gt;
on entry.start_touch:&lt;br /&gt;
    door.open&lt;br /&gt;
&lt;br /&gt;
on entry.end_touch_all:&lt;br /&gt;
    door.close&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ref gives an entity a script alias. &amp;lt;code&amp;gt;start_touch&amp;lt;/code&amp;gt; fires for an accepted occupant; &amp;lt;code&amp;gt;end_touch_all&amp;lt;/code&amp;gt; fires after the last occupant leaves. The door&amp;#039;s own &amp;lt;code&amp;gt;open&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;close&amp;lt;/code&amp;gt; outputs fire when its motion finishes.&lt;br /&gt;
&lt;br /&gt;
If you move the door under a group named &amp;lt;code&amp;gt;Building&amp;lt;/code&amp;gt;, update its match path to &amp;lt;code&amp;gt;Building/main_door&amp;lt;/code&amp;gt;. A wildcard such as &amp;lt;code&amp;gt;Doors/Door*&amp;lt;/code&amp;gt; can target several doors, but reading a state or property requires exactly one match.&lt;br /&gt;
&lt;br /&gt;
== Server and client logic ==&lt;br /&gt;
&lt;br /&gt;
Gameplay handlers run on the server by default. Ambient audio is client presentation. Add an &amp;lt;code&amp;gt;env_ambient&amp;lt;/code&amp;gt; named &amp;lt;code&amp;gt;door_audio&amp;lt;/code&amp;gt;, choose a one-shot sound, and disable Play On Start. Add these lines to the door script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ref sound: env_ambient match door_audio&lt;br /&gt;
&lt;br /&gt;
client on door.open:&lt;br /&gt;
    sound.play&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The clients hear the sound when the door finishes opening. The compiler checks the authority of entity calls. Use the [[Grimwar/Entities|entity reference]] to check the contract before choosing a handler side.&lt;br /&gt;
&lt;br /&gt;
== Map and round events ==&lt;br /&gt;
&lt;br /&gt;
These global events do not need an entity:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Event !! Use&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;map.ready&amp;lt;/code&amp;gt; || Set up once map entities and required map scripts are ready.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;round.warmup&amp;lt;/code&amp;gt; || Apply warmup behavior.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;round.pre_round&amp;lt;/code&amp;gt; || Reset round state before play.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;round.live&amp;lt;/code&amp;gt; || Start live-round behavior.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;round.overtime&amp;lt;/code&amp;gt; || Handle overtime.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;round.post_round&amp;lt;/code&amp;gt; || Stop round tasks and show the result.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;round.intermission&amp;lt;/code&amp;gt; || Handle the interval between matches or rounds.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;gravewar.wave_started(wave: int, zombies: int)&amp;lt;/code&amp;gt; || React to a Gravewar wave starting.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;gravewar.wave_ended(wave: int, result: string)&amp;lt;/code&amp;gt; || React to a Gravewar wave ending.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;once on map.ready:&amp;lt;/code&amp;gt; for setup once per map load. Use round events for work that must repeat each round. They only fire when the running mode reaches that phase.&lt;br /&gt;
&lt;br /&gt;
== Delays and repeating work ==&lt;br /&gt;
&lt;br /&gt;
A wait pauses one chain. A named schedule lets you cancel pending work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
on round.pre_round:&lt;br /&gt;
    cancel open_gate&lt;br /&gt;
    door.close&lt;br /&gt;
&lt;br /&gt;
on round.live:&lt;br /&gt;
    schedule open_gate after 3s:&lt;br /&gt;
        door.open&lt;br /&gt;
&lt;br /&gt;
on round.post_round:&lt;br /&gt;
    cancel open_gate&lt;br /&gt;
    door.close&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This fragment uses the &amp;lt;code&amp;gt;door&amp;lt;/code&amp;gt; ref from the first example. For repeated actions, use &amp;lt;code&amp;gt;schedule pulse every 1s:&amp;lt;/code&amp;gt; and cancel it when its round or activity ends. Avoid comparing elapsed time with exact equality; use a one-shot schedule or indexed timer ticks. See [[Grimwar/VSig reference#Procedures, waits, and schedules|the schedule reference]].&lt;br /&gt;
&lt;br /&gt;
== Entity lifecycle and operational state ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;kill&amp;lt;/code&amp;gt; permanently removes an entity until the map reloads. Use an entity&amp;#039;s reversible action when that is what you need: &amp;lt;code&amp;gt;door.close&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;damageable.reset&amp;lt;/code&amp;gt;, or an operational entity&amp;#039;s &amp;lt;code&amp;gt;disable&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Operational entities support enable, disable, toggle, enabled, disabled, and is_enabled. The meaning of disabled depends on the type; it does not remove the entity from the map. See [[Grimwar/VSig reference#Entity lifecycle and operational state|the lifecycle reference]].&lt;br /&gt;
&lt;br /&gt;
== Activator, caller, and self ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;!activator&amp;lt;/code&amp;gt; identifies what began a signal chain, such as a touching participant. &amp;lt;code&amp;gt;!caller&amp;lt;/code&amp;gt; identifies the entity that made the current call, and &amp;lt;code&amp;gt;!self&amp;lt;/code&amp;gt; identifies the current entity. These values travel with that execution, including delayed work.&lt;br /&gt;
&lt;br /&gt;
They do not provide arbitrary access to game objects or permission to kill a player. Use [[Grimwar/VSig reference#Activator, caller, and self|the context reference]] for supported procedural calls.&lt;br /&gt;
&lt;br /&gt;
== Reuse an assembly ==&lt;br /&gt;
&lt;br /&gt;
Put reusable modules in local &amp;lt;code&amp;gt;.vsiglib&amp;lt;/code&amp;gt; files, or use a &amp;lt;code&amp;gt;logic_script&amp;lt;/code&amp;gt; host that selects a library and module. Hierarchy binding lets each placed assembly find its own child entities.&lt;br /&gt;
&lt;br /&gt;
Grimwar&amp;#039;s spawn-door prefabs already include a hierarchy-bound script host. Give its alias an explicit unique name if the map script needs to call it. See [[Grimwar/VSig reference#Spatial modules and logic_script|modules and script hosts]].&lt;br /&gt;
&lt;br /&gt;
== Signals shared with VMod ==&lt;br /&gt;
&lt;br /&gt;
Use a VMod when you need player services, server commands, persistent storage, or custom mode control. A VMod can subscribe to map signals and emit under its own &amp;lt;code&amp;gt;mod:&amp;amp;lt;mod-id&amp;amp;gt;&amp;lt;/code&amp;gt; alias. Clients do not execute VMod code.&lt;br /&gt;
&lt;br /&gt;
For an extraction zone, &amp;lt;code&amp;gt;trigger_multiple.execute&amp;lt;/code&amp;gt; emits &amp;lt;code&amp;gt;executed&amp;lt;/code&amp;gt; with a participant snapshot token. The subscribed VMod resolves it during that callback; the token expires when dispatch returns. See [[Grimwar/VMod reference#Send signals to VSig|the VMod example]].&lt;br /&gt;
&lt;br /&gt;
== Build and test ==&lt;br /&gt;
&lt;br /&gt;
Resolve the Code workspace diagnostics, save externally edited sources, and rebuild the map. Compilation embeds VSig in the scene. Test each route in Grimwar, including a second round and a map reload. A changed loose script beside the installed add-on does not replace the embedded program.&lt;br /&gt;
&lt;br /&gt;
[[Category:Grimwar]] [[Category:VSig]] [[Category:Mapping]]&lt;/div&gt;</summary>
		<author><name>DocumentationBot</name></author>
	</entry>
</feed>