Page 1 sur 1

[SCRIPT] Comment ne plus pouvoir sortir d'une carte selon des conditions ?

Posté : sam. 19 juil. 2014, 11:36
par Cocrane
Il me semble que pendant un combat, on peut quitter une pièce si tout le monde est réuni.

J'ai besoin que pendant un combat:
- suite au lancement d'un sort ennemi, la porte soit fermée, pendant un certain temps.
- si le groupe essaie de sortir, un message signale qu'un sort bloque l'ouverture de la porte.

Cocrane

Posté : sam. 19 juil. 2014, 11:53
par Haplo74
Bonjour,

Avec stratagem, la liche des portes de la ville est soumise à ce genre de contraintes. Tu pourrais chercher dans cette direction ?!

Il me semble également qu'on ne peut pas sortir du temple de Bhaal pendant le combat contre Sarevok et ses acolytes (toujours avec stratagem), même si personnellement je n'ai jamais tenté d'exécuter ce retrait.

Haplo74

Posté : sam. 19 juil. 2014, 21:10
par Kev
Haplo74 a raison, il y a un script dans stratagem appelé ar0082.baf, qui commande à l'activation d'un nouveau trigger ajouté sur la map, empêchant le groupe de sortir une fois le combat commencé (c'est vicieux quand même, surtout dans un si petit espace):

Code : Tout sélectionner

IF
	Global("DMWWLichDoor","GLOBAL",0)
	OR(6)
		InMyArea(Player1)
		InMyArea(Player2)
		InMyArea(Player3)
		InMyArea(Player4)
		InMyArea(Player5)
		InMyArea(Player6)

THEN
	RESPONSE #100
		SetGlobal("DMWWLichDoor","GLOBAL",1)
		SetGlobal("DMWWLichDoorTimer","GLOBAL",600)
		TriggerActivation("Tran0021",FALSE)
		TriggerActivation("DMWWFakeExit",TRUE)
END

IF
	!Global("DMWWLichDoor","GLOBAL",2)
	Dead("grvlch01")
THEN
	RESPONSE #100
		TriggerActivation("Tran0021",TRUE)
		TriggerActivation("DMWWFakeExit",FALSE)
		SetGlobal("DMWWLichDoor","GLOBAL",2)
END

IF
	Global("DMWWLichDoor","GLOBAL",1)
	!Dead("grvlch01")
	!InMyArea(Player1)
	!InMyArea(Player2)
	!InMyArea(Player3)
	!InMyArea(Player4)
	!InMyArea(Player5)
	!InMyArea(Player6)
THEN
	RESPONSE #100
		SetGlobal("DMWWLichDoor","GLOBAL",0)
		TriggerActivation("Tran0021",TRUE)
		TriggerActivation("DMWWFakeExit",FALSE)
END
Le trigger bloquant la sortie étant DMWWFakeExit. Ce script fait partie du composant "mage", ou tu trouveras aussi dans le mage.tpa, à partir de la ligne 291:

Code : Tout sélectionner

// Let the Crooked Crane lich bar the door
     OUTER_INNER_PATCH ~~ BEGIN SET lichstring=RESOLVE_STR_REF (@217) END

     MAKE_PATCH
        match=>"trigger_name=Tran0021"
        trigger_name=>DMWWFakeExit
        trigger_info=>~%lichstring%~
        trigger_type=>1
     END

     LAF edit_area STR_VAR area=ar0082 editstring=~clone_trigger=>patch_data~ END
     OUTER_SPRINT $patch_data(~match~) "trigger_name=Tran0082"
     LAF edit_area STR_VAR area=ar0021 editstring=~clone_trigger=>patch_data~ END

     ACTION_FOR_EACH area IN ar0021 ar0082 BEGIN
        LAF extend_area_script STR_VAR area bottom=~%area%~ location=resource END
     END

       COPY_EXISTING ~ppjon.bcs~ ~override~
              DECOMPILE_AND_PATCH BEGIN
              REPLACE_TEXTUALLY
              		       ~ForceSpell(Myself,DO_NOTHING)~
              		       ~ReallyForceSpell(Myself,WIZARD_STONE_SKIN)
              		       ReallyForceSpell(Myself,WIZARD_PROTECTION_FROM_MAGIC_ENERGY)
              		       ReallyForceSpell(Myself,WIZARD_PROTECTION_FROM_ELECTRICITY)
              		       SetGlobal("ChainContingencyFired","LOCALS",1)
			       DisplayStringHead(Myself,26328)
			       ReallyForceSpell(Myself,WIZARD_IMPROVED_MANTLE)
			       ReallyForceSpell(Myself,WIZARD_SPELL_TURNING)
			       ReallyForceSpell(Myself,WIZARD_SPELL_IMMUNITY_ABJURATION)
			       ForceSpell(Myself,DO_NOTHING)~
              END
Tu as besoin d'un DisplayStringHead() pour faire apparaitre un texte flottant au dessus de la tête de tes persos mais je pense que tu peux le placer dans un baf après un THEN RESPONSE #100.

Cette partie,

Code : Tout sélectionner

OUTER_INNER_PATCH ~~ BEGIN SET lichstring=RESOLVE_STR_REF (@217) END

     MAKE_PATCH
        match=>"trigger_name=Tran0021"
        trigger_name=>DMWWFakeExit
        trigger_info=>~%lichstring%~
        trigger_type=>1
     END

     LAF edit_area STR_VAR area=ar0082 editstring=~clone_trigger=>patch_data~ END
     OUTER_SPRINT $patch_data(~match~) "trigger_name=Tran0082"
     LAF edit_area STR_VAR area=ar0021 editstring=~clone_trigger=>patch_data~ END

     ACTION_FOR_EACH area IN ar0021 ar0082 BEGIN
        LAF extend_area_script STR_VAR area bottom=~%area%~ location=resource END
     END
doit être là, entre autre, pour éditer la map et créer le nouveau trigger, vu qu'a priori, stratagem ne contient pas de fichier.are 0082.

Si ta map est nouvelle, je pense que tu peux implanter ce trigger FakeExit avec DLCEP, plutôt qu'avec un tpa. En fait je sais pas trop comment ça marche, le mieux c'est de faire des essais, car en ce qui me concerne, la complexité du coddage de stratagems me dépasse un peu. (des tpa, des ssl, des tph et dieu sait quoi d'autre)

Posté : sam. 02 avr. 2016, 20:15
par Freddy_Gwendo
Je me rends compte que j'avais oublié de répondre à cette question. :$

Oublie stratagems et son langage SSL, développé par l'auteur pour créer des scripts, des fonctions et des routines WeiDU à partir de variables.

WeiDU est ton ami et fait ceci tout seul : ADD_AREA_REGION_TRIGGER !