Salut renof
Il existe plusieurs fonctions pour gèrer les stations ...
Voici un exemple type les utilisant :
Code: Select all
Version: 1
for Script Engine Version: 30
Description
Creation d'une station
Arguments
1: position , Var/Sector Position , 'Position'
2: type , Var/Station Type , 'Type Station'
3: race , Var/Race , 'Race'
4: nb , Var/Number , 'Nbre boucliers'
5: Produit , Var/Ware , 'Produit'
6: Ressource1 , Var/Ware , 'ressource1'
7: Ressource2 , Var/Ware , 'ressource2'
Source Text
001 $x = $position[0]
002 $y = $position[1]
003 $z = $position[2]
004 $secteur = $position[3]
005 $station = create station: type=$type owner=$race addto=$secteur x=$x y=$y z=$z
006 $station -> add product to factory or dock: $Produit
007 $station -> add primary resource to factory: $Ressource1
008 $station -> add secondary resource to factory: $Ressource2
009 $shield = $station -> install $nb units of Bouclier 125 MJ
010 $station -> station trade and production tasks: on=[TRUE]
Une station peux avoir plusieurs produits
Tu n'es pas obliger de déclarer de ressources secondaires pour les usines
Pour un dock tu déclares tous les produits que tu veux qu'il commerce.
La ligne 10 est là pour démarrer la production, sinon la station reste inerte.
tu peux aussi utiliser les fonctions :
Code: Select all
$station -> remove product from factory or dock: $Produit
$station -> remove primary resource from factory: $Ressource1
$station -> remove secondary resource from factory: $Ressource1
Je te conseille de télécharger le MSCI Programmers Handbook dans la partie download/X2/Bonus matériel :
http://www.egosoft.com/download/x2/bonus_fr.php
98% des fonctions X2 sont identiques sur X3
Voilà
Bon script
