Ciao a tutti, chi oggi non sa fare delle mod CLEO? Infatti andando sui siti web sul modding di GTA SA ne troverete a migliaia, ma non stiamo a parlare di siti web, oggi impareremo NOI come si fanno!
Tutto ciò di cui avete bisogno è Sanny Builder 3, scaricabile direttamente da qui, il programma serve per creare le CLEO per chi non lo sapesse.
Per i principianti aprire lo spoiler.
Spoiler
Apriamo Sanny Builder e all'inizio scriviamo:
{$CLEO .cs}
in questo modo diciamo a Sanny Builder che lo script di cui si tratta è una CLEO e non un SCM o altro...
adesso dobbiamo aggiungere un "punto di riferimento", sarebbero i ":nome" che indicano una parte dello script, senza di quelli non possiamo lavorare. Aggiungiamo:
{$CLEO .cs} :nome1
A questo punto devo insegnarvi che sono gli opcodes. Gli opcodes sono dei codici che indicano delle funzioni che svolge GTA SA (tipo per SA:MP: CreateVehicle(ecc...)) che però hanno dei numeretti davanti. Per sapere tutti gli opcodes esistenti premete CTRL + ALT + 2 (il 2 non dal numpad). Dalla nuova lista possiamo scorrere tutti gli opcodes, possiamo cercare per esempio create actor e ci trova la funzione per creare i pedoni, per esempio: il 009A: 2@ = create_actor_pedtype 4 model #MALE01 at 0.0 0.0 0.0 per sapere il pedtype dovete premere F12 e andare nella guida su SCM Documentation > GTA:SA > pedtypes. La guida vi servirà SEMPRE per fare le CLEO, non verrà un momento in cui non vi serva . Adesso iniziamo a scriptare, proviamo a spawnare un pedone davanti a noi, non c'è niente di più semplice! Aggiungiamo il nome del thread digitando l'opcode 03A4: name_thread 'NOMETHREAD'.
{$CLEO .cs} :nome1 name_thread 'NOMETHREAD'
Lasciamo una riga vuota e aggiungiamo un nuovo punto di riferimento:
{$CLEO .cs} :nome1 name_thread 'NOMETHREAD' :nome2
Adesso mettiamo il wait 0 ms, altrimenti il gioco crasherà. Al posto di 0 ms possiamo mettere per esempio 2000 ms per dire allo script di attendere 2000 ms.
{$CLEO .cs} :nome1 name_thread 'NOMETHREAD' :nome2 wait 0 ms
Adesso dobbiamo caricare il modello di CJ, quindi premete F12 per scorrere i modelli (ve l'avevo detto che vi serve sempre la guida ), per non affaticarvi il lavoro vi dico il modello di CJ, che è #NULL, quindi aggiungiamo l'opcode load_model (cercato da CTRL + ALT + 2)
{$CLEO .cs} :nome1 name_thread 'NOMETHREAD' :nome2 wait 0 ms 0247: load_model #NULL
Adesso vi spiego come funziona "if":
Utilizzando if and indichiamo 2 o più fattori che devono essere tutti ok.
Utilizzando if or indichiamo 2 o più fattori che ne basta uno che sia ok e va avanti.
Utilizzando if indichiamo 1 solo fattore che deve essere ok.
Aggiungiamo if and per indicare più fattori.
{$CLEO .cs} :nome1 name_thread 'NOMETHREAD' :nome2 wait 0 ms 0247: load_model #NULL if and 0256: player $PLAYER_CHAR defined //Se il giocatore è presente 0248: model #NULL available //Se il modello di CJ è disponibile 0AB0: key_pressed 78 //Se avete premuto il tasto N (guardate la guida)
adesso il jf che indica che se quei fattori non sono ok deve fare un "jump" a un punto di riferimento e funziona così: jf @punto (es. jf @nome2).
{$CLEO .cs} :nome1 name_thread 'NOMETHREAD' :nome2 wait 0 ms 0247: load_model #NULL if and 0256: player $PLAYER_CHAR defined //Se il giocatore è presente 0248: model #NULL available //Se il modello di CJ è disponibile 0AB0: key_pressed 78 //Se avete premuto il tasto N (guardate la guida) jf @nome2
Ora continuate a creare lo script e alla fine mettete uno jump altrimenti il gioco si bloccherà alla fine dello script.
{$CLEO .cs} :nome1 name_thread 'NOMETHREAD' :nome2 wait 0 ms 0247: load_model #NULL if and 0256: player $PLAYER_CHAR defined //Se il giocatore è presente 0248: model #NULL available //Se il modello di CJ è disponibile 0AB0: key_pressed 78 //Se avete premuto il tasto N (guardate la guida) jf @nome2 04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 2.0 0.0 //Imposta la coordinate del giocatore a una distanza di 2 metri davanti sulle variabili "1@ 2@ 3@" 009A: 0@ = create_actor_pedtype 8 model #NULL at 1@ 2@ 3@ //Crea il ped chiamato "0@" sulle variabili "1@ 2@ 3@" 0172: 4@ = actor $PLAYER_ACTOR Z_angle //Imposta la rotazione Z del giocatore nella variabile "4@" 0173: set_actor 0@ Z_angle_to 4@ //Imposta la rotazione Z del ped "0@" su "4@" 0001: wait 2000 ms //GTA San Andreas attende 2 secondi prima di eseguire il jump per iniziare lo script da capo. jump @nome2 //Esegue il jump all'inizio dello script, è MOLTO importante metterlo.
Adesso potete modificare lo script a vostro piacimento. Non vi dico altro perchè gli opcodes per esempio devono essere studiati autonomamente altrimenti non capirete un bel niente, fidatevi, non dico stronzate .
Messaggio modificato da Wesser il 16 settembre 2011 - 10:47