Création d'une pièce avec animation
Disons que vous avez créé une pièce (Room) et que vous voudriez y ajouter une animation...une étoile qui brille...une chute en cascade...il vous faut au préalable les images transparentes qui constitueront votre animation. Paint Shop Pro peut créer des images transparentes. Créez-vous une porte et dans "Door Info...Edit Pictures" insérez vos images en cliquant sur "Add" (n'oubliez pas qu'elles devront se trouver dans le répertoire "Communities.com\PalaceServer\palace\media")...Pour les sauvegarder...cliquez sur "Save" et déplacez votre porte à l'endroit où vous désirez que l'animation prenne effet...Dans "Edit Script" tapez:
ON ENTER
{
1000 ME SETALARM
}
ON ALARM
{ { 0 ME SETSPOTSTATELOCAL }
{ ME GETSPOTSTATE 1 + ME SETSPOTSTATELOCAL }
ME GETSPOTSTATE 1 > IFELSE
1000 ME SETALARM
}
Le chiffre 1000 dans "ME SET ALARM"est la vitesse...mettez 10 si vous désirez que l'animation soit plus rapide...ensuite dans le cadre "Type"...changez pour "Normal"...cliquez "Ok"...Operator...Authoring Mode".
Pour obtenir les images qui serviront pour ce script...téléchargez
image.zip que vous devrez décompresser dans le répertoire "Communities.com\PalaceServer\palace\media".En voici un autre qui produit comme effet des éclairs et du tonnerre:
Mettez-vous en mode God et créez une nouvelle pièce en cliquant sur "Operator...New Room"...ensuite dans "Operator...Authoring Mode"...créez une "New Door"...et dans "Door Info...Edit Script"...inscrivez ceci:
ON ENTER { "Dites on pour déclancher l'orage et off pour l'arrêter...!" LOCALMSG
"Say on to turn the Lightning on, say off to turn the Lightning off" LOGMSG
}
ON OUTCHAT { { 0 ME SETSPOTSTATELOCAL light GLOBAL "off" light = } CHATSTR "off" == IF
{ 0 ME SETSPOTSTATELOCAL light GLOBAL "on" light = 15 ME SETALARM } CHATSTR "on" == IF
}
ON ALARM { { [ "thund1" "thund2" "thund3" "thund4" ] 4 RANDOM GET SOUND
0 i =
10 RANDOM nfr =
nfr ++
{
{ 2 ME SETSPOTSTATELOCAL }
{ 1 ME SETSPOTSTATELOCAL } ME GETSPOTSTATE 1 == IFELSE
i ++
} { i nfr < } WHILE
0 ME SETSPOTSTATELOCAL 2400 RANDOM ME SETALARM } light GLOBAL "on" light == IF
}
Ensuite dans "Door Info...Edit Pictures"... cliquez sur "Add" et ajoutez none.gif...lghtlsm1.gif...lghtlsm2.gif. Pour les sauvegarder...cliquez sur "Save". Dans "Type"...mettez "Normal".
Créez une deuxième "New Door" en procédant de la même façon que la première et inscrivez ceci:
ON OUTCHAT { { 0 ME SETSPOTSTATELOCAL light GLOBAL "off" light = "L'orage est terminé" STATUSMSG } CHATSTR "off" == IF
{ 0 ME SETSPOTSTATELOCAL light GLOBAL "on" light = 15 ME SETALARM "L'orage débute" STATUSMSG } CHATSTR "on" == IF
}
ON ALARM { { [ "thund1" "thund2" "thund3" "thund4" ] 4 RANDOM GET SOUND
0 i =
10 RANDOM nfr =
nfr ++
{
{ 2 ME SETSPOTSTATELOCAL }
{ 1 ME SETSPOTSTATELOCAL } ME GETSPOTSTATE 1 == IFELSE
i ++
} { i nfr < } WHILE
0 ME SETSPOTSTATELOCAL 2400 RANDOM ME SETALARM } light GLOBAL "on" light == IF
; Sounds
; "thund1.wav-*"
; "thund2.wav-*"
; "thund3.wav-*"
; "thund4.wav-*"
}
ON LEAVE {
{ CLEARLOOSEPROPS PAINTCLEAR } NBRROOMUSERS 2 < IF
}
Ensuite dans "Door Info...Edit Pictures" cliquez sur "Add" et ajoutez none.gif...lghtngr1.gif...lghtngr2.gif. Pour les sauvegarder...cliquez sur "Save". Dans "Type"...mettez "Normal".
Pour obtenir les images et les waves qui serviront pour ce script...téléchargez image2 que vous devrez décompresser dans le répertoire "Communities.com\PalaceServer\palace\media".
Un autre petit script utile pour produire une animation:
ON SELECT
{
10 ME SETALARM
}
ON ALARM
{ { 0 ME SETSPOTSTATELOCAL }
{ ME GETSPOTSTATE 1 + ME SETSPOTSTATELOCAL }
ME GETSPOTSTATE 13 > IFELSE
5 ME SETALARM
}
Le chiffre 13 (Facultatif) est le nombre de gif qui servira pour l'animation et le 5 est la vitesse de l'animation qui peut être variable selon votre choix.