J'aurai aimé connaitre le langage des script (lua? c++? ou autre?)
J'essai de comprendre le script du mod : AmmoWeight
(celui qui permet de calculer le poids des munitions)
Voila l'original:
Code : Tout sélectionner
scn AmmoWeightScript
Short AWC
Begin GameMode
set AT to Player.GetItemCount AmmoDart
set AT to (AT + Player.GetItemCount AmmoBB)
set AT to (AT + Player.GetItemCount Ammo5mm)
set AWC to AT
set AT to Player.GetItemCount Ammo10mm
set AT to (AT + Player.GetItemCount Ammo32Caliber)
set AT to (AT + Player.GetItemCount AmmoElectronChargePack)
set AT to (AT + Player.GetItemCount AmmoSmallEnergyCell)
set AT to (AT + Player.GetItemCount AmmoAlienPowerCell)
set AT to (AT*3)
set AWC to (AWC + AT)
set AT to Player.GetItemCount AmmoRailwaySpikes
set AT to (AT + Player.GetItemCount Ammo44magnum)
set AT to (AT + Player.GetItemCount Ammo308Caliber)
set AT to (AT + Player.GetItemCount Ammo556mm)
set AT to (AT + Player.GetItemCount AmmoMicroFusionCell)
set AT to (AT + Player.GetItemCount AmmoFlamerFuel)
set AT to (AT*5)
set AWC to (AWC + AT)
set AT to Player.GetItemCount AmmoShotgunShell
set AT to (AT + Player.GetItemCount AmmoMesmetronPowerCell)
set AT to (AT*10)
set AWC to (AWC + AT)
set AT to Player.GetItemCount AmmoMissile
set AT to (AT*100)
set AWC to (AWC + AT)
set AT to Player.GetItemCount ammoFatMan
set AT to (AT*300)
set AWC to (AWC + AT)
if AWC > (Player.GetItemCount AmmoWeightCounter)
set AWC to (AWC - Player.GetItemCount AmmoWeightCounter)
Player.AddItem AmmoWeightCounter AWC 1
elseif AWC < (Player.GetItemCount AmmoWeightCounter)
set AWC to (Player.GetItemCount AmmoWeightCounter - AWC)
Player.RemoveItem AmmoWeightCounter AWC 1
endif
End
Ce que j'aimerai faire c'est ça:
Code : Tout sélectionner
scn AmmoWeightScript
Short AWC
Begin GameMode
set AWC to (Player.GetItemCount AmmoDart)*1
set AWC to (AWC + (Player.GetItemCount AmmoBB)*1)
set AWC to (AWC + (Player.GetItemCount Ammo5mm)*2)
set AWC to (AWC + (Player.GetItemCount Ammo10mm)*3)
set AWC to (AWC + (Player.GetItemCount Ammo32Caliber)*4)
set AWC to (AWC + (Player.GetItemCount AmmoElectronChargePack)*4)
...etc...
set AWC to (AWC + (Player.GetItemCount ammoFatMan)*16)
if AWC > (Player.GetItemCount AmmoWeightCounter)
set AWC to (AWC - Player.GetItemCount AmmoWeightCounter)
Player.AddItem AmmoWeightCounter AWC 1
elseif AWC < (Player.GetItemCount AmmoWeightCounter)
set AWC to (Player.GetItemCount AmmoWeightCounter - AWC)
Player.RemoveItem AmmoWeightCounter AWC 1
endif
End
qui a un poids de 0.01 donc si j'ai bien pigé, le poids indiqué sera de :
AmmoWeightCounter*AWC ( si AWC = 200, alors 0.01*200=2 lb)
par contre je comprends pas cette formulation:
Player.AddItem AmmoWeightCounter AWC 1
Player -> joueur
AddItem -> ajoute l'objet au "Player"
AmmoWeightCounter -> est l'objet à ajouter
AWC -> est la quantité
1 -> ????
Pourquoi? comme ça c'est facile de rajouter les ammo que l'on veux et avec des poids unitaire personnalisé.
C'est possible? ou bof...