![]() |
Benvenuto Visitatore(Log In|Registrati)
![]() ![]() |
![]() |
![]()
Messaggio
#51
|
|
Gruppo: Gamer Messaggi: 83 Iscritto il: 8 November 14 Utente Nr.: 20.571 SO Windows7 ![]() |
Dunque la funzione move player comunque mi va O.o
Allora ecco qui con i commenti: function hLuce_AnyClick() { if(UsedAction(eGA_LookAt)) { player.Say("L'interrutore della luce."); } else if(UsedAction(eGA_Use)) { MovePlayer(20, 167); // Qui imposto il cambio background accendendo e spegnendo la luce if (GetBackgroundFrame()==0) { SetBackgroundFrame(1); // do il valore alla variabile luce così da ritrovarmela nel caso nell'altra stanza Luce = 1; // setto le regioni che devono cambiare e basta region[1].Enabled = true; region[2].Enabled = true; region[0].Enabled = false; // qui metto che se l'hotspot del teletrasporto (che si attiva solo se è la porta è aperta) la regione 3 si attiva, altrimenti si disattiva. if (hPorta.Enabled == true) { region[3].Enabled = true; } else { region[3].Enabled = false; } } else { // se devo rimanere a luce accesa metti Luce ad 1 per l'altra stanza e riattiva le regioni della luce accesa SetBackgroundFrame(0); Luce = 0; region[1].Enabled = false; region[2].Enabled = false; region[0].Enabled = true; } } else Unhandled(); } Ora il problema è questo, questa stringa non va bene : if (hPorta.Enabled == true) { region[3].Enabled = true; } else { region[3].Enabled = false; } Perché punto 1 è una cosa che verifica solo se spengo ed accendo la luce, quindi se a luce spenta apro la porta non si aggiorna e punto 2.. Non mi funziona e basta ç_ç |
|
|
![]()
Messaggio
#52
|
|
![]() ![]() Gruppo: Oldgame Editor Messaggi: 516 Iscritto il: 16 May 12 Utente Nr.: 19.376 BGE The secret of Monkey Island Playing The secret of Monkey Island SO WinVista ![]() |
MovePlayer non esiste più.. o meglio probabilmente nel codice sorgente di AGS è rimasto per cui funziona ma ti consiglio vivamente di NON UTILIZZARLO, fidati.
Ti consiglio di leggere attentamente il manuale di AGS, di cui ti riporto un estratto: Walk (Formerly known as MoveCharacter, which is now obsolete) (Formerly known as MoveCharacterBlocking, which is now obsolete) (Formerly known as MoveCharacterDirect, which is now obsolete) Character.Walk(int x, int y, optional BlockingStyle, optional WalkWhere); Detto questo, il tuo codice fallo così, COPIA E INCOLLA SENZA CAMBIARE NULLA: CODICE function hLuce_AnyClick() { if(UsedAction(eGA_LookAt)) player.Say("L'interrutore della luce."); else if(UsedAction(eGA_Use)) { Player.Walk(20, 167, eBlock, eWalkableAreas); if (Luce == 1) Luce = 0; else Luce = 1; if (Luce == 1) { SetBackgroundFrame(1); region[1].Enabled = true; region[2].Enabled = true; region[0].Enabled = false; if (hPorta.Enabled == true) region[3].Enabled = true; else region[3].Enabled = false; } else { SetBackgroundFrame(0); region[1].Enabled = false; region[2].Enabled = false; region[0].Enabled = true; //qui suppongo debba scomparire la region. region[3].Enabled = false; } } else Unhandled(); } POI, quando apri o chiudi la porta: CODICE function hPorta_AnyClick()
{ if(UsedAction(eGA_LookAt)) player.Say("La porta."); //qui non so la frase che hai messo, il mio è un esempio else if(UsedAction(eGA_Use)) { //qui fai camminare verso la porta //Player.Walk...... metti le coordinate della porta // //qui verifica se invertire true con false oppure o no, visto che non so esattamente a cosa corrisponde tale region if (Luce == 1) region[3].Enabled = true; else region[3].Enabled = false; } else Unhandled(); } |
|
|
![]()
Messaggio
#53
|
|
Gruppo: Gamer Messaggi: 83 Iscritto il: 8 November 14 Utente Nr.: 20.571 SO Windows7 ![]() |
Allora, ti copio tutto il mio script della stanza perché mi da l'errore sia a player che a tale.
// room script file function room_FirstLoad() { // Lock door on startup when entering the room // set_door_state(20, 2); // init_object(20, oDoor.ID); } function room_BeforeFadeIn() { hPorta.Enabled = false; oPorta.Visible = false; } function room_AfterFadeIn() { region[0].Enabled = true; region[1].Enabled = false; region[2].Enabled = false; region[3].Enabled = false; SetBackgroundFrame(0); oPorta.Visible = true; gMaingui.Visible = true; // Se la porta è stata sbloccata, dì qualcosa al ritorno nella stanza. // if (get_door_state(20)<2) { // player.FaceDirection(eDir_Down); // player.Say("Well, that's it. Nothing more to do."); // player.Say("Now get started with your own game."); // cBman.Say("Have fun!"); // } function oPorta_AnyClick() { if (MovePlayer(108, 100)) { // Usa if(UsedAction(eGA_Use)) { player.Say("Chiusa."); } // OPEN else if(UsedAction(eGA_Open)) { oPorta.Graphic = 217; oPorta.Move (38, 154, 0, eBlock, eAnywhere); hPorta.Enabled = true; tale region if (Luce == 1) region[3].Enabled = true; else region[3].Enabled = false; } // CLOSE else if(UsedAction(eGA_Close)) { oPorta.Graphic = 12; oPorta.Move (10, 166, 0, eBlock, eAnywhere); hPorta.Enabled = false; tale region if (Luce == 1) region[3].Enabled = true; else region[3].Enabled = false; } // Guarda else if(UsedAction(eGA_LookAt)) { player.Say("La porta d'uscita."); } // Push else if(UsedAction(eGA_Push)) { player.Say("Si romperebbe."); } // Pull else if(UsedAction(eGA_Pull)) { player.Say("No."); Unhandled(); } // PICKUP else if(UsedAction(eGA_PickUp)) { // player.Say("Si dai."); // any_click_walk_look_pick(108, 100, eDir_Down, "Ehehe",oCup.ID, iCup); } //USE INV else if(UsedAction(eGA_UseInv)) { Unhandled(); } // don't forget this else Unhandled(); } } function cup_AnyClick() { if (MovePlayer(108, 100)) { // LOOK AT if(UsedAction(eGA_LookAt)) { player.Say("Una coppa blu."); } // USE else if(UsedAction(eGA_Use)) { player.Say("Senza nulla?."); } // Push else if(UsedAction(eGA_Push)) { player.Say("Si romperebbe."); } // Pull else if(UsedAction(eGA_Pull)) { Unhandled(); } // PICKUP else if(UsedAction(eGA_PickUp)) { player.Say("Si dai."); any_click_walk_look_pick(108, 100, eDir_Down, "Ehehe",oCup.ID, iCup); } //USE INV else if(UsedAction(eGA_UseInv)) { Unhandled(); } // don't forget this else Unhandled(); } } function hPorta_AnyClick() { cBastian.ChangeRoom(2, 100, 100); // if (any_click_on_door_special(20, oDoor.ID, 61, 104, eDir_Left, 2, 180, 88, eDir_Left, null, null, 4, 0)==0) Unhandled(); } function hArmadio_AnyClick() { MovePlayer(250, 158); if(UsedAction(eGA_LookAt)) { player.Say("Il mio armadio, pieno di costumi."); } else if(UsedAction(eGA_Use)) { player.Say("Non ho voglia di cambiarmi."); } else Unhandled(); } function hLuce_AnyClick() { if(UsedAction(eGA_LookAt)) player.Say("L'interrutore della luce."); else if(UsedAction(eGA_Use)) { Player.Walk(20, 167, eBlock, eWalkableAreas); if (Luce == 1) Luce = 0; else Luce = 1; if (Luce == 1) { SetBackgroundFrame(1); region[1].Enabled = true; region[2].Enabled = true; region[0].Enabled = false; if (hPorta.Enabled == true) region[3].Enabled = true; else region[3].Enabled = false; } else { SetBackgroundFrame(0); region[1].Enabled = false; region[2].Enabled = false; region[0].Enabled = true; //qui suppongo debba scomparire la region. region[3].Enabled = false; } } else Unhandled(); } function Bidone_AnyClick() { MovePlayer(212, 150); // LOOK AT if(UsedAction(eGA_LookAt)) { player.Say("Si tratta di un bidone."); } // USE else if(UsedAction(eGA_Use)) { player.Say("Non ho nulla da buttare."); } // Push else if(UsedAction(eGA_Push)) { player.Say("No."); } // Pull else if(UsedAction(eGA_Open)) { player.Say("Mamm e l'arc no."); } else if(UsedAction(eGA_Open)) { player.Say("Lo è già."); } // PICKUP else if(UsedAction(eGA_PickUp)) { player.Say("Si dai, portare un bidone dell'immondizia in tasca può comodo... Si, come no."); } // don't forget this else Unhandled(); } |
|
|
![]()
Messaggio
#54
|
|
![]() ![]() Gruppo: Oldgame Editor Messaggi: 516 Iscritto il: 16 May 12 Utente Nr.: 19.376 BGE The secret of Monkey Island Playing The secret of Monkey Island SO WinVista ![]() |
Quale pleyer ti da errore?
Mi puoi evidenziare la linea? e soprattutto cos'è "tale" ????? non è un comando di ags. cancellalo. ma, per curiosità, dove l'hai copiato questo script? ci sono parti in inglese ... attento a fare i copia incolla brutali. |
|
|
![]()
Messaggio
#55
|
|
Gruppo: Gamer Messaggi: 83 Iscritto il: 8 November 14 Utente Nr.: 20.571 SO Windows7 ![]() |
Perdonami avevo copiato erroneamente il tuo script, comunque mi da l'errore alla linea 138
// room script file function room_FirstLoad() { // Lock door on startup when entering the room // set_door_state(20, 2); // init_object(20, oDoor.ID); } function room_BeforeFadeIn() { hPorta.Enabled = false; oPorta.Visible = false; } function room_AfterFadeIn() { region[0].Enabled = true; region[1].Enabled = false; region[2].Enabled = false; region[3].Enabled = false; SetBackgroundFrame(0); oPorta.Visible = true; gMaingui.Visible = true; // Se la porta è stata sbloccata, dì qualcosa al ritorno nella stanza. // if (get_door_state(20)<2) { // player.FaceDirection(eDir_Down); // player.Say("Well, that's it. Nothing more to do."); // player.Say("Now get started with your own game."); // cBman.Say("Have fun!"); // } function oPorta_AnyClick() { if (MovePlayer(108, 100)) { // Usa if(UsedAction(eGA_Use)) { player.Say("Chiusa."); } // OPEN else if(UsedAction(eGA_Open)) { oPorta.Graphic = 217; oPorta.Move (38, 154, 0, eBlock, eAnywhere); hPorta.Enabled = true; if (Luce == 1) region[3].Enabled = true; else region[3].Enabled = false; } // CLOSE else if(UsedAction(eGA_Close)) { oPorta.Graphic = 12; oPorta.Move (10, 166, 0, eBlock, eAnywhere); hPorta.Enabled = false; if (Luce == 1) region[3].Enabled = true; else region[3].Enabled = false; } // Guarda else if(UsedAction(eGA_LookAt)) { player.Say("La porta d'uscita."); } // Push else if(UsedAction(eGA_Push)) { player.Say("Si romperebbe."); } // Pull else if(UsedAction(eGA_Pull)) { player.Say("No."); Unhandled(); } // PICKUP else if(UsedAction(eGA_PickUp)) { // player.Say("Si dai."); // any_click_walk_look_pick(108, 100, eDir_Down, "Ehehe",oCup.ID, iCup); } //USE INV else if(UsedAction(eGA_UseInv)) { Unhandled(); } // don't forget this else Unhandled(); } } function cup_AnyClick() { if (MovePlayer(108, 100)) { // LOOK AT if(UsedAction(eGA_LookAt)) { player.Say("Una coppa blu."); } // USE else if(UsedAction(eGA_Use)) { player.Say("Senza nulla?."); } // Push else if(UsedAction(eGA_Push)) { player.Say("Si romperebbe."); } // Pull else if(UsedAction(eGA_Pull)) { Unhandled(); } // PICKUP else if(UsedAction(eGA_PickUp)) { player.Say("Si dai."); any_click_walk_look_pick(108, 100, eDir_Down, "Ehehe",oCup.ID, iCup); } //USE INV else if(UsedAction(eGA_UseInv)) { Unhandled(); } // don't forget this else Unhandled(); } } function hPorta_AnyClick() { cBastian.ChangeRoom(2, 100, 100); // if (any_click_on_door_special(20, oDoor.ID, 61, 104, eDir_Left, 2, 180, 88, eDir_Left, null, null, 4, 0)==0) Unhandled(); } function hArmadio_AnyClick() { MovePlayer(250, 158); if(UsedAction(eGA_LookAt)) { player.Say("Il mio armadio, pieno di costumi."); } else if(UsedAction(eGA_Use)) { player.Say("Non ho voglia di cambiarmi."); } else Unhandled(); } function hLuce_AnyClick() { if(UsedAction(eGA_LookAt)) player.Say("L'interrutore della luce."); else if(UsedAction(eGA_Use)) { CITAZIONE Player.Walk(20, 167, eBlock, eWalkableAreas); if (Luce == 1) Luce = 0; else Luce = 1; if (Luce == 1) { SetBackgroundFrame(1); region[1].Enabled = true; region[2].Enabled = true; region[0].Enabled = false; if (hPorta.Enabled == true) region[3].Enabled = true; else region[3].Enabled = false; } else { SetBackgroundFrame(0); region[1].Enabled = false; region[2].Enabled = false; region[0].Enabled = true; //qui suppongo debba scomparire la region. region[3].Enabled = false; } } else Unhandled(); } function Bidone_AnyClick() { MovePlayer(212, 150); // LOOK AT if(UsedAction(eGA_LookAt)) { player.Say("Si tratta di un bidone."); } // USE else if(UsedAction(eGA_Use)) { player.Say("Non ho nulla da buttare."); } // Push else if(UsedAction(eGA_Push)) { player.Say("No."); } // Pull else if(UsedAction(eGA_Open)) { player.Say("Mamm e l'arc no."); } else if(UsedAction(eGA_Open)) { player.Say("Lo è già."); } // PICKUP else if(UsedAction(eGA_PickUp)) { player.Say("Si dai, portare un bidone dell'immondizia in tasca può comodo... Si, come no."); } // don't forget this else Unhandled(); } Comunque non ho copiato nulla, ho semplicemente iniziato dal template del 9-verb. Infatti più avanti modificherò anche la grafica e le funzioni della Gui.. Piano piano. Grazie mille per gli aiuti che mi stai dando ![]() |
|
|
![]()
Messaggio
#56
|
|
![]() ![]() Gruppo: Oldgame Editor Messaggi: 516 Iscritto il: 16 May 12 Utente Nr.: 19.376 BGE The secret of Monkey Island Playing The secret of Monkey Island SO WinVista ![]() |
player lettera piccola
![]() forse è stato un refuso da parte mia. Sostituisci Player con player |
|
|
![]()
Messaggio
#57
|
|
Gruppo: Gamer Messaggi: 83 Iscritto il: 8 November 14 Utente Nr.: 20.571 SO Windows7 ![]() |
La region 3 rimane attiva indifferentemente dalla porta aperta o chiusa a luce spenta :/
Messaggio modificato da Squall_Leonheart il 28 Nov 2014, 16:58 |
|
|
![]()
Messaggio
#58
|
|
![]() ![]() Gruppo: Oldgame Editor Messaggi: 516 Iscritto il: 16 May 12 Utente Nr.: 19.376 BGE The secret of Monkey Island Playing The secret of Monkey Island SO WinVista ![]() |
Disattivala la prima volta che entri nella stanza.
Da quel momento in poi se luce == 1 si attiva altrimenti no. |
|
|
![]()
Messaggio
#59
|
|
Gruppo: Gamer Messaggi: 83 Iscritto il: 8 November 14 Utente Nr.: 20.571 SO Windows7 ![]() |
Niente, continua a non disattivarsi al primo avvio. Quando entra nella camera, comunque dovrebbe verificare se uno aveva rimasto la luce accesa e la porta aperta.. Quindi avevo fatto così.. Ma niente. La region non si disattiva.
CODICE // room script file
function room_FirstLoad() { // Lock door on startup when entering the room // set_door_state(20, 2); // init_object(20, oDoor.ID); } function room_BeforeFadeIn() { hPorta.Enabled = false; oPorta.Visible = false; } function room_AfterFadeIn() { region[0].Enabled = true; region[1].Enabled = false; region[2].Enabled = false; Luce = 0; if (hPorta.Enabled == true) region[3].Enabled = true; else region[3].Enabled = false; SetBackgroundFrame(0); oPorta.Visible = true; gMaingui.Visible = true; // Se la porta è stata sbloccata, dì qualcosa al ritorno nella stanza. // if (get_door_state(20)<2) { // player.FaceDirection(eDir_Down); // player.Say("Well, that's it. Nothing more to do."); // player.Say("Now get started with your own game."); // cBman.Say("Have fun!"); // } function oPorta_AnyClick() { if (MovePlayer(108, 100)) { // Usa if(UsedAction(eGA_Use)) { player.Say("Chiusa."); } // OPEN else if(UsedAction(eGA_Open)) { oPorta.Graphic = 217; oPorta.Move (38, 154, 0, eBlock, eAnywhere); hPorta.Enabled = true; if (Luce == 1) region[3].Enabled = true; else region[3].Enabled = false; } // CLOSE else if(UsedAction(eGA_Close)) { oPorta.Graphic = 12; oPorta.Move (10, 166, 0, eBlock, eAnywhere); hPorta.Enabled = false; region[3].Enabled = false; } // Guarda else if(UsedAction(eGA_LookAt)) { player.Say("La porta d'uscita."); } // Push else if(UsedAction(eGA_Push)) { player.Say("Si romperebbe."); } // Pull else if(UsedAction(eGA_Pull)) { player.Say("No."); Unhandled(); } // PICKUP else if(UsedAction(eGA_PickUp)) { // player.Say("Si dai."); // any_click_walk_look_pick(108, 100, eDir_Down, "Ehehe",oCup.ID, iCup); } //USE INV else if(UsedAction(eGA_UseInv)) { Unhandled(); } // don't forget this else Unhandled(); } } function cup_AnyClick() { if (MovePlayer(108, 100)) { // LOOK AT if(UsedAction(eGA_LookAt)) { player.Say("Una coppa blu."); } // USE else if(UsedAction(eGA_Use)) { player.Say("Senza nulla?."); } // Push else if(UsedAction(eGA_Push)) { player.Say("Si romperebbe."); } // Pull else if(UsedAction(eGA_Pull)) { Unhandled(); } // PICKUP else if(UsedAction(eGA_PickUp)) { player.Say("Si dai."); any_click_walk_look_pick(108, 100, eDir_Down, "Ehehe",oCup.ID, iCup); } //USE INV else if(UsedAction(eGA_UseInv)) { Unhandled(); } // don't forget this else Unhandled(); } } function hPorta_AnyClick() { cBastian.ChangeRoom(2, 100, 100); // if (any_click_on_door_special(20, oDoor.ID, 61, 104, eDir_Left, 2, 180, 88, eDir_Left, null, null, 4, 0)==0) Unhandled(); } function hArmadio_AnyClick() { MovePlayer(250, 158); if(UsedAction(eGA_LookAt)) { player.Say("Il mio armadio, pieno di costumi."); } else if(UsedAction(eGA_Use)) { player.Say("Non ho voglia di cambiarmi."); } else Unhandled(); } function hLuce_AnyClick() { if(UsedAction(eGA_LookAt)) player.Say("L'interrutore della luce."); else if(UsedAction(eGA_Use)) { player.Walk(20, 167, eBlock, eWalkableAreas); if (Luce == 1) Luce = 0; else Luce = 1; if (Luce == 1) { SetBackgroundFrame(1); region[1].Enabled = true; region[2].Enabled = true; region[0].Enabled = false; if (hPorta.Enabled == true) region[3].Enabled = true; else region[3].Enabled = false; } else { SetBackgroundFrame(0); region[1].Enabled = false; region[2].Enabled = false; region[0].Enabled = true; region[3].Enabled = false; } } else Unhandled(); } function Bidone_AnyClick() { MovePlayer(212, 150); // LOOK AT if(UsedAction(eGA_LookAt)) { player.Say("Si tratta di un bidone."); } // USE else if(UsedAction(eGA_Use)) { player.Say("Non ho nulla da buttare."); } // Push else if(UsedAction(eGA_Push)) { player.Say("No."); } // Pull else if(UsedAction(eGA_Open)) { player.Say("Mamm e l'arc no."); } else if(UsedAction(eGA_Open)) { player.Say("Lo è già."); } // PICKUP else if(UsedAction(eGA_PickUp)) { player.Say("Si dai, portare un bidone dell'immondizia in tasca può comodo... Si, come no."); } // don't forget this else Unhandled(); } Messaggio modificato da Squall_Leonheart il 28 Nov 2014, 18:54 |
|
|
![]()
Messaggio
#60
|
|
![]() ![]() Gruppo: Oldgame Editor Messaggi: 516 Iscritto il: 16 May 12 Utente Nr.: 19.376 BGE The secret of Monkey Island Playing The secret of Monkey Island SO WinVista ![]() |
sei sicuro che ti stai riferendo alla region giusta?
così come è scritto, la region 3 dovrebbe trovarsi su false, quindi il suo effetto non dovrebbe essere visibile. Cosa succede se entri nela region 3 qundo è attivata, cioè quando è su true? come l'hai impostata? cosa avviene al personaggio? Mi viene il sospetto che tu la stia usando al contrario.... cioè che quando dici "attivata" non significa che si trovi su true... prova a scambiare true con false in TUTTI gli script e vedi cosa succede. Messaggio modificato da AprilSkies il 28 Nov 2014, 19:18 |
|
|
![]()
Messaggio
#61
|
|
Gruppo: Gamer Messaggi: 83 Iscritto il: 8 November 14 Utente Nr.: 20.571 SO Windows7 ![]() |
No sono sicuro che la region sia giusta. Ti spiego la region 3 deve attivarsi a porta aperta (hPorta.Enabled = true) e a Luce spenta (Luce 1). Ora tutto funziona bene solo che quando carica la prima stanza è già attiva nonostante nel roomload abbia messo
CODICE if (hPorta.Enabled == true) region[3].Enabled = true;
else region[3].Enabled = false; |
|
|
![]()
Messaggio
#62
|
|
![]() ![]() Gruppo: Oldgame Editor Messaggi: 516 Iscritto il: 16 May 12 Utente Nr.: 19.376 BGE The secret of Monkey Island Playing The secret of Monkey Island SO WinVista ![]() |
hPorta è enabled appena carica?
verificalo mettendo oPorta non visibile (che lo copre) Altra cosa. region[0] che cos'è? Me ne sono accorto ora! Le regioni partono da uno! Leggi il manuale! Cancella la region[0] Messaggio modificato da AprilSkies il 28 Nov 2014, 20:08 |
|
|
![]()
Messaggio
#63
|
|
Gruppo: Gamer Messaggi: 83 Iscritto il: 8 November 14 Utente Nr.: 20.571 SO Windows7 ![]() |
Ah finalmente ci sono riuscito!
Potresti dirmi come cambiare la room dove inizia il gioco? Vorrei iniziare a creare una schermata per i crediti e una per i titoli. |
|
|
![]()
Messaggio
#64
|
|
![]() ![]() Gruppo: Oldgame Editor Messaggi: 516 Iscritto il: 16 May 12 Utente Nr.: 19.376 BGE The secret of Monkey Island Playing The secret of Monkey Island SO WinVista ![]() |
devi cambiare la start room del personaggio principale. Menù a destra.
La start room del personaggio è la prima che carica. |
|
|
![]()
Messaggio
#65
|
|
Gruppo: Gamer Messaggi: 83 Iscritto il: 8 November 14 Utente Nr.: 20.571 SO Windows7 ![]() |
Ora sto avendo un problema col 9-Verb.
Cambio la grafica alle view e al cursore stesso ma quando clicco col tasto destro su un oggetto mi ritorna quello vecchio. Non riesco a trovare la stringa che gestisce questa cosa :/ |
|
|
![]()
Messaggio
#66
|
|
![]() ![]() Gruppo: Oldgame Editor Messaggi: 516 Iscritto il: 16 May 12 Utente Nr.: 19.376 BGE The secret of Monkey Island Playing The secret of Monkey Island SO WinVista ![]() |
Dovrebbe trovarsi nel GUIScript.
in uno script che si chiama "On Mouse Click" in cui è codato cosa avviene quando clicchi con i diversi pulsanti del mouse Messaggio modificato da AprilSkies il 29 Nov 2014, 20:12 |
|
|
![]()
Messaggio
#67
|
|
Gruppo: Gamer Messaggi: 83 Iscritto il: 8 November 14 Utente Nr.: 20.571 SO Windows7 ![]() |
Non la trovo, ti copio lo script:
CODICE function on_mouse_click(MouseButton button) { if (!is_gui_disabled()) { int mrx=mouse.x+GetViewportX(); int mry=mouse.y+GetViewportY(); int x=mouse.x; int y=mouse.y; // get location under mouse cursor GSloctype=GetLocationType(x, y); GSlocname=Game.GetLocationName(x, y); GSagsusedmode=Mouse.Mode; used_action=global_action; InventoryItem*ii = InventoryItem.GetAtScreenXY(x, y); if (GSloctype==eLocationHotspot) { Hotspot*h=Hotspot.GetAtScreenXY(x, y); GSlocid=h.ID; } else if (GSloctype==eLocationCharacter) { Character*c=Character.GetAtScreenXY(x, y); GSlocid=c.ID; } else if (GSloctype==eLocationObject) { Object*o=Object.GetAtScreenXY(x, y); GSlocid=o.ID; } else if (ii!=null) GSlocid=ii.ID; if (IsGamePaused()) { // Game is paused, so do nothing (ie. don't allow mouse click) } // Mousebutton Left else if (button==eMouseLeft) { if (GlobalCondition(2) || GlobalCondition(3) || GlobalCondition(4)) { // Do nothing, if: // the mode is useinv and the mouse is over the active inv (like "use knife on knife") // or the mode is talk, or "Give", and the mouse isnt over a character // or its GIVE and the mouse isnt over a inv.item } else if (ExtensionEx(1, GSlocname)=='e') { UpdateActionBar(); ActionLine.TextColor=ActionLabelColorHighlighted; WalkOffScreen(); } // walk to else if (GSagsusedmode==eModeUsermode2) { ActionLine.TextColor=ActionLabelColorHighlighted; if (IsInteractionAvailable(x, y, GSagsusedmode)) ProcessClick (x, y, GSagsusedmode); else ProcessClick(x, y, eModeWalkto); } // talkto else if (GSagsusedmode==eModeTalkto && IsInteractionAvailable(x, y, GSagsusedmode) && GSloctype==eLocationCharacter) { ActionLine.TextColor=ActionLabelColorHighlighted; if (GoToCharacter(character[GSlocid], eDir_None, NPC_facing_player, 1)) character[GSlocid].RunInteraction(GSagsusedmode); SetAction(eMA_Default); } // Giveto else if ((GSagsusedmode == eModeUseinv) && GSloctype==eLocationCharacter && isAction(eGA_GiveTo)) { ActionLine.TextColor=ActionLabelColorHighlighted; ItemGiven=player.ActiveInventory; if (GoToCharacter(character[GSlocid], eDir_None, NPC_facing_player, 2)) { if (IsInteractionAvailable (mrx - GetViewportX (), mry - GetViewportY (), eModeUseinv) == 1) { character[GSlocid].RunInteraction(eModeUseinv); } } SetAction (eMA_Default); } else { UpdateActionBar(); ActionLine.TextColor=ActionLabelColorHighlighted; ProcessClick(x, y, GSagsusedmode); SetAction(eMA_Default); ItemGiven=null; } } // Mousebutton Right else if (button==eMouseRight) { if (alternative_action==eMA_Default) { SetAction(eMA_Default); ActionLine.TextColor=ActionLabelColorHighlighted; if (Mouse.Mode==eModeUsermode2) { if (ExtensionEx(1, GSlocname)=='e') { UpdateActionBar(); ActionLine.TextColor=ActionLabelColorHighlighted; WalkOffScreen(); } else ProcessClick(x, y, eModeWalkto); } else ProcessClick(x, y, Mouse.Mode); } else { SetAction(alternative_action); used_action=global_action; UpdateActionBar(); ActionLine.TextColor=ActionLabelColorHighlighted; GSagsusedmode=Mouse.Mode; if (GSagsusedmode==eModeTalkto && IsInteractionAvailable(x, y, GSagsusedmode) && GSloctype==eLocationCharacter) { //(GetCharacterAt (mouse.x, mouse.y) < 7)) if (GoToCharacter(character[GSlocid], eDir_None, NPC_facing_player,2 )) character[GSlocid].RunInteraction(GSagsusedmode); } else ProcessClick(x, y, GSagsusedmode); SetAction(eMA_Default); } } //left click in inventory else if (button==eMouseLeftInv) { if (!isAction(eGA_GiveTo))ItemGiven= null; if (GlobalCondition (1)) { // if the mouse is in the inventory and modes Walk or pickup are selected SetAction (eGA_Use); location=GSinvloc; if (Extension()=='u' && ii.IsInteractionAvailable(eModeInteract)) { // use it immediately (not with anything else) used_action=global_action; ii.RunInteraction(eModeInteract); SetAction(eMA_Default); } else { if (oldschool_inv_clicks) { SetAction (eGA_LookAt); used_action=global_action; ii.RunInteraction(eModeLookat); SetAction(eMA_Default); } else player.ActiveInventory=ii; } } else if (GlobalCondition (2) == 1) { // if the mode is useinv and the mouse is over the active inv (like "use knife on knife") // so do nothing again } else { used_action=global_action; if (Mouse.Mode==eModeInteract) { if (isAction(eGA_Use) && ii.IsInteractionAvailable(eModeInteract)) { ActionLine.TextColor=ActionLabelColorHighlighted; ii.RunInteraction(eModeInteract); SetAction(eMA_Default); } else player.ActiveInventory=ii; } else { if ( (Mouse.Mode >0 && Mouse.Mode <10 )&& ii != null) { GSagsusedmode=Mouse.Mode; ActionLine.TextColor=ActionLabelColorHighlighted; ii.RunInteraction(Mouse.Mode); SetAction(eMA_Default); } } } } //right click in inventory else if (button==eMouseRightInv) { if (alternative_action==eMA_Default) { SetAction(eMA_Default); } else { SetAction(alternative_action); used_action=global_action; GSagsusedmode=Mouse.Mode; if (Mouse.Mode==eModeInteract) { if (isAction(eGA_Use) && ii.IsInteractionAvailable(eModeInteract)) { UpdateActionBar(); ActionLine.TextColor=ActionLabelColorHighlighted; ii.RunInteraction(eModeInteract); SetAction(eMA_Default); } else player.ActiveInventory=ii; } else { UpdateActionBar(); ActionLine.TextColor=ActionLabelColorHighlighted; inventory[game.inv_activated].RunInteraction(Mouse.Mode); SetAction(eMA_Default); } } } } } function repeatedly_execute_always() { // Doubleclick Timer if (!IsGamePaused() && !is_gui_disabled()) { if (timer_run == true) { timer_click++; if (timer_click >= dc_speed){ timer_click = 0; timer_run = false; } } } } function repeatedly_execute() { if (!IsGamePaused() && !is_gui_disabled()) { // --- for the MovePlayer function --- if (GScancelable==1) { GScancelable=0; if (InventoryItem.GetAtScreenXY(mouse.x, mouse.y)==null) on_mouse_click(eMouseLeft); else on_mouse_click(eMouseLeftInv); } else if (GScancelable==2) { GScancelable=0; CheckDefaultAction(); if (InventoryItem.GetAtScreenXY(mouse.x, mouse.y)==null) on_mouse_click(eMouseRight); else on_mouse_click(eMouseRightInv); } CheckDefaultAction(); UpdateActionBar(); } // change the arrows in the inventory to show if you // can scroll the inventory: if (MainInv.TopItem>0) { // if inventory can scroll up InvUp.NormalGraphic=invUparrowONsprite; InvUp.MouseOverGraphic=invUparrowHIsprite; if (InventoryItem.GetAtScreenXY(gMaingui.X+MainInv.X+1, gMaingui.Y+MainInv.Y+1)==null) MainInv.TopItem-=MainInv.ItemsPerRow; } else { InvUp.NormalGraphic=invUparrowOFFsprite; InvUp.MouseOverGraphic=invUparrowOFFsprite; } //if inv can scroll down if (MainInv.TopItem<MainInv.ItemCount-(MainInv.ItemsPerRow * MainInv.RowCount)) { InvDown.NormalGraphic=invDownarrowONsprite; InvDown.MouseOverGraphic=invDownarrowHIsprite; } else{ InvDown.NormalGraphic=invDownarrowOFFsprite; InvDown.MouseOverGraphic=invDownarrowOFFsprite; } } |
|
|
![]()
Messaggio
#68
|
|
![]() ![]() Gruppo: Oldgame Editor Messaggi: 516 Iscritto il: 16 May 12 Utente Nr.: 19.376 BGE The secret of Monkey Island Playing The secret of Monkey Island SO WinVista ![]() |
Il codice relativo alla pressione del pulsante destro del mouse è quello che segue
CODICE // Mousebutton Right else if (button==eMouseRight) { ....... tutto quello che è scritto da qui in poi, fino al successivo "ELSE" è ciò che è codato per il pulsante destro ^^ Messaggio modificato da AprilSkies il 30 Nov 2014, 10:19 |
|
|
![]()
Messaggio
#69
|
|
Gruppo: Gamer Messaggi: 83 Iscritto il: 8 November 14 Utente Nr.: 20.571 SO Windows7 ![]() |
Si quello l'avevo trovato, il problema è che nello script non vedo nessun posto dove imposta le immagini..
Ho provato a fermare anche le actioncolor del testo ma neanche quelle si modificano.. Solo cancellando tutte le cose si rimuovono. Ma p'er il resto il nome delle immagini coincidono ma continua. Che fare? |
|
|
![]()
Messaggio
#70
|
|
![]() ![]() Gruppo: Oldgame Editor Messaggi: 516 Iscritto il: 16 May 12 Utente Nr.: 19.376 BGE The secret of Monkey Island Playing The secret of Monkey Island SO WinVista ![]() |
eh?
Non ho capito. Se cancelli tutto va bene o no? |
|
|
![]()
Messaggio
#71
|
|
Gruppo: Gamer Messaggi: 83 Iscritto il: 8 November 14 Utente Nr.: 20.571 SO Windows7 ![]() |
Praticamente, cancellando queste stringhe
CODICE else if (button==eMouseRight) { if (alternative_action==eMA_Default) { SetAction(eMA_Default); ActionLine.TextColor=ActionLabelColorHighlighted; if (Mouse.Mode==eModeUsermode2) { if (ExtensionEx(1, GSlocname)=='e') { UpdateActionBar(); ActionLine.TextColor=ActionLabelColorHighlighted; WalkOffScreen(); } else ProcessClick(x, y, eModeWalkto); } else ProcessClick(x, y, Mouse.Mode); } else { SetAction(alternative_action); used_action=global_action; UpdateActionBar(); ActionLine.TextColor=ActionLabelColorHighlighted; GSagsusedmode=Mouse.Mode; if (GSagsusedmode==eModeTalkto && IsInteractionAvailable(x, y, GSagsusedmode) && GSloctype==eLocationCharacter) { //(GetCharacterAt (mouse.x, mouse.y) < 7)) if (GoToCharacter(character[GSlocid], eDir_None, NPC_facing_player,2 )) character[GSlocid].RunInteraction(GSagsusedmode); } else ProcessClick(x, y, GSagsusedmode); SetAction(eMA_Default); } } Il tasto destro non fa più alcuna azione, invece io vorrei che rimanesse il cursore che ho impostato nella grafica, non quello del 9 verb! Aggiungendo questo cursorspritenumber = 265; sotto SetAction(eMA_Default) Mi mette il cursore con la giusta immagine, però non animato! |
|
|
![]()
Messaggio
#72
|
|
![]() ![]() Gruppo: Oldgame Editor Messaggi: 516 Iscritto il: 16 May 12 Utente Nr.: 19.376 BGE The secret of Monkey Island Playing The secret of Monkey Island SO WinVista ![]() |
Scusa, ma una domanda... se semplicemente quello che vuoi fare è cambiare la grafica del cursore...
perché non vai in "cursors" e cambi la grafica nell'apposito menù a destra... e se lo vuoi animato, perché non cambi semplicemente la view numero 100 che è quella richiamata da default nei 9-verbs? Assegna alla view in questione la successione di frames della tua animazione... e hai finito. non c'è motivo di cambiare lo script del mouse, se devi fare solo quello! |
|
|
![]()
Messaggio
#73
|
|
Gruppo: Gamer Messaggi: 83 Iscritto il: 8 November 14 Utente Nr.: 20.571 SO Windows7 ![]() |
Ma il problema è proprio che cambiando tutti gli sprites e le view dai menù continua il difetto!
|
|
|
![]()
Messaggio
#74
|
|
Gruppo: Gamer Messaggi: 83 Iscritto il: 8 November 14 Utente Nr.: 20.571 SO Windows7 ![]() |
Ma il problema è proprio che cambiando tutti gli sprites e le view dai menù continua il difetto!
|
|
|
![]()
Messaggio
#75
|
|
![]() ![]() Gruppo: Oldgame Editor Messaggi: 516 Iscritto il: 16 May 12 Utente Nr.: 19.376 BGE The secret of Monkey Island Playing The secret of Monkey Island SO WinVista ![]() |
In ogni cursore imposta, nel menù a destra, IMAGE e VIEW il tuo sprite e la tua view. In ogni cursore intendo OGNI (dallo 0 fino a user mode 2).
POI, DEVI DIRLO ALLA GUI quindi vai nello script della GUI e alla riga N.27 troverai, cursorspritenumber = ..., METTI Lì il tuo numero di SPRITE. vedrai che ti funziona. |
|
|
![]() ![]() |
Versione Lo-Fi | Oggi è il: 11th December 2019 - 01:50 |