Difference between revisions of "Mod:Scripts"

From Wikipedia 2197
Jump to navigation Jump to search
(Created page with "This tutorial shows the basics of scripting in ''The Sum''. To code dialogues, it is best to Mod:Create_a_dialogue#Scripting dialogue (advanced)|follow th...")
 
m
 
(8 intermediate revisions by the same user not shown)
Line 14: Line 14:
  
 
=== Player ===
 
=== Player ===
Each entity (character or interactive object) is associated with a "player", whether controlled by the player or not. Each player is linked to a team, and several players can have the same team. There is an unlimited number of players.{{Idea|It is possible to assign special behaviors (AI) to each player, such as running away from the player.}}}In ''[[Wikipedia 2197|The Sum]]'', the basic players are:
+
Each entity (character or interactive object) is associated with a "player", whether controlled by the player or not. Each player is linked to a team, and several players can have the same team. There is an unlimited number of players.{{Idea|It is possible to assign special behaviors (AI) to each player, such as running away from the player.}}In ''[[Wikipedia 2197|The Sum]]'', the basic players are:
 
<ol start="0">
 
<ol start="0">
 
<li>'''Scenary :''' Everything that is part of the ''decor'' and does not have a particular behavior. '''Behavior:''' passive.</li>
 
<li>'''Scenary :''' Everything that is part of the ''decor'' and does not have a particular behavior. '''Behavior:''' passive.</li>
Line 40: Line 40:
 
A green area at the edges of a location that allows, when walking in the middle of it, to leave the current location to access the [[The Sum:Worldmap|Worldmap]].
 
A green area at the edges of a location that allows, when walking in the middle of it, to leave the current location to access the [[The Sum:Worldmap|Worldmap]].
  
== Créer un script ==
+
== Create a script ==
=== Ouvrir le fichier du lieu (éditeur de niveaux) ===
+
=== Open the location file (level editor) ===
# Ouvrez le dossier ''Game''/ puis '''FT Improver.EXE'''.{{Avertissement|Utiliser '''FT Tools.exe''' à la place résultera en une erreur.}}
+
# Open the folder ''Game''/ then ''FT Improver.EXE''.{{Warning|Use ''FT Tools.exe'' instead will result in an error.}}
# Passez les vidéos en cliquant dessus.
+
# Pass the videos by clicking on them.
# Cliquez sur {{Faux bouton|MORE|couleur=noir|bouton=oui}}.
+
# Click on {{False button|MORE|color=black|button=yes}}.
# Cliquez sur {{Faux bouton|LEVEL EDITOR|couleur=noir|bouton=oui}}.
+
# Click {{False button|LEVEL EDITOR|color=black|button=yes}}.
# Accédez au menu {{Faux bouton|File|couleur=gris|bordure=noir}} puis {{Faux bouton|Open|couleur=gris3}}.
+
# Navigate to the {{False button|File|color=gray|border=black}} menu then {{False button|Open|color=gray3}}.
# Ouvrez le fichier du lieu précédemment créé qui doit se terminer par '''.mis'''.
+
# Open the file of the place previously created which must end with '''.mis'''.
  
=== Accéder aux scripts ===
+
=== Accessing scripts ===
Les scripts sont stockés et codés dans l'[[Mod:Éditeurs#.C3.89diteur_de_niveaux_.28Level_editor.29|Éditeur de niveaux]].
+
Scripts are stored and coded in the [[Mod:Editors#Level_editor|Level Editor]].
# Cliquez sur l'onglet {{Faux bouton|Level|couleur=noir2}}.
+
# Click on the {{False button|Level|color=black2}} tab.
# Cliquez sur {{Faux bouton|Triggers...|couleur=gris|bordure=noir}} en bas à gauche.
+
# Click on the {{False button|Triggers...|color=gray|bord=black}} tab at the bottom left.
  
=== Ajouter un script ===
+
=== Add a script ===
Dans l'[[Mod:Éditeurs#.C3.89diteur_de_niveaux_.28Level_editor.29|Éditeur de niveaux]], un script est une série de '''conditions''' menant (si elles sont '''toutes''' vraies) à une série d''''actions'''. <font color="red">Attention: Il n'existe pas de "ou" (''or'') dans l'Éditeur</font>. Vous pouvez créer autant de scripts que nécessaire, mais ceux-ci ne fonctionnent que dans le lieu dans lequel ils ont été ajoutés.{{Idée|Pour chaque script, ajoutez une courte description qui est facile à comprendre (exemple: ''FUITE ENNEMIS - 1 mort)''.}}
+
In the[[Mod:Editors#Level_editor|Level Editor]], a script is a series of '''conditions''' leading (if they are '''all''' true) to a series of '''actions'''. <font color="red">Warning: There is no such thing as "or" (''or'') in the editor</font>. You can create as many scripts as you need, but they only work in the location in which they were added.{{Idea|For each script, add a short description that is easy to understand (example: ''ENEMY LEAK - 1 dead)''.}}
  
 
==== Conditions ====
 
==== Conditions ====
Il existe 20 conditions. Celles qui ne sont pas recommandées sont barrées.
+
There are 20 conditions. The ones that are not recommended to use are crossed out.
* '''Always:''' Condition par défaut, elle est toujours vraie. Pratique quand on veut produire une action qui démarre automatiquement, comme l'assignation de variables.
+
* '''Always:''' Default condition, it is always true. Useful when you want to produce an action that starts automatically, like assigning variables.
* '''Never:''' Elle est toujours fausse. Utile pour désactiver un script temporairement.
+
* '''Never:''' It is always false. Useful to disable a script temporarily.
* '''Speech Occured:''' Une fenêtre de dialogue au nom de code spécifié s'est ouverte. Peut être déclenchée par scripts en utilisant l'action ''Force Speech''.
+
* '''Speech Occured:''' A dialog window with the specified code name has opened. Can be triggered by scripts using the ''Force Speech'' action.
* '''Skill Use Occured:''' Un personnage au nom de code spécifié a utilisé une [[Compétence]].
+
* '''Skill Use Occured:''' A character with the specified code name has used a [[Skill]].
* '''Variable:''' Une variable spécifiée a une valeur déterminée.
+
* '''Variable:''' A specified variable has a specified value.
* '''Timer:''' Un compteur au nom de code spécifié a atteint une valeur déterminée.
+
* '''Timer:''' A timer with the specified code name has reached a specified value.
* '''Quantity - Team:''' Nombre d'éléments ('''<''' '''>''' ou '''=''') d'un même type d'une ''team'' spécifiée.
+
* '''Quantity - Team:''' Number of elements (''<''' '''>''' or '''=''') of the same type in a specified ''team''.
* '''Quantity - Player:''' Nombre d'éléments ('''<''' '''>''' ou '''=''') d'un même type d'un ''player'' spécifié.
+
* '''Quantity - Player:''' Number of elements ('''<''' '''>''' or '''=''') of the same type of a specified ''player''.
 
* '''Quantity - Player Kills:''' Comparaison, entre deux ''players'', du nombre de personnages tués.
 
* '''Quantity - Player Kills:''' Comparaison, entre deux ''players'', du nombre de personnages tués.
* '''Quantity - Unit:''' Nombre d'éléments ('''<''' '''>''' ou '''=''') d'un même type d'une entité spécifiée.
+
* '''Quantity - Unit:''' Number of elements ('''<''' '''>''' or '''=''') of the same type of a specified entity.
* '''Object Script State:''' État (activé ou non) d'un objet interactif, comme un interrupteur ou une porte.
+
* '''Object Script State:''' State ('''on''' or '''off''') of an interactive object, such as a switch or a door.
* <font color="grey"><s>'''WeaponMode is:''' Ces modes ne sont pas utilisés dans ''Nous Aurons''</s></font>
+
* <font color="grey"><s>'''WeaponMode is:''' These modes are not used in ''The Sum'</s></font>
* <font color="grey"><s>'''World mode of play is:''' Le mode de jeu de ''Nous Aurons'' est toujours ''CTB''.</s></font>
+
* <font color="grey"><s>'''World mode of play is:''' The game mode of ''The Sum'' is '''CTB''' by default.</s></font>
* '''Gui Open:''' Fenêtre ouverte par le joueur. '''Inv''' (Sac), <font color="grey"><s>'''Main'''</s></font>, '''Char''' (État), '''Loot''' (Fouille), '''Steal''' (Vol), '''Barter''' (Échange), '''Options''' (Options), '''Skilldex''' (Agir), '''Pipboy''' (GPSP) et <font color="grey"><s>'''Speech''' (Dialogue)</s></font>.
+
* '''Gui Open:''' Game window opened by the player. '''Inv''' (Bag), <font color="grey"><s>'''Main'''</s></font>, '''Char''' (Char), '''Loot''' (Scavenge), '''Steal''' (Steal), '''Barter''' (Exchange), '''Options''' (Options), '''Skilldex''' (Do), '''Pipboy''' (GPSP) and <font color="grey"><s>'''Speech''' (Dialogue)</s></font>.
* <font color="grey"><s>'''Right Click on Tab:''' Inutile.</s></font>
+
* <font color="grey"><s>'''Right Click on Tab:''' No use.</s></font>
* '''All Alive at Exit Grid:''' Vraie si tous les personnages encore vivants dans l'équipe du joueur sont dans des ''Exit Grid'', les zones vertes en bordure du lieu servant à atteindre la carte du jeu.
+
* ''All Alive at Exit Grid:'' True if all characters still alive in the player's team are present in an ''Exit Grid'', the green areas at the edge of the location used to reach the game map.
* '''Can See:''' Vraie si le personnage d'un ''player'' est capable d'en ''voir'' un d'un autre ''player''. Les personnages qui utilisent la Compétence ''Discrétion'' ne déclenchent pas cette condition.
+
* ''Can See:'' True if one ''player'' character is able to ''see'' one of another ''player'' characters. Characters who use the Skill ''Sneak'' do not trigger this condition.
* <font color="grey"><s>'''Brain Extraction Complete:''' Inutile.</s></font>
+
* <font color="grey"><s>'''Brain Extraction Complete:''' No use.</s></font>
* <font color="grey"><s>'''MP - Game Timed Out:''' ''Nous Aurons'' ne fonctionne pas en mode ''Multiplayer''.</s></font>
+
* <font color="grey"><s>'''MP - Game Timed Out:''' ''The Sum'' does not work in ''Multiplayer'' mode.</s></font>
* <font color="grey"><s>'''Main Actor Alive:''' Comme la partie s'arrête quand le personnage principal meurt, cette condition équivaut à ''Always''.</s></font>
+
* <font color="grey"><s>'''Main Actor Alive:''' Since the game ends when the main character dies, this condition is equivalent to ''Always''.</s></font>
  
 
==== Actions ====
 
==== Actions ====
Il existe 61 conditions. Celles qui ne sont pas recommandées sont barrées.
+
There are 61 actions. The ones that are not recommended are crossed out.
* '''Center view:''' Centre la vue sur une entité spécifiée. Le reste du temps, [[Nous_Aurons:À_propos/2#Vue|la vue peut être changée librement par le joueur]].
+
* '''Center view:''' Center the view on a specified entity. The rest of the time, [[The_Sum:About/2#View|The view can be changed freely by the player]].
* '''Player Retreat Zone:''' Assigne une ''Retreat Zone'' à un ''player'' (zone dans laquelle les personnages d'un ''player'' se rendront si gravement blessés).
+
* '''Player Retreat Zone:''' Assigns a ''Retreat Zone'' to a ''player'' (area where a ''player's'' characters will go if severely injured).
* '''Player Move State - Deactivate:''' Désactive un ''player''. Il disparaît.
+
* '''Player Move State - Deactivate:''' Deactivate a player. It disappears.
* '''Player Move State - Stationary:''' Hors combat, rend les personnages d'un ''player'' statiques. Si désactivés, ils apparaissent.
+
* '''Player Move State - Stationary:''' Out of combat, makes the characters of a ''player'' static. If disabled, they appear.
* '''Player Move State - Perimeter:''' Hors combat, assigne une zone à un ''player'' (zone dans laquelle les personnages essaient de rester).
+
* '''Player Move State - Perimeter:''' Out of combat, assigns a zone to a ''player'' (zone in which the characters try to stay).
* '''Player Move State - Wander:''' Hors combat, assigne une zone à un ''player'' (zone dans laquelle il erre).
+
* '''Player Move State - Wander:''' Out of combat, assigns a zone to a ''player'' (area in which he wanders).
* '''Player Move State - Follow:''' Hors combat, assigne le nom de code d'un personnage à un ''player''. Les personnages de ce ''player'' essaient de le suivre.
+
* '''Player Move State - Follow:''' Out of combat, assigns the code name of a character to a ''player''. The characters of this ''player'' try to follow them.
* '''Player Move State - WayPoint:''' Hors combat, assigne le premier ''WayPoint'' (index 0) d'un nom spécifié aux personnages d'un ''player''. Ils marcheront (dépendamment de leur ''Priority'') vers ce premier ''WayPoint'' puis d'autres ''WayPoints'' du même nom s'ils existent.{{Avertissement|Si le script est marqué comme {{Faux bouton|✔ Preserve|couleur=noir2}}, les personnages ne marcheront jamais au delà de l'index 0.}}
+
* '''Player Move State - WayPoint:''' Out of combat, assign the first ''WayPoint'' (index 0) of a specified name to the characters of a ''player''. They will walk (depending on their ''Priority'') to this first ''WayPoint'' and then other ''WayPoints'' of the same name if they exist.{{Warning|If the script is marked as {{False button|✔ Preserve|color=black2}}, the characters will never walk beyond the index 0.}}
* '''Player Move State - Flee:''' Donne l'ordre aux personnages d'un ''player'' de se sauver dans une zone spécifiée.
+
* '''Player Move State - Flee:''' Instructs the characters of a ''player'' to run away to a specified zone.
* '''Player Priority - Move State:''' Chance que les personnages d'un ''player'' se déplacent quand un script leur demande. À 10, ils abandonnent tout et se déplacent. Au dessus de 8, ils courent au lieu de marcher.
+
* '''Player Priority - Move State:''' Chance that the characters of a ''player'' move when a script asks them. At 10, they drop everything and move. Above 8, they run instead of walking.
* '''Player Priority - Aggression:''' Chance que les personnages d'un ''player'' en attaquent un autre quand un script leur demande.
+
* '''Player Priority - Aggression:''' Chance that the characters of a ''player'' attack another when a script asks them.
* '''Player Priority - Communication:''' Distance à laquelle les personnages d'un même ''player'' se rendent compte qu'un autre est attaqué. À 0, ils ne réagissent pas, à 10, ils ''communiquent'' sur toute la carte.
+
* '''Player Priority - Communication:''' Distance at which the characters of the same ''player'' realize that another is attacked. At 0, they do not react, at 10, they ''communicate'' on the whole map.
* '''Player Priority - Mobility:''' Hors combat, fréquence à laquelle les personnages d'un ''player'' se déplacent. À 1, ils arrêtent à chaque pas ou presque, à 10, ils sont toujours en mouvement.
+
* '''Player Priority - Mobility:''' Out of combat, how often the characters of a ''player'' move. At 1, they stop at every step or so, at 10, they are always moving.
* '''Player Priority - Kill Player:''' Chance que les personnages d'un ''player'' attaquent un autre ''player'' quand un script leur demande.
+
* '''Player Priority - Kill Player:''' Chance that the characters of a ''player'' attack another ''player'' when a script asks them.
* '''Player Priority - Kill Unit:''' Chance que les personnages d'un ''player'' attaquent une entité spécifiée quand un script leur demande.
+
* '''Player Priority - Kill Unit:''' Chance that the characters of a ''player'' attack a specified entity when a script asks them.
* '''Set Variable:''' Assigne une valeur (textuelle) à une variable. Il est possible de cocher l'option {{Faux bouton|Campaign|couleur=gris}} pour que la variable soit lue dans d'autres lieux.
+
* '''Set Variable:''' Assign a value (text) to a variable. It is possible to check the option {{False button|Campaign|color=gray}} so that the variable is read in other places.
* '''Set Timer:''' Détermine et démarre un compteur ascendant ou descendant (si la case {{Faux bouton|Decending|couleur=gris}} est cochée.{{Avertissement|Un compteur laissé en fonction peut parfois faire planter le jeu.}}
+
* '''Set Timer:''' Sets and starts an ascending or descending timer (if the {{False button|Decending|color=gray}} box is checked.{{Warning|A timer left running when exiting a location can sometimes make the game crash.}}
* '''Stop Timer:''' Arrête un compteur spécifié.
+
* '''Stop Timer:''' Stops a specified timer.
* '''Show Timer:''' Affiche un compteur spécifié en haut de l'écran, visible par le joueur.
+
* '''Show Timer:''' Show a specified timer at the top of the screen, visible to the player.
* '''Wait:''' Attend un nombre de secondes spécifiées avant d'accomplir les actions suivantes dans la liste.{{Avertissement|''Wait'' fonctionne uniquement quand la case {{Faux bouton|✔ Blocking|couleur=noir2}} est cochée dans les paramètres de l'action.}}
+
 
* '''Add Objective:''' Ajoute une tâche (parmi les entrées du fichier '''.txt''' du lieu) à la liste de tâches du joueur (écran '''GPSP'''). Si la case {{Faux bouton|with popup box|couleur=gris}} est cochée, une notification de tâche apparaît sur l'écran principal.
+
* '''Wait:''' Waits a specified number of seconds before performing the following actions in the list.{{Avertissement|''Wait'' works only when the {{False button|✔ Blocking|color=black2}} box is checked in the action settings.}}
* '''Complete Objective:''' Complète (change en gris) une tâche spécifiée (parmi les entrées du fichier '''.txt''' du lieu) à la liste de tâches du joueur (écran '''GPSP''').
+
* '''Add Objective:''' Adds a task (among the entries in the location ''.txt'' file) to the player's to-do list (screen ''GPSP''). If the {{False button|with popup box|color=gray}} box is checked, a task notification appears on the main screen.
* <font color="grey"><s>'''Set Death Text:''' Non utilisé.</s></font>  
+
* '''Complete Objective:''' Complete (changes to gray) a specified task (among the entries in the location's ''txt'' file) to the player's task list (screen ''GPSP'').
* '''End Mission:''' Quitte le jeu ({{Faux bouton|Main Menu|couleur=noir2}}), Rejoint la carte ({{Faux bouton|World Map|couleur=noir2}}), <font color="grey"><s>Tue le personnage principal ({{Faux bouton|Death Screen|couleur=noir2}}), mène à l'écran d'échec ({{Faux bouton|Fail Screen|couleur=noir2}}) ou de victoire ({{Faux bouton|Win Screen|couleur=noir2}}).</s></font>
+
* <font color="grey"><s>'''Set Death Text:''' Not used.</s></font>  
* '''Goto Mission:''' Déplace instantanément le joueur et tous ses personnages dans un lieu (spécifié par son nom de code).
+
* '''End Mission:''' Quit the game ({{Faux bouton|Main Menu|couleur=noir2}}), Open the [[Worldmap]] ({{Faux bouton|World Map|couleur=noir2}}), <font color="grey"><s>Kill the [[Main character|main character]] ({{Faux bouton|Death Screen|couleur=noir2}}), bring up the fail screen ({{Faux bouton|Fail Screen|couleur=noir2}}) or victory screen ({{Faux bouton|Win Screen|couleur=noir2}}).</s></font>
* <font color="grey"><s>'''Toggle Exit Grids:''' Les ''Exit Grids'' sont toujours fonctionnelles dans ''Nous Aurons''.</s></font>  
+
* '''Goto Mission:''' Instantly moves the player and all his characters to a location (specified by its code name).
* '''Set Click Speech:''' Assigne un dialogue (ajouté dans l'onglet {{Faux bouton|Level|couleur=noir2}} et bouton {{Faux bouton|Speech...|couleur=gris|bordure=noir}}) à une entité spécifiée. Celui-ci se déclenche quand le joueur clique dessus.{{Idée|Utiliser ''Set Click Speech'' sur une entité spécifiée avec le paramètre "None" enlève un dialogue déjà programmé.}}
+
* <font color="grey"><s>'''Toggle Exit Grids:''' The ''Exit Grids'' are always functional in ''The Sum''.</s></font>  
* '''Set Random Speech:''' Assigne un dialogue (ajouté dans l'onglet {{Faux bouton|Level|couleur=noir2}} et bouton {{Faux bouton|Speech...|couleur=gris|bordure=noir}}) flottant au dessus de la tête d'une entité spécifiée. Celui-ci s'affiche de temps en temps.{{Idée|Utiliser ''Set Random Speech'' sur une entité spécifiée avec le paramètre "None" enlève un dialogue déjà programmé.}}
+
* '''Set Click Speech:''' Assigns a dialogue (added in the tab {{Fake Button|Level|color=black2}} and button {{Fake Button|Speech...|color=gray|border=black}}) to a specified entity. This one is triggered when the player clicks on it.{{Idea|Using ''Set Click Speech'' on a specified entity with the parameter "None" removes a dialog already programmed.}}
* '''Play Wav:''' Fait jouer un fichier '''.wav''' du dossier ''Game/core/sound/''. Le {{Faux bouton|Sound Id|couleur=gris}} doit être unique. Si le nom de code d'une entité est spécifié, le son ne pourra être entendu qu'à proximité de cette entité.
+
* ''Set Random Speech:'' Assigns a dialogue (added in the tab {{False button|Level|color=black2}} and button {{False button|Speech...|color=gray|border=black}}) floating above the head of a specified entity. This one is displayed from time to time.{{Idea|Using ''Set Random Speech'' on a specified entity with the parameter "None" removes an already programmed dialog.}}
* '''Kill Entity:''' Tue instantanément une entité d'une manière spécifiée (''Normal'', ''Explode'', ''Cutinhalf'', ''Electrify'', ''Melt'', ''Fire'', ''Riddled'', ''Bighole'').
+
* '''Play Wav:''' Plays a ''.wav'' file from the ''Game/core/sound/'' folder. The {{False button|Sound Id|color=gray}} must be unique. If the code name of an entity is specified, the sound can only be heard near this entity.
* '''Set object script state:''' Actionne un objet interactif spécifié. Par exemple, si c'est une porte, il est possible de l'ouvrir ou de la fermer.
+
* '''Kill Entity:''' Instantly kill an entity in a specified way (''Normal'', ''Explode'', ''Cutinhalf'', ''Electrify'', ''Melt'', ''Fire'', ''Riddled'', ''Bighole'').
* '''Set Team Alignment Matrix:''' Détermine l'alignement d'une ''team''. Affecte tous les ''players'' de cette ''team''.
+
* '''Set object script state:''' Activates a specified interactive object. For example, if it is a door, it is possible to open or close it.
* '''Display World Text:''' Affiche un texte (parmi les entrées du fichier '''.txt''' du lieu) sous forme d'une fenêtre jaune au milieu de la page. La fenêtre interrompt le jeu, il faut appuyer sur {{Faux bouton|OK|couleur=blanc|bouton=oui}} pour continuer.
+
* '''Set Team Alignment Matrix:''' Determines the alignment of a ''team''. Affects all players of this team.
 +
* '''Display World Text:''' Displays a text (among the entries in the file ''.txt'' of the place) in the form of a yellow window in the middle of the page. The window interrupts the game, you must press {{False button|OK|color=white|button=yes}} to continue.
 
* <font color="grey"><s>'''Start Combat Mode:''' Le mode de jeu de ''Nous Aurons'' est toujours ''CTB''.</s></font>  
 
* <font color="grey"><s>'''Start Combat Mode:''' Le mode de jeu de ''Nous Aurons'' est toujours ''CTB''.</s></font>  
 
* <font color="grey"><s>'''Add Reputation:''' Utilisé par les scripts généraux pour déterminer l'électricité disponible.</s></font>  
 
* <font color="grey"><s>'''Add Reputation:''' Utilisé par les scripts généraux pour déterminer l'électricité disponible.</s></font>  
* '''Add Experience:''' Ajoute un nombre spécifié de [[Points d'Autonomie]] au personnage principal.
+
* '''Add Experience:''' Adds a specified number of [[Autonomy Points]] to the main character.
* '''Add Experience to Player:''' Ajoute un nombre spécifié de [[Points d'Autonomie]] à tous les personnages d'un ''player'' spécifié.
+
* '''Add Experience to Player:''' Adds a specified number of Autonomy Points to all characters in a specified player.
* '''Force Speech:''' Déclenche le dialogue (ajouté dans l'onglet {{Faux bouton|Level|couleur=noir2}} et bouton {{Faux bouton|Speech...|couleur=gris|bordure=noir}}) d'une entité spécifiée et centre automatiquement la vue dessus.{{Avertissement|Spécifier une entité inexistante fera planter le jeu.}}
+
* '''Force Speech:''' Triggers the dialog (added in the {{False button|Level|color=black2}} tab and {{False button|Speech...|color=gray|edge=black}} button) of a specified entity and automatically centers the view on it.{{Avertissement|Specifying a non-existent entity will make the game crash.}}
* '''Change Team:''' Change la ''team'' d'un ''player'' spécifié.
+
* '''Change Team:''' Change the "team" of a specified "player".
* '''Change Player:''' Change le ''player'' d'une entité (''Unit'') spécifiée.
+
* '''Change Player:''' Change the ''player'' of a specified ''Unit''.
* '''Move Unit:''' ''Téléporte'' une entité à un ''waypoint'' spécifié.{{Avertissement|Déplacer une entité inexistante fera planter le jeu.}}
+
* '''Move Unit:''' ''Teleport'' an entity to a specified waypoint.{{Warning|Moving a non-existent entity will make the game crash.}}
* '''Give Item to NPC:''' Fait passer un item au nom de code spécifié des personnages du joueur à un personnage au nom de code spécifié.{{Avertissement|Quand le joueur est trop loin, il ne se passe rien. Quand le personnage a déjà une copie de l'item, il ne se passe rien.}}
+
* '''Give Item to NPC:''' Passes an item with the specified code name from the player characters to a character with the specified code name.{{Warning|When the player is too far away, nothing happens. When the character already has a copy of the item, nothing happens}}
* '''Give Item from NPC to Human:''' Fait passer un item au nom de code spécifié d'un personnage au nom de code spécifié au joueur.{{Avertissement|Quand le personnage est trop loin, il ne se passe rien. Quand le joueur a déjà une copie de l'item, il ne se passe rien.}}
+
* '''Give Item from NPC to Human:''' Passes an item with a specified code name from a character to the player with a specified code name. {{Warning|When the character is too far away, nothing happens. When the player already has a copy of the item, nothing happens}}
* '''Lock/Unlock Door:''' Barre ({{Faux bouton|LockState|couleur=gris}} coché) ou débarre ({{Faux bouton|LockState|couleur=gris}} décoché) une porte au nom de code spécifié.
+
* '''Lock/Unlock Door:''' Lock ({{Faux bouton|LockState|couleur=gris}} coché) or unlock ({{Faux bouton|LockState|couleur=gris}} unchecked) a door with the specified code name.
* <font color="grey"><s>'''Jam/Unjam Minimap:''' Utilisé par les scripts généraux en fonction de l'électricité disponible.</s></font>  
+
* <font color="grey"><s>'''Jam/Unjam Minimap:''' Aready used by general scripts based on available electricity.</s></font>  
* '''Ping Minimap:''' Marque un emplacement spécifié (nom de code d'un ''waypoint'') dans la minicarte. Le joueur doit avoir assez d'électricité pour que ça fonctionne.
+
* '''Ping Minimap:''' Mark a specified location (code name of a ''waypoint'') in the minimap. The player must have enough portable electricity for this to work.
* <font color="grey"><s>'''Add text to Debrief text list:''' Utilisé seulement à la fin du jeu.</s></font>  
+
* <font color="grey"><s>'''Add text to Debrief text list:''' Used only at the end of the game.</s></font>  
* <font color="grey"><s>'''Display Debrief window and text:''' Utilisé seulement à la fin du jeu.</s></font>  
+
* <font color="grey"><s>'''Display Debrief window and text:''' Used only at the end of the game.</s></font>  
* '''Zone of death:''' Tue instantanément toutes les entités dans une zone spécifiée et d'une manière spécifiée (''Normal'', ''Explode'', ''Cutinhalf'', ''Electrify'', ''Melt'', ''Fire'', ''Riddled'', ''Bighole''). En cochant {{Faux bouton|Outside location|couleur=gris}}, il est possible de tuer toutes les entités à l'extérieur de la zone spécifiée.
+
* '''Zone of death:''' Instantly kills all entities in a specified zone and in a specified manner (''Normal'', ''Explode'', ''Cutinhalf'', ''Electrify'', ''Melt'', ''Fire'', ''Riddled'', ''Bighole''). By checking {{False button|Outside location|color=gray}}, it is possible to kill all entities outside the specified zone.
* '''Play Bink Movie:''' Démarre une vidéo '''.bik''' (créée avec [[Mod:Éditeurs#The_RAD_Video_Tools|The RAD Video Tools]]) et stockée dans ''Game/core/movie/''. L'{{Faux bouton|Archive Title Key|couleur=gris}} est un nom de code (ex:''movie_name_intro'') qui doit aussi être ajouté aux fichiers ''Game/core/locale/game/'''generic_mission.txt''''' et ''Game/NousAurons/locale/game/'''generic_mission.txt''''' sous "// NOM DES FILMS" de cette façon:<syntaxhighlight>
+
* '''Play Bink Movie:''' Start a ''.bik'' video (created with [[Mod:Editors#The_RAD_Video_Tools|The RAD Video Tools]]) and stored in ''Game/core/movie/''. The {{False button|Archive Title Key|color=gray}} is a code name (e.g.: ''movie_name_intro'') that must also be added to the files ''Game/core/locale/game/'''generic_mission.txt''''' and ''Game/NousAurons/locale/game/'''generic_mission.txt''''' under "// FILM NAME" in this way:<syntaxhighlight>
 
movie_name_intro = {Introduction}
 
movie_name_intro = {Introduction}
 
</syntaxhighlight>
 
</syntaxhighlight>
* '''Modify RecruitPool list:''' Appelle une action à appliquer à la liste des compagnons disponibles au joueur, à partir d'un nom de code présent dans ''Game/core/campaigns/'''campaign.txt'''''. Habituellement, l'action consiste à ajouter un personnage.
+
* '''Modify RecruitPool list:''' Calls an action to be applied to the list of companions available to the player, from a code name present in ''Game/core/campaigns/'''campaign.txt'''''. Usually, the action is to add a character.
* <font color="grey"><s>'''Add items to QuarterMaster list:''' Utilisé par les scripts généraux pour mettre des objets dans la glacière.</s></font>  
+
* <font color="grey"><s>'''Add items to QuarterMaster list:''' Used by general scripts to put items in the cooler.</s></font>  
* '''Set Mission State:''' Cache ({{Faux bouton|Covered|couleur=noir2}}), révèle ({{Faux bouton|UnCovered|couleur=noir2}}) ou indique l'emplacement ({{Faux bouton|Visited|couleur=noir2}}) d'un lieu spécifié.
+
* '''Set Mission State:''' Hides ({{Fake Button|Covered|color=black2}}), reveals ({{Fake Button|UnCovered|color=black2}}), or shows the location ({{Fake Button|Visited|color=black2}}) of a specified location on the [[Worldmap]]
* <font color="grey"><s>'''Open Mission:''' Utiliser plutôt {{Faux bouton|Set Mission State|couleur=noir2}}.</s></font>  
+
* <font color="grey"><s>'''Open Mission:''' Use {{False button|Set Mission State|color=black2}} instead.</s></font>  
* '''Mission Complete:''' Tourne un lieu (spécifié par son nom de code) en gris sur la [[Nous Aurons:Carte|carte]], ce qui l'indique comme visité.
+
* '''Mission Complete:''' Turns a location (specified by its code name) gray on the [[We'll:Map|Map]], indicating it as visited.
* '''Set Random Encounter Enable:''' Active ou désactive (cochez {{Faux bouton|Enabled to|couleur=noir2}} ou non) une rencontre aléatoire spécifiée.
+
* '''Set Random Encounter Enable:''' Enables or disables (check {{False button|Enabled to|color=black2}} or not) a specified random encounter.
* <font color="grey"><s>'''Brain Extraction:''' Inutile</s>
+
* <font color="grey"><s>'''Brain Extraction:''' Not used</s>
* <font color="grey"><s>'''MP - Team with the Most Wins:''' ''Nous Aurons'' ne fonctionne pas en mode ''Multiplayer''.</s></font>  
+
* <font color="grey"><s>'''MP - Team with the Most Wins:''' ''The Sum'' does not work in ''Multiplayer'' mode.</s></font>  
* <font color="grey"><s>'''MP - Team with the Least Wins:''' ''Nous Aurons'' ne fonctionne pas en mode ''Multiplayer''.</s></font>  
+
* <font color="grey"><s>'''MP - Team with the Least Wins:''' ''The Sum'' does not work in ''Multiplayer'' mode.</s></font>  
* <font color="grey"><s>'''MP - Team Meeting Condition Wins:''' ''Nous Aurons'' ne fonctionne pas en mode ''Multiplayer''.</s></font>  
+
* <font color="grey"><s>'''MP - Team Meeting Condition Wins:''' ''The Sum'' does not work in ''Multiplayer'' mode.</s></font>  
* <font color="grey"><s>'''MP - Team Victory:''' ''Nous Aurons'' ne fonctionne pas en mode ''Multiplayer''.</s></font>
+
* <font color="grey"><s>'''MP - Team Victory:''' ''The Sum'' does not work in ''Multiplayer'' mode.</s></font>{{Idea|Each set of actions can be executed only once, or each time the conditions are met. To do so, check {{False button|Preserve|color=black2}} to the right of {{False button|✔&nbsp;Conditions|color=black2}}{{False button|&nbsp;Actions|color=black2}}.}}
{{Idée|Chaque série d'actions peut être exécutée une seule fois, ou à chaque fois que les conditions sont remplies. Pour se faire, cochez {{Faux bouton|Preserve|couleur=noir2}} à droite de {{Faux bouton|✔&nbsp;Conditions|couleur=noir2}}{{Faux bouton|&nbsp;&nbsp;Actions|couleur=noir2}}.}}
 

Latest revision as of 23:56, 25 September 2022

This tutorial shows the basics of scripting in The Sum. To code dialogues, it is best to follow the steps in this tutorial.

Preview of the script page.

Outils requis[edit | edit source]

This tutorial uses mainly the Level editor.

Before You Begin[edit | edit source]

Please take some time to read the "Scripting" section of the readme file of the Fallout Tactics editor.

Terms to learn[edit | edit source]

Entity[edit | edit source]

Character (actor) and/or object, an entity is an interactive element of the game. Most of the scripts concern and affect entities.

Player[edit | edit source]

Each entity (character or interactive object) is associated with a "player", whether controlled by the player or not. Each player is linked to a team, and several players can have the same team. There is an unlimited number of players.

Bulb.png  It is possible to assign special behaviors (AI) to each player, such as running away from the player. 



In The Sum, the basic players are:

  1. Scenary : Everything that is part of the decor and does not have a particular behavior. Behavior: passive.
  2. Joueur : Any entity controlled by the player.
  3. Animaux : Animals on the map. Behavior: Friendly by default, hostile if the player skins an animal or has raw meat on them without bones to distract the animals.
  4. Humains : Various entities. Behavior: Neutral by default, hostile if injured in the presence of the player.
  5. Ennemis : Various entities. Behavior: Hostile by default, friendly under certain scripted circumstances.
  6. Amis : Various entities. Behavior: Friendly by default, hostile if injured in the presence of the player.
  7. Banque : Scripted Entities. Behavior: Never hostile.

Team[edit | edit source]

Each team determines the alignment (from hostile to friendly) of a player towards others teams. This alignment goes from -10 (complete hostility, red dot in the minimap) to 10 (complete friendliness, green dot in the minimap). 0 indicate the neutrality (gray dot in the minimap).

Quantity[edit | edit source]

Quantity refers to a large list of possible conditions for entities, pretty much everything that is part of their entity file (.ent) (e.g. Strength, Dexterity, Age, Sex, % of Life Points, Living or Dead, Perks, Electricity, etc.) can be checked (counted) in one of the conditions starting with: Quantity -.

Waypoint[edit | edit source]

A waypoint is an invisible marker added to a location with the Level_editor. Each waypoint has a code name and an index, and several waypoints can share the same name. It is possible to program a movement of characters by programming a series of waypoints.

Zone[edit | edit source]

Areas are rectangular prisms (with a width, length and height) with a unique code name in a location. Several conditions determine the presence or characteristics of entities in zones. They are created and used in the Level_editor.

Exit Grid[edit | edit source]

A green area at the edges of a location that allows, when walking in the middle of it, to leave the current location to access the Worldmap.

Create a script[edit | edit source]

Open the location file (level editor)[edit | edit source]

  1. Open the folder Game/ then FT Improver.EXE.
    Alert.png  Use FT Tools.exe instead will result in an error. 


  2. Pass the videos by clicking on them.
  3. Click on
    ⦿  MORE 
    .
  4. Click
    ⦿  LEVEL EDITOR 
    .
  5. Navigate to the
     File 
    menu then
     Open 
    .
  6. Open the file of the place previously created which must end with .mis.

Accessing scripts[edit | edit source]

Scripts are stored and coded in the Level Editor.

  1. Click on the
     Level 
    tab.
  2. Click on the
     Triggers... 
    tab at the bottom left.

Add a script[edit | edit source]

In theLevel Editor, a script is a series of conditions leading (if they are all true) to a series of actions. Warning: There is no such thing as "or" (or) in the editor. You can create as many scripts as you need, but they only work in the location in which they were added.

Bulb.png  For each script, add a short description that is easy to understand (example: ENEMY LEAK - 1 dead). 



Conditions[edit | edit source]

There are 20 conditions. The ones that are not recommended to use are crossed out.

  • Always: Default condition, it is always true. Useful when you want to produce an action that starts automatically, like assigning variables.
  • Never: It is always false. Useful to disable a script temporarily.
  • Speech Occured: A dialog window with the specified code name has opened. Can be triggered by scripts using the Force Speech action.
  • Skill Use Occured: A character with the specified code name has used a Skill.
  • Variable: A specified variable has a specified value.
  • Timer: A timer with the specified code name has reached a specified value.
  • Quantity - Team:' Number of elements (< > or =) of the same type in a specified team.
  • Quantity - Player: Number of elements (< > or =) of the same type of a specified player.
  • Quantity - Player Kills: Comparaison, entre deux players, du nombre de personnages tués.
  • Quantity - Unit: Number of elements (< > or =) of the same type of a specified entity.
  • Object Script State: State (on or off) of an interactive object, such as a switch or a door.
  • WeaponMode is: These modes are not used in The Sum'
  • World mode of play is: The game mode of The Sum is CTB by default.
  • Gui Open: Game window opened by the player. Inv (Bag), Main, Char (Char), Loot (Scavenge), Steal (Steal), Barter (Exchange), Options (Options), Skilldex (Do), Pipboy (GPSP) and Speech (Dialogue).
  • Right Click on Tab: No use.
  • All Alive at Exit Grid: True if all characters still alive in the player's team are present in an Exit Grid, the green areas at the edge of the location used to reach the game map.
  • Can See: True if one player character is able to see one of another player characters. Characters who use the Skill Sneak do not trigger this condition.
  • Brain Extraction Complete: No use.
  • MP - Game Timed Out: The Sum does not work in Multiplayer mode.
  • Main Actor Alive: Since the game ends when the main character dies, this condition is equivalent to Always.

Actions[edit | edit source]

There are 61 actions. The ones that are not recommended are crossed out.

  • Center view: Center the view on a specified entity. The rest of the time, The view can be changed freely by the player.
  • Player Retreat Zone: Assigns a Retreat Zone to a player (area where a player's characters will go if severely injured).
  • Player Move State - Deactivate: Deactivate a player. It disappears.
  • Player Move State - Stationary: Out of combat, makes the characters of a player static. If disabled, they appear.
  • Player Move State - Perimeter: Out of combat, assigns a zone to a player (zone in which the characters try to stay).
  • Player Move State - Wander: Out of combat, assigns a zone to a player (area in which he wanders).
  • Player Move State - Follow: Out of combat, assigns the code name of a character to a player. The characters of this player try to follow them.
  • Player Move State - WayPoint: Out of combat, assign the first WayPoint (index 0) of a specified name to the characters of a player. They will walk (depending on their Priority) to this first WayPoint and then other WayPoints of the same name if they exist.
    Alert.png  If the script is marked as
     ✔ Preserve 
    , the characters will never walk beyond the index 0.
     


  • Player Move State - Flee: Instructs the characters of a player to run away to a specified zone.
  • Player Priority - Move State: Chance that the characters of a player move when a script asks them. At 10, they drop everything and move. Above 8, they run instead of walking.
  • Player Priority - Aggression: Chance that the characters of a player attack another when a script asks them.
  • Player Priority - Communication: Distance at which the characters of the same player realize that another is attacked. At 0, they do not react, at 10, they communicate on the whole map.
  • Player Priority - Mobility: Out of combat, how often the characters of a player move. At 1, they stop at every step or so, at 10, they are always moving.
  • Player Priority - Kill Player: Chance that the characters of a player attack another player when a script asks them.
  • Player Priority - Kill Unit: Chance that the characters of a player attack a specified entity when a script asks them.
  • Set Variable: Assign a value (text) to a variable. It is possible to check the option
     Campaign 
    so that the variable is read in other places.
  • Set Timer: Sets and starts an ascending or descending timer (if the
     Decending 
    box is checked.
    Alert.png  A timer left running when exiting a location can sometimes make the game crash. 


  • Stop Timer: Stops a specified timer.
  • Show Timer: Show a specified timer at the top of the screen, visible to the player.
  • Wait: Waits a specified number of seconds before performing the following actions in the list.
    Alert.png  Wait works only when the
     ✔ Blocking 
    box is checked in the action settings.
     


  • Add Objective: Adds a task (among the entries in the location .txt file) to the player's to-do list (screen GPSP). If the
     with popup box 
    box is checked, a task notification appears on the main screen.
  • Complete Objective: Complete (changes to gray) a specified task (among the entries in the location's txt file) to the player's task list (screen GPSP).
  • Set Death Text: Not used.
  • End Mission: Quit the game (
     Main Menu 
    ), Open the Worldmap (
     World Map 
    ), Kill the main character (
     Death Screen 
    ), bring up the fail screen (
     Fail Screen 
    ) or victory screen (
     Win Screen 
    ).
  • Goto Mission: Instantly moves the player and all his characters to a location (specified by its code name).
  • Toggle Exit Grids: The Exit Grids are always functional in The Sum.
  • Set Click Speech: Assigns a dialogue (added in the tab Template:Fake Button and button Template:Fake Button) to a specified entity. This one is triggered when the player clicks on it.
    Bulb.png  Using Set Click Speech on a specified entity with the parameter "None" removes a dialog already programmed. 


  • Set Random Speech: Assigns a dialogue (added in the tab
     Level 
    and button
     Speech... 
    ) floating above the head of a specified entity. This one is displayed from time to time.
    Bulb.png  Using Set Random Speech on a specified entity with the parameter "None" removes an already programmed dialog. 


  • Play Wav: Plays a .wav file from the Game/core/sound/ folder. The
     Sound Id 
    must be unique. If the code name of an entity is specified, the sound can only be heard near this entity.
  • Kill Entity: Instantly kill an entity in a specified way (Normal, Explode, Cutinhalf, Electrify, Melt, Fire, Riddled, Bighole).
  • Set object script state: Activates a specified interactive object. For example, if it is a door, it is possible to open or close it.
  • Set Team Alignment Matrix: Determines the alignment of a team. Affects all players of this team.
  • Display World Text: Displays a text (among the entries in the file .txt of the place) in the form of a yellow window in the middle of the page. The window interrupts the game, you must press
    ⦿  OK 
    to continue.
  • Start Combat Mode: Le mode de jeu de Nous Aurons est toujours CTB.
  • Add Reputation: Utilisé par les scripts généraux pour déterminer l'électricité disponible.
  • Add Experience: Adds a specified number of Autonomy Points to the main character.
  • Add Experience to Player: Adds a specified number of Autonomy Points to all characters in a specified player.
  • Force Speech: Triggers the dialog (added in the
     Level 
    tab and
     Speech... 
    button) of a specified entity and automatically centers the view on it.
    Alert.png  Specifying a non-existent entity will make the game crash. 


  • Change Team: Change the "team" of a specified "player".
  • Change Player: Change the player of a specified Unit.
  • Move Unit: Teleport an entity to a specified waypoint.
    Alert.png  Moving a non-existent entity will make the game crash. 


  • Give Item to NPC: Passes an item with the specified code name from the player characters to a character with the specified code name.
    Alert.png  When the player is too far away, nothing happens. When the character already has a copy of the item, nothing happens 


  • Give Item from NPC to Human: Passes an item with a specified code name from a character to the player with a specified code name.
    Alert.png  When the character is too far away, nothing happens. When the player already has a copy of the item, nothing happens 


  • Lock/Unlock Door: Lock (
     LockState 
    coché) or unlock (
     LockState 
    unchecked) a door with the specified code name.
  • Jam/Unjam Minimap: Aready used by general scripts based on available electricity.
  • Ping Minimap: Mark a specified location (code name of a waypoint) in the minimap. The player must have enough portable electricity for this to work.
  • Add text to Debrief text list: Used only at the end of the game.
  • Display Debrief window and text: Used only at the end of the game.
  • Zone of death: Instantly kills all entities in a specified zone and in a specified manner (Normal, Explode, Cutinhalf, Electrify, Melt, Fire, Riddled, Bighole). By checking
     Outside location 
    , it is possible to kill all entities outside the specified zone.
  • Play Bink Movie: Start a .bik video (created with The RAD Video Tools) and stored in Game/core/movie/. The
     Archive Title Key 
    is a code name (e.g.: movie_name_intro) that must also be added to the files Game/core/locale/game/generic_mission.txt and Game/NousAurons/locale/game/generic_mission.txt under "// FILM NAME" in this way:
    movie_name_intro = {Introduction}
  • Modify RecruitPool list: Calls an action to be applied to the list of companions available to the player, from a code name present in Game/core/campaigns/campaign.txt. Usually, the action is to add a character.
  • Add items to QuarterMaster list: Used by general scripts to put items in the cooler.
  • Set Mission State: Hides (Template:Fake Button), reveals (Template:Fake Button), or shows the location (Template:Fake Button) of a specified location on the Worldmap
  • Open Mission: Use
     Set Mission State 
    instead.
  • Mission Complete: Turns a location (specified by its code name) gray on the Map, indicating it as visited.
  • Set Random Encounter Enable: Enables or disables (check
     Enabled to 
    or not) a specified random encounter.
  • Brain Extraction: Not used
  • MP - Team with the Most Wins: The Sum does not work in Multiplayer mode.
  • MP - Team with the Least Wins: The Sum does not work in Multiplayer mode.
  • MP - Team Meeting Condition Wins: The Sum does not work in Multiplayer mode.
  • MP - Team Victory: The Sum does not work in Multiplayer mode.
    Bulb.png  Each set of actions can be executed only once, or each time the conditions are met. To do so, check
     Preserve 
    to the right of
     ✔ Conditions 
      Actions 
    .