TUTO - Créer des po...
 
Notifications
Clear all

TUTO - Créer des points de Téléportation pour son serveur MOH:AA  

  RSS

axel68™
(@admin2693)
Sous-lieutenant Admin
Inscription: Il y a 9 mois
Posts: 102
17/07/2020 11:19  

Hello,

Voici la procédure pour créer des points de téléportation dans les maps.


1. En partant du fichier scr de la map Stalingrad par exemple (mohdm6.scr)


2. Voici le début du fichier

Spoiler
fichier scr d'origine

// STALINGRAD
// ARCHITECTURE: ZIED, POWZER
// SCRIPTING: POWZER

// **********************************************************************
// Extended-Gametype Mapscript Version 1.2.2 (05-14-05)
// By Mark Follett (Mefy)
// email: mef123@geocities.com
// web: www.planetmedalofhonor.com/mefy
// You are free to modify and redistribute as long as you keep these
// credits.
// **********************************************************************

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Stalingrad"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "mohdm6"

switch (waitthread global/libmef/util.scr::get_gametype)
{
case "ctf":
case "ftctf":
thread setup_randomized_ctf_bases
break

case "ft":
case "rbm":
waitthread global/libmef/spawn.scr::spawnblock_begin
break

case "dem":
case "ftdem":
waitthread setup_dem_bases
break
}

level waittill prespawn

//*** Precache Dm Stuff
exec global/DMprecache.scr

exec global/door_locked.scr::lock
level.script = maps/dm/mohdm6.scr
exec global/ambient.scr mohdm6

level waittill spawn

Dans cet exemple je vais placer deux téléporteurs. Après la ligne level waittill spawn je mets ceci:

thread port01
thread port02

Ce qui donne:

Spoiler
Lignes ajoutées après la ligne level waittill spawn

// STALINGRAD
// ARCHITECTURE: ZIED, POWZER
// SCRIPTING: POWZER

// **********************************************************************
// Extended-Gametype Mapscript Version 1.2.2 (05-14-05)
// By Mark Follett (Mefy)
// email: mef123@geocities.com
// web: www.planetmedalofhonor.com/mefy
// You are free to modify and redistribute as long as you keep these
// credits.
// **********************************************************************

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Stalingrad"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "mohdm6"

switch (waitthread global/libmef/util.scr::get_gametype)
{
case "ctf":
case "ftctf":
thread setup_randomized_ctf_bases
break

case "ft":
case "rbm":
waitthread global/libmef/spawn.scr::spawnblock_begin
break

case "dem":
case "ftdem":
waitthread setup_dem_bases
break
}

level waittill prespawn

//*** Precache Dm Stuff
exec global/DMprecache.scr

exec global/door_locked.scr::lock
level.script = maps/dm/mohdm6.scr
exec global/ambient.scr mohdm6

level waittill spawn

thread port01
thread port02

Allez à la fin du fichier scr et collez ceci:

Spoiler
Lignes ajoutées à la fin du fichier scr

port01:

local.portlight = spawn script_model
local.portlight model "static/corona_orange.tik"
local.portlight notsolid
local.portlight.origin = ( 5312.79 -1677.58 8.12 ) // starting point
local.portlight.scale = 1.5

local.trig = spawn trigger_multiple
local.trig targetname port01
local.trig.origin = ( 5312.79 -1677.58 8.12 ) // starting point
local.trig setsize ( -30 -30 0 ) ( 30 30 10 )
$port01 waittill trigger
local.p = parm.other
local.p tele ( 3673.48 -999.83 13.13 ) // destination
local.p.viewangles = ( 8.65 -107.36 0.00 )
local.portlight remove
$port01 remove
wait 2
thread port01
end

port02:

local.portlight = spawn script_model
local.portlight model "static/corona_orange.tik"
local.portlight notsolid
local.portlight.origin = ( 4842.44 -3624.67 8.12 ) // starting point
local.portlight.scale = 1.5

local.trig = spawn trigger_multiple
local.trig targetname port02
local.trig.origin = ( 4842.44 -3624.67 8.12 ) // starting point
local.trig setsize ( -30 -30 0 ) ( 30 30 10 )
$port02 waittill trigger
local.p = parm.other
local.p tele ( 2512.09 -2757.48 8.12 ) // destination
local.p.viewangles = ( 3.01 -35.12 0.00 )
local.portlight remove
$port02 remove
wait 2
thread port02
end

Vous pouvez ajouter autant de points de téléportation que vous le souhaitez, il suffira d'ajouter le thread port et le numéro de port à chaque fois.

Donc si j'en place un 3ème ça donne ceci après la ligne level waittill spawn:

thread port01
thread port02
thread port03

et à la fin du scr ceci (pensez à bien mettre le numéro de port à chaque fois -> en rouge):

port01:

local.portlight = spawn script_model
local.portlight model "static/corona_orange.tik"
local.portlight notsolid
local.portlight.origin = ( 5312.79 -1677.58 8.12 ) // starting point
local.portlight.scale = 1.5

local.trig = spawn trigger_multiple
local.trig targetname port01
local.trig.origin = ( 5312.79 -1677.58 8.12 ) // starting point
local.trig setsize ( -30 -30 0 ) ( 30 30 10 )
$port01 waittill trigger
local.p = parm.other
local.p tele ( 3673.48 -999.83 13.13 ) // destination
local.p.viewangles = ( 8.65 -107.36 0.00 )
local.portlight remove
$port01 remove
wait 2
thread port01
end

port02:

local.portlight = spawn script_model
local.portlight model "static/corona_orange.tik"
local.portlight notsolid
local.portlight.origin = ( 4842.44 -3624.67 8.12 ) // starting point
local.portlight.scale = 1.5

local.trig = spawn trigger_multiple
local.trig targetname port02
local.trig.origin = ( 4842.44 -3624.67 8.12 ) // starting point
local.trig setsize ( -30 -30 0 ) ( 30 30 10 )
$port02 waittill trigger
local.p = parm.other
local.p tele ( 2512.09 -2757.48 8.12 ) // destination
local.p.viewangles = ( 3.01 -35.12 0.00 )
local.portlight remove
$port02 remove
wait 2
thread port02
end

port03:

local.portlight = spawn script_model
local.portlight model "static/corona_orange.tik"
local.portlight notsolid
local.portlight.origin = ( 4842.44 -3624.67 8.12 ) // starting point
local.portlight.scale = 1.5

local.trig = spawn trigger_multiple
local.trig targetname port03
local.trig.origin = ( 4842.44 -3624.67 8.12 ) // starting point
local.trig setsize ( -30 -30 0 ) ( 30 30 10 )
$port03 waittill trigger
local.p = parm.other
local.p tele ( 2512.09 -2757.48 8.12 ) // destination
local.p.viewangles = ( 3.01 -35.12 0.00 )
local.portlight remove
$port03 remove
wait 2
thread port03
end


3. Trouver les coordonnées des points de téléportation:

Lancez la map Stalingrad en local.

Allez (avec votre joueur) à l'endroit précis de la map où vous souhaitez faire apparaitre le point de téléportation. Ouvrez la console avec ²

Tapez coord et faites ENTER.

Faites une capture d'écran (en principe avec F12).

Allez au point d'arrivée de votre téléporteur (tournez votre joueur dans la position/vue que vous souhaitez lui donner lorsqu'il est téléporté ici), ouvrez la console, tapez coord/Enter et faites une autre capture avec F12.

Vous venez de capturer les deux points que nous allons utiliser dans le script plus haut.


4. Inscrire les coordonnées de téléportation dans le fichier scr:

Voici les coordonnées de la première capture, vous placerez les coordonnées 5312.79 -16.77.58 8.12 tel quel dans les deux lignes starting point:

ExempleTeleport1

 

Ensuite la seconde capture pour le point d'arrivée (destination) et également les coordonnées de local.p.viewangles (c'est la vue qu'aura le joueur en arrivant à destination):

ExempleTeleport2

 

Si je prends cet exemple avec ce point de téléportation ça me donne ceci dans mon fichier mohdm6.scr complet (en rouge les changements inscrits dans le fichier et en bleu les coordonnées utilisées depuis les 2 captures d'écran) :

Spoiler
Contenu fichier scr complet

// REMAGEN
// ARCHITECTURE: STAGGER
// SCRIPTING: POWZER

// **********************************************************************
// Extended-Gametype Mapscript Version 1.2.2 (05-14-05)
// By Mark Follett (Mefy)
// email: mef123@geocities.com
// web: www.planetmedalofhonor.com/mefy
// You are free to modify and redistribute as long as you keep these
// credits.
// **********************************************************************

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Remagen"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "mohdm3"

switch (waitthread global/libmef/util.scr::get_gametype)
{
case "ctf":
case "ftctf":
case "dem":
case "ftdem":
waitthread setup_bases
break
}

level waittill prespawn

//*** Precache Dm Stuff
exec global/DMprecache.scr

level.script = maps/dm/mohdm3.scr
exec global/ambient.scr mohdm3

thread global/door_locked.scr::lock

level waittill spawn

thread port01

if (level.mef_baseversion == "sh" || level.mef_baseversion == "bt")
{
$world commanddelay 0 farclipoverride -1
}

end

//-----------------------------------------------------------------------------

setup_bases:
waitthread global/libmef/util.scr::read_gametype_settings

// common bases for dem and ctf
waitthread global/libmef/bases.scr::addbasepair "969 -1057 -71.88 -90 S: Euro Car" "3221 -2787 2.58 90 N: Delivery Truck" car deliverytruck
waitthread global/libmef/bases.scr::addbasepair "1514 -2663 0.13 90 SE: Clock Tower" "3875 -1199 16.13 180 NW: Library" indycrate librarytable
waitthread global/libmef/bases.scr::addbasepair "1887 -615 -5.88 -90 W: Gallery Radio Station" "2366 -2027 50 0 E: Gallery Power Box" radiostation powerpanel
waitthread global/libmef/bases.scr::addbasepair "1323 150 -63.88 -75 SW: Motorcycle" "3448 -3786 0.46 -8 NE: Mercedes" bmwbike mercedes
waitthread global/libmef/bases.scr::addbasepair "544 -1493 -51.26 180 S: Explosives Cache" "3747 -2309 8.13 -125 C: Explosives Cache" tntcrate tntcrate

// additional bases for ctf only
if (level.mef_gametype == "ctf" || level.mef_gametype == "ftctf")
{
waitthread global/libmef/bases.scr::addbasepair "783 -1027 -63.88 0" "3360 -2778 8.13 180"
}

// additional bases for dem only
if (level.mef_gametype == "dem" || level.mef_gametype == "ftdem")
{
waitthread global/libmef/bases.scr::addbasepair "1693 -1705 144.13 0 C: Gallery Dining Room" "2398 -1705 144.13 -180 C: Gallery Dining Room" voodoo voodoo

if (level.mef_deepbases)
{
waitthread global/libmef/bases.scr::addbasepair "711 -451 -68.89 -27 S: Halftrack" "5650 -2458 0.13 110 N: Halftrack" m3 sdkfz ( 1 333 0 )
waitthread global/libmef/bases.scr::addbasepair "758 418 214.13 -90 S: Radio" "5019 -3366 96.13 180 N: Enigma Device" radio enigma
}
}
end

port01:

local.portlight = spawn script_model
local.portlight model "static/corona_orange.tik"
local.portlight notsolid
local.portlight.origin = ( 5312.79 -1677.58 8.12 ) // starting point
local.portlight.scale = 1.5

local.trig = spawn trigger_multiple
local.trig targetname port01
local.trig.origin = ( 5312.79 -1677.58 8.12 ) // starting point
local.trig setsize ( -30 -30 0 ) ( 30 30 10 )
$port01 waittill trigger
local.p = parm.other
local.p tele ( 3673.48 -999.83 16.13 ) // destination
local.p.viewangles = ( 8.65 -107.36 0.00 )
local.portlight remove
$port01 remove
wait 2
thread port01
end


5. Il ne vous reste plus qu'à sauvegarder le fichier scr dans votre mod (dans cet exemple le fichier pk3 du Mod Melt Reward, dossier maps/dm/mohdm6.scr).


Ici un autre exemple complet (lignes modifiées dans le fichier scr en bleu) avec 6 téléporteurs pour la map Remagen (avec en rouge un exemple pour activer le Freeze Tag pour ceux que ça intéresse) :

Spoiler
Exemple map Remagen - 6 téléporteurs

// REMAGEN
// ARCHITECTURE: STAGGER
// SCRIPTING: POWZER

// **********************************************************************
// Extended-Gametype Mapscript Version 1.2.2 (05-14-05)
// By Mark Follett (Mefy)
// email: mef123@geocities.com
// web: www.planetmedalofhonor.com/mefy
// You are free to modify and redistribute as long as you keep these
// credits.
// **********************************************************************

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Remagen"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "mohdm3"

switch (waitthread global/libmef/util.scr::get_gametype)
{
case "ctf":
case "ftctf":
case "dem":
case "ftdem":
waitthread setup_bases
break
}

level waittill prespawn

//*** Precache Dm Stuff
exec global/DMprecache.scr

level.script = maps/dm/mohdm3.scr
exec global/ambient.scr mohdm3

thread global/door_locked.scr::lock

level waittill spawn

thread port01
thread port02
thread port03
thread port04
thread port05
thread port06

if (level.mef_baseversion == "sh" || level.mef_baseversion == "bt")
{
$world commanddelay 0 farclipoverride -1
}

end

//-----------------------------------------------------------------------------

setup_bases:
waitthread global/libmef/util.scr::read_gametype_settings

// common bases for dem and ctf
waitthread global/libmef/bases.scr::addbasepair "969 -1057 -71.88 -90 S: Euro Car" "3221 -2787 2.58 90 N: Delivery Truck" car deliverytruck
waitthread global/libmef/bases.scr::addbasepair "1514 -2663 0.13 90 SE: Clock Tower" "3875 -1199 16.13 180 NW: Library" indycrate librarytable
waitthread global/libmef/bases.scr::addbasepair "1887 -615 -5.88 -90 W: Gallery Radio Station" "2366 -2027 50 0 E: Gallery Power Box" radiostation powerpanel
waitthread global/libmef/bases.scr::addbasepair "1323 150 -63.88 -75 SW: Motorcycle" "3448 -3786 0.46 -8 NE: Mercedes" bmwbike mercedes
waitthread global/libmef/bases.scr::addbasepair "544 -1493 -51.26 180 S: Explosives Cache" "3747 -2309 8.13 -125 C: Explosives Cache" tntcrate tntcrate

// additional bases for ctf only
if (level.mef_gametype == "ctf" || level.mef_gametype == "ftctf")
{
waitthread global/libmef/bases.scr::addbasepair "783 -1027 -63.88 0" "3360 -2778 8.13 180"
}

// additional bases for dem only
if (level.mef_gametype == "dem" || level.mef_gametype == "ftdem")
{
waitthread global/libmef/bases.scr::addbasepair "1693 -1705 144.13 0 C: Gallery Dining Room" "2398 -1705 144.13 -180 C: Gallery Dining Room" voodoo voodoo

if (level.mef_deepbases)
{
waitthread global/libmef/bases.scr::addbasepair "711 -451 -68.89 -27 S: Halftrack" "5650 -2458 0.13 110 N: Halftrack" m3 sdkfz ( 1 333 0 )
waitthread global/libmef/bases.scr::addbasepair "758 418 214.13 -90 S: Radio" "5019 -3366 96.13 180 N: Enigma Device" radio enigma
}
}
end

port01:

local.portlight = spawn script_model
local.portlight model "static/corona_orange.tik"
local.portlight notsolid
local.portlight.origin = ( 5312.79 -1677.58 8.12 ) // starting point
local.portlight.scale = 1.5

local.trig = spawn trigger_multiple
local.trig targetname port01
local.trig.origin = ( 5312.79 -1677.58 8.12 ) // starting point
local.trig setsize ( -30 -30 0 ) ( 30 30 10 )
$port01 waittill trigger
local.p = parm.other
local.p tele ( 3673.48 -999.83 13.13 ) // destination
local.p.viewangles = ( 8.65 -107.36 0.00 )
local.portlight remove
$port01 remove
wait 2
thread port01
end

port02:

local.portlight = spawn script_model
local.portlight model "static/corona_orange.tik"
local.portlight notsolid
local.portlight.origin = ( 4842.44 -3624.67 8.12 ) // starting point
local.portlight.scale = 1.5

local.trig = spawn trigger_multiple
local.trig targetname port02
local.trig.origin = ( 4842.44 -3624.67 8.12 ) // starting point
local.trig setsize ( -30 -30 0 ) ( 30 30 10 )
$port02 waittill trigger
local.p = parm.other
local.p tele ( 2512.09 -2757.48 8.12 ) // destination
local.p.viewangles = ( 3.01 -35.12 0.00 )
local.portlight remove
$port02 remove
wait 2
thread port02
end

port03:

local.portlight = spawn script_model
local.portlight model "static/corona_orange.tik"
local.portlight notsolid
local.portlight.origin = ( 1537.39 71.37 -63.88 ) // starting point
local.portlight.scale = 1.5

local.trig = spawn trigger_multiple
local.trig targetname port03
local.trig.origin = ( 1537.39 71.37 -63.88 ) // starting point
local.trig setsize ( -30 -30 0 ) ( 30 30 10 )
$port03 waittill trigger
local.p = parm.other
local.p tele ( 2342.50 -410.98 -63.88 ) // destination
local.p.viewangles = ( 2.63 -95.56 0.00 )
local.portlight remove
$port03 remove
wait 2
thread port03
end

port04:

local.portlight = spawn script_model
local.portlight model "static/corona_orange.tik"
local.portlight notsolid
local.portlight.origin = ( 426.99 -605.11 -56.65 ) // starting point
local.portlight.scale = 1.5

local.trig = spawn trigger_multiple
local.trig targetname port04
local.trig.origin = ( 426.99 -605.11 -56.65 ) // starting point
local.trig setsize ( -30 -30 0 ) ( 30 30 10 )
$port04 waittill trigger
local.p = parm.other
local.p tele ( 1138.39 -2569.22 8.13 ) // destination
local.p.viewangles = ( 3.01 7.41 0.00 )
local.portlight remove
$port04 remove
wait 2
thread port04
end

port05:

local.portlight = spawn script_model
local.portlight model "static/corona_orange.tik"
local.portlight notsolid
local.portlight.origin = ( 3890.81 -2783.74 48.13 ) // starting point
local.portlight.scale = 1.5

local.trig = spawn trigger_multiple
local.trig targetname port05
local.trig.origin = ( 3890.81 -2783.74 48.13 ) // starting point
local.trig setsize ( -30 -30 0 ) ( 30 30 10 )
$port05 waittill trigger
local.p = parm.other
local.p tele ( 2286.66 -1860.49 -55.88 ) // destination
local.p.viewangles = ( 2.55 175.59 0.00 )
local.portlight remove
$port05 remove
wait 2
thread port05
end

port06:

local.portlight = spawn script_model
local.portlight model "static/corona_orange.tik"
local.portlight notsolid
local.portlight.origin = ( 2282.88 -1168.62 80.13 ) // starting point
local.portlight.scale = 1.5

local.trig = spawn trigger_multiple
local.trig targetname port06
local.trig.origin = ( 2282.88 -1168.62 80.13 ) // starting point
local.trig setsize ( -30 -30 0 ) ( 30 30 10 )
$port06 waittill trigger
local.p = parm.other
local.p tele ( 2216.55 -1628.88 144.13 ) // destination
local.p.viewangles = ( -0.38 -62.45 0.00 )
local.portlight remove
$port06 remove
wait 2
thread port06
end


Si vous avez des questions je suis là pour vous aider.

Enjoy 😉


Quote
Phab'
(@phabryss)
Major Moderator
Inscription: Il y a 9 mois
Posts: 79
17/07/2020 12:18  

Cool ce petit tuto Starry Eyes  

 

Nice Job Mr Axel Wink  


RépondreQuote
axel68™
(@admin2693)
Sous-lieutenant Admin
Inscription: Il y a 9 mois
Posts: 102
17/07/2020 12:43  

Merci Mister Phab, la question revient de temps en temps pour la téléportation et comme j'ai le temps avec les vacances je me suis lancé ^^

Hi


RépondreQuote