ACHTUNG!
Wenn man mit der neusten Version (AGS 3.1.2) die Starterpacks öffnet, gibt es erst mal Fehler.
Löscht einfach die Dateien KeyCodes.asc und KeyCodes.ash (nur im Editor) unter Scripts.
Dann funktioniert es wieder.
Grüße Rulaman
function hTuer_AnyClick()
{
if (any_click_on_door (18, 0, 33, 130, DIR_LEFT, 2, 160, 127, DIR_LEFT) == 0) Unhandled ();}
}
...aus einer Anleitung prbiert...aber bekomme Fehlermeldung.
function hTuer_AnyClick()
{
if (any_click_on_door (18, 0, 33, 130, DIR_LEFT, 2, 160, 127, DIR_LEFT) == 0) Unhandled ();}
}
Ich würde mir auch mal das neue Türenskript anschauen.
function hTuer_AnyClick()
{
SetDoorStrings("Die Tür zum Flur.", "", "Damit klappt das nicht.");
if ( any_click_on_door(1, oTuer, 30, 126, eDirLeft, 6, 400, 100, eDirUp) == 0 ) Unhandled();
SetDoorStrings("", "", ""); // strings leeren, um beim Vergessen keinen falschen Satz sagen zu lassen.
}
Door[gr_Kevin].l_Room = 5;
Door[gr_Kevin].i_XPosition = 145;
Door[gr_Kevin].i_YPosition = 125;
Door[gr_Kevin].l_Direction = eDirUp;
Door[gr_Kevin].l_NewRoom = 6;
Door[gr_Kevin].i_NewXPosition = 240;
Door[gr_Kevin].i_NewYPosition = 130;
Door[gr_Kevin].l_NewDirection = eDirDown;
DoorSetup();
/**********************************************************************/
/* Functions */
/**********************************************************************/
int DoorType::SetStrings(String lookat, String islocked, String wrongitem, String lookAt2)
{
this.s_LookAt = lookat;
this.s_NewLookAt = lookAt2;
this.s_IsLocked = islocked;
this.s_WrongItem = wrongitem;
}
/**********************************************************************
***********************************************************************/
int DoorType::Open()
{
this.i_GlobalInt = eDoorOpen;
if ( player.Room == this.l_Room )
{
this.o_Objekt.Visible = true;
}
else if ( player.Room == this.l_NewRoom )
{
this.o_NewObjekt.Visible = true;
}
}
/**********************************************************************
***********************************************************************/
int DoorType::Close()
{
this.i_GlobalInt = eDoorClosed;
if ( player.Room == this.l_Room )
{
this.o_Objekt.Visible = false;
}
else if ( player.Room == this.l_NewRoom )
{
this.o_NewObjekt.Visible = false;
}
}
/**********************************************************************
***********************************************************************/
int DoorType::Lock()
{
this.i_GlobalInt = eDoorLocked;
if ( player.Room == this.l_Room )
{
this.o_Objekt.Visible = false;
}
else if ( player.Room == this.l_NewRoom )
{
this.o_NewObjekt.Visible = false;
}
}
/**********************************************************************
***********************************************************************/
int DoorType::ClickSpecial(int opensound, int closesound, int key, int closevalue)
{
// key = -1: opens also locked doors without key
// key = -2: door can't be unlocked (like rusted)
InventoryItem *charInv = player.ActiveInventory;
int result = 1;
int i_XPosition;
int i_YPosition;
int i_NewXPosition;
int i_NewYPosition;
eDirection l_Direction;
eDirection l_NewDirection;
int l_NewRoom;
String s_LookAt;
Object *o_Objekt;
if ( player.Room == this.l_Room )
{
i_XPosition = this.i_XPosition;
i_YPosition = this.i_YPosition;
i_NewXPosition = this.i_NewXPosition;
i_NewYPosition = this.i_NewYPosition;
l_Direction = this.l_Direction;
l_NewDirection = this.l_NewDirection;
l_NewRoom = this.l_NewRoom;
s_LookAt = this.s_LookAt;
o_Objekt = this.o_Objekt;
if ( s_LookAt == null )
{
s_LookAt = s_LookAtStandard;
}
}
else if ( player.Room == this.l_NewRoom )
{
i_XPosition = this.i_NewXPosition;
i_YPosition = this.i_NewYPosition;
i_NewXPosition = this.i_XPosition;
i_NewYPosition = this.i_YPosition;
l_Direction = this.l_NewDirection;
l_NewDirection = this.l_Direction;
l_NewRoom = this.l_Room;
s_LookAt = this.s_NewLookAt;
o_Objekt = this.o_NewObjekt;
if ( s_LookAt == null )
{
s_LookAt = s_NewLookAtStandard;
}
l_Direction = (l_Direction+2)%4;
l_NewDirection = (l_NewDirection+2)%4;
}
else
{
result = 1;
}
if ( UsedAction (eActClose) )
{
if ( this.i_GlobalInt == 0 )
{
player.Say("Das ist schon zu.");
}
else if ( this.i_GlobalInt == 1 )
{
if ( any_click_move(i_XPosition, i_YPosition, l_Direction) )
{
PlaySound(closesound);
if ( o_Objekt )
{
o_Objekt.Visible = false;
}
this.i_GlobalInt = closevalue;
}
}
}
else if ( UsedAction(eActOpen) )
{
if ( (this.i_GlobalInt == 0) || ((this.i_GlobalInt == 2) && (key == -1)) )
{
if ( any_click_move(i_XPosition, i_YPosition, l_Direction) )
{
PlaySound(opensound);
if ( o_Objekt )
{
o_Objekt.Visible = true;
}
this.i_GlobalInt = 1;
}
}
else if ( this.i_GlobalInt == 1 )
{
player.Say("Das ist schon offen.");
}
else if ( this.i_GlobalInt == 2 )
{
if ( any_click_move(i_XPosition, i_YPosition, l_Direction) )
{
if ( this.s_IsLocked != null )
{
player.Say(this.s_IsLocked);
}
else
{
player.Say(s_IsLockedStandard);
}
}
}
}
else if ( UsedAction (eActWalkTo) )
{
if ( any_click_move(i_XPosition, i_YPosition, l_Direction) == 2 ) // == 2, korrektur Door-Script, falls sich Charakter nicht bewegen kann
{
if ( this.i_GlobalInt == 1 )
{
player.EnterRoom(l_NewRoom, i_NewXPosition, i_NewYPosition, l_NewDirection);
result = 2;
}
}
}
else if ( UsedAction(eActLookAt) && (s_LookAt.Length > 0) )
{
if ( any_click_move(i_XPosition, i_YPosition, l_Direction) )
{
player.Say(s_LookAt);
}
}
else if ( UsedAction(eActUseInventory) && (key >= 0) )
{
if (any_click_move(i_XPosition, i_YPosition, l_Direction) )
{
if ( charInv )
{
if ( charInv.ID == key )
{
if ( this.i_GlobalInt == 2 )
{
PlaySound(2);
if ( o_Objekt )
{
o_Objekt.Visible = true;
}
this.i_GlobalInt = 1;
}
}
else
{
if ( this.s_WrongItem != null )
{
player.Say(this.s_WrongItem);
}
else
{
player.Say(s_WrongItemStandard);
}
}
}
}
}
else result = 0;
return result;
// 0 = unhandled
// 1 = handled
// 2 = NewRoom
}
/**********************************************************************
***********************************************************************/
int DoorType::Click()
{
return this.ClickSpecial(2, 3, 0, 0);
}
/**********************************************************************
***********************************************************************/
int DoorType::Init(Object *o_Objekt, Hotspot *h_Hotspot)
{
if ( null != o_Objekt )
{
o_Objekt.Clickable = false; // die Türenobjekte nicht Klickbar machen
if ( this.i_GlobalInt == 1 ) o_Objekt.Visible = true;
else o_Objekt.Visible = false;
if ( this.l_Room == player.Room )
{
this.o_Objekt = o_Objekt;
}
else if ( this.l_NewRoom == player.Room )
{
this.o_NewObjekt = o_Objekt;
}
}
if ( null != h_Hotspot )
{
if ( this.l_Room == player.Room )
{
this.h_Hotspot = h_Hotspot;
}
else if ( this.l_NewRoom == player.Room )
{
this.h_NewHotspot = h_Hotspot;
}
}
}
/**********************************************************************
***********************************************************************/
String VariableExtensions (String location)
{
int i = 0;
bool b_Ready = false;
Hotspot* hotAt = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
Object *objAt = Object.GetAtScreenXY(mouse.x, mouse.y);
while ( i < MAX_DOORS )
{
if ( ((Door[i].h_Hotspot == hotAt) && (Door[i].l_Room == player.Room)) ||
((Door[i].h_NewHotspot == hotAt) && (Door[i].l_NewRoom == player.Room)) )
{
if ( (Door[i].i_GlobalInt == eDoorClosed) || (Door[i].i_GlobalInt == eDoorLocked) )
{
location = location.AddExtension('o');
}
else
{
location = location.AddExtension('c');
}
i = MAX_DOORS; // simulates a break;
b_Ready = true;
}
i++;
}
return location;
}
function hTuer_AnyClick()
{
if(Door[eDoorNumTuer1].Click()==0) Unhandled();
}
- ein Tür-Objekt, dieses darf nicht klickbar sein, braucht auch nicht "verskriptet" werden.function room_Load()
{
// Alles andere was zum Raumladen gemacht wird.
Door[eDoorNumTuer1].Init(oTuer, hTuer);
}
function hTuer_AnyClick()
{
SetDoorStrings("Die Tür zum Flur.", "", "Damit klappt das nicht.");
if ( any_click_on_door(1, oTuer, 274, 126, eDirRight, 6, 33, 135, eDirRight) == 0 ) Unhandled();
SetDoorStrings("", "", ""); // strings leeren, um beim Vergessen keinen falschen Satz sagen zu lassen.
}
function hTuer_AnyClick()
{
if ( Door[gr_Bernard].Click() == 0 ) Unhandled();
}
function room_Load()und dann muss ich noch im Doorscript alles weitere eingeben.
{
Door[gr_Bernard].Init(oTuer, hTuer);
}
// Bernards Zimmertür
Door[gr_Bernard].l_Room = 19;
Door[gr_Bernard].i_XPosition = 45;
Door[gr_Bernard].i_YPosition = 135;
Door[gr_Bernard].l_Direction = eDirLeft;
Door[gr_Bernard].l_NewRoom = 6;
Door[gr_Bernard].i_NewXPosition = 240;
Door[gr_Bernard].i_NewYPosition = 130;
Door[gr_Bernard].l_NewDirection = eDirDown;
//Door[gr_Bernard].s_IsLocked = "Die ist abgesperrt.";
Door[gr_Bernard].s_LookAt = "Meine Zimmertür.";
Door[gr_Bernard].s_NewLookAt = "Meine Zimmertür.";
//Door[gr_Bernard].s_WrongItem = "Damit geht es nicht.";
Ach ja, bevor ich es vergesse....Streng genommen haben DIR_LEFT und eDirLeft nichts mit der Versionsnummer von AGS zu tun; das sind willkürliche Definitionen.
...die Anleitung habe ich hier im Forum gefunden, um ein "mmm" Spiel zu erstellen, was ich "leider" erst später festgestellt habe, ist das die Anleitun auf AGS 2.7 basierte....
...daher auch die Fehler (DIR_LEFT) welche beim AGS3 ja (eDirLeft) heissen müssen.
Danke für die Hilfe
@KhrisMUC
die Anleitung habe ich unter anderem auf anderen Seiten, sowie hier im Forum gesehen:
http://www.maniac-mansion-mania.de/forum/index.php?topic=15.0 (http://www.maniac-mansion-mania.de/forum/index.php?topic=15.0)
wo u.a das mit "DIR_UP" steht, was bei mir im AGS3.1 nicht funktioniert.
@Endres,Türen haben zwar auch ein Objekt, das braucht aber kein any_Click; die Tür-Objekte werden nur zum Anzeigen des "Türlochs" verwendet und sind sowieso nicht anklickbar.
das Letzte Zitat ist das was ich im Script "Doors" eingegeben habe und die Fehlermeldung: ...undefined symbol "gr_Bernard" erhalten habe. (Wo lege ich das "object"oTuer an???)
ich kenne mich noch nicht so genau aus, aber das was ich bislang gemacht habe funtioniert alles.
habe "hotspots" zum "Raum" wechsel erstellt.... geht alles, vur mit den sch... Türen habe ich meine probleme.
So wie ich es (mir an-) gelernt habe muss ich ein "any_Click" für "hTuer" sowie "oTuer" erstellen, nur in den SP seke ich diesen eintrag nicht, ebenso funktioniert bei mir die optiov "Tür>v" auch nicht.
enum eDoorNum
{
eDoorNumHaustuer,
eDoorNumGitter,
.
.
.
eDoorNumTeleskopzimmer,
eDoorNumDrahtraum,
gr_Bernard, // Bernard's Zimmertür
};
die Anleitung habe ich unter anderem auf anderen Seiten, sowie hier im Forum gesehen:
http://www.maniac-mansion-mania.de/forum/index.php?topic=15.0 (http://www.maniac-mansion-mania.de/forum/index.php?topic=15.0)
wo u.a das mit "DIR_UP" steht, was bei mir im AGS3.1 nicht funktioniert.
Bitte gleich überarbeiten Khrismuc. ;D :-*
Door[gr_Bernard].Init(oTuer, hTuer);
Door[eDoorNumTuer2].i_GlobalInt = eDoorClosed;habe für Raum 6 und 14 " if(Door[eDoorNumTuer2].Click()==0) Unhandled();
Door[eDoorNumTuer2].l_Room = 6;
Door[eDoorNumTuer2].i_XPosition = 558;
Door[eDoorNumTuer2].i_YPosition = 115;
Door[eDoorNumTuer2].l_Direction = eDirUp;
Door[eDoorNumTuer2].l_NewRoom = 14;
Door[eDoorNumTuer2].i_NewXPosition = 40;
Door[eDoorNumTuer2].i_NewYPosition = 125;
Door[eDoorNumTuer2].l_NewDirection = eDirRight;
Door[eDoorNumTuer2].s_LookAt = "Das ist die Tür zum Speisesaal.";
Door[eDoorNumTuer2].s_NewLookAt = "Da geht es wieder nach Draussen.";
Ich nehme alles zurück....
...ich sollte ne Therapie anfangen..... mit meine Türen.... ist warscheinlich der "Holzwurm drin.
hatte bei room_load nen komma drin was da nicht hingehört......
....jetzt geht alles.
Door[eDoorNumTuer1].s_NewLookAt = (das ist mein Zimmer");
if (player.PreviousRoom == 4) player.Walk(130, 175);
function hBackbordBug_AnyClick()
{
if(any_click_move(815, 80, eDirLeft))
{
if (UsedAction(eActWalkTo))
{
SetNextScreenTransition(eTransitionCrossfade);
player.ChangeRoom(10, 140, 120);
player.FaceDirection(eDirRight);
}
else if (UsedAction(eActLookAt))
{
Wait(5);
player.Say("Da geht es zur anderen Seite.");
}
else Unhandled();
}
}
function hBackbordHeck_AnyClick()
{
if(any_click_move(495, 80, eDirRight))
{
if (UsedAction(eActWalkTo))
{
SetNextScreenTransition(eTransitionCrossfade);
player.ChangeRoom(10, 505, 120);
player.FaceDirection(eDirLeft);
}
else if (UsedAction(eActLookAt))
{
Wait(5);
player.Say("Da geht es zur anderen Seite.");
}
else Unhandled();
}
}
if (player.x < 300) player.Walk(140, 120);
else player.Walk(505, 120);
Error(line5): Typ mismatch: cannot convert 'InventotyItem*'to int'
..., iGelberSchluessel, ...
...in......, iGelberSchluessel.ID, ...
...verändern.function hTuer_AnyClick()
{
if(Door[eDoorNumTuer17].ClickSpecial(2, 3, iGelberSchluessel.ID, 2) == 0 ) Unhandled();
if ( any_click_move(Door[eDoorNumTuer17].i_XPosition, Door[eDoorNumTuer17].i_YPosition, Door[eDoorNumTuer17].l_Direction) )
{
if ( UsedAction(eActUseInventory) )
{
if ( eDoorNumTuer17 && player.ActiveInventory == iGelberSchluessel )
{
eDoorLocked = false;
player.Say("Die Tür ist jetzt aufgeschlossen.");
}
else if ( !eDoorNumTuer17 && player.ActiveInventory == iGelberSchluessel )
{
eDoorLocked = true;
player.Say("Die Haustür ist jetzt abgeschlossen.");
}
else if ( eDoorNumTuer17 )
{
player.Say("Die ist abgeschlossen.");
}
}
else
if ( !eDoorNumTuer17 )
{
if ( Door[eDoorNumTuer17].Click() == 0 ) Unhandled();
}
else
{
player.Say("Die ist abgeschlossen.");
}
}
function hTuerABC_AnyClick() {
if(!Door[eDoorNumTuerABC].ClickSpecial(2, 3, iSchluessel.ID, eDoorLocked)) Unhandled();
}
function hTuer_AnyClick() {
if(Door[eDoorNumTuer17].ClickSpecial(2, 3, iGelberSchluessel.ID, 2) == 0 ) Unhandled();
}
function hTuer_AnyClick() {nur schliesst es mir die Tür nicht auf, dehalb habe ich das weitere (aus einem anderem Script) zugefügt....
if(Door[eDoorNumTuer17].ClickSpecial(2, 3, iGelberSchluessel.ID, 2) == 0 ) Unhandled();
}
...erSchluessel.ID, 2)
...in eine 0 veränderst. else if ( UsedAction(eActUseInventory) && (key >= 0) )
{
if (any_click_move(i_XPosition, i_YPosition, l_Direction) )
{
if ( charInv )
{
if ( charInv.ID == key )
{
if ( this.i_GlobalInt == eDoorLocked )
{
PlaySound(2);
o_Objekt.Visible = true;
this.i_GlobalInt = eDoorOpen;
player.LoseInventory (charInv); <-------****** (markiert) *********
}
}
else
{
if ( this.s_WrongItem != null )
{
player.Say(this.s_WrongItem);
}
else
{
player.Say(s_WrongItemStandard);
}
}
}
}
}
if(Door[eDoorNumTuer17].ClickSpecial(2, 3, iGelberSchluessel.ID, 0) == 0 ) Unhandled();
if ( UsedAction ( eActUseInventory ) && player.ActiveInventory == iGelberSchluessel ) player.LoseInventory (iGelberSchluessel);
in "GlobalScript asc.",Line 503
from "GlobalScript asc.",Line 2045
Error: Error running from 'repeatedly_execute':
Error: Array index out of bounds (index: -1, bounds: 0..26)
player.LoseInventory (iGelberSchluessel);
*siehe code von timer*// ============================= ActionBar ===========================================
function UpdateActionBar()
{
// set the text in the action bar
String madetext;
int action = global_action;
String objekt;
String item;
GUIControl *guic;
madetext = "";
objekt = SHOWNlocation;
item = "";
if (GlobalCondition (5) == 1)
{
// write SWITCH TO CHAR
action = eActSwitchTo;
guic = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
if ( null != guic )
{
if ( guic.ID == 12 )
{
objekt = character[UpperButton()].Name; <-----------line 503------
}
else
{
objekt = character[LowerButton()].Name;
}
}
}
else if (Mouse.Mode == 4)
{
// use or give inventory item
item = player.ActiveInventory.Name;
item = item.RemoveExtension();
}
else if (GlobalCondition (1) == 1)
{
// if the mouse is in the inventory and modes Walk or pickup are selected
action = eActUse;
}
madetext = TranslateAction (madetext, action, objekt, item);
// show action text
gAktionText.Text = madetext;
gAktionText.TextColor = ActionLabelColorNormal;
}
// ============================= repeatedly_execute ===========================================
// this section after on_mouse_click
#sectionstart repeatedly_execute // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute ()
{
DisplaySpeechQ_RE(); // place it before any other script code in rep. exec.
if (IsGamePaused () != 1)
{
CheckTimers ();
InventoryItem *invAt = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
// --- for the MovePlayer function ---
if (GScancelable == 1)
{
GScancelable = 0;
if ( null == invAt ) on_mouse_click (eMouseLeft);
else on_mouse_click (eMouseLeftInv);
}
else if (GScancelable == 2)
{
GScancelable = 0;
CheckDefaultAction ();
if ( null == invAt ) on_mouse_click (eMouseRight);
else on_mouse_click (eMouseRightInv);
}
CheckDefaultAction (); <-------------------------line2045-------------
UpdateActionBar ();
}
// change the arrows in the inventory to show if you
// can scroll the inventory:
//readonly InventoryItem* InvWindow.ItemAtIndex[];
InvWindow *invMain = gMainInventory;
if ( null != invMain.ItemAtIndex[0] )
{
if ( 0 != gMainInventory.TopItem )
{
// if inventory can scroll up
gMainInvUp.NormalGraphic = invUparrowONsprite;
InventoryItem *invItem = InventoryItem.GetAtScreenXY(180, 160);
if (invItem.ID < 0)
gMainInventory.ScrollUp();
}
else
gMainInvUp.NormalGraphic = invUparrowOFFsprite;
}
if ((gMainInventory.TopItem + (gMainInventory.ItemsPerRow * gMainInventory.RowCount)) < gMainInventory.ItemCount)
gMainInvDown.NormalGraphic = invDownarrowONsprite;
else
gMainInvDown.NormalGraphic = invDownarrowOFFsprite;
}
#sectionend repeatedly_execute // DO NOT EDIT OR REMOVE THIS LINE
else if (UsedAction(eActPush))
{
Wait(5);
player.Say("Also wirklich...");
}
else if (UsedAction(eActUseInventory) && player.ActiveInventory == iStock )
{
PlaySound(64);
oSchluessel.Visible = true;
Wait(15);
player.Say("Ich habe ein Schüssel gefunden.");
}
else Unhandled();
}
objekt = character[UpperButton()].Name;
ersetzen durch: if (UpperButton() >= 0) objekt = character[UpperButton()].Name;
if (Game.DoOnceOnly("oeffne schrank")) {
oSchrank.Visible = true;
}
Das, was zwischen den geschweiften Klammern steht, wird im ganzen Spiel nur einmal ausgeführt. Wichtig ist nur, dass du bei jeder einmaligen Aktion einen anderen Text in der Klammer stehen hast. Denn sobald an zwei Stellen der gleiche Text steht, werden diese als die gleiche Aktion angesehen und man kann nur eine von ihnen ausführen.if (UsedAction (eActOpen)) {
oOffenerSchrank.Visible = true;
if (Game.DoOnceOnly ("Sieh Zeugs")) {
oZeugs.Visible = true;
player.Say ("Ooooh! Zeugs!");
oZeugs.Visible = false;
player.AddInventory (iZeugs);
}
else player.Say ("Leer.");
oOffenerSchrank.Visible = false;
}
// Zustand des Schranks, 0 = verschlossen, 1 = zu, 2 = offen
int schrank;
kabel_repariert = true;
Im anderen Raum dann if (kabel_repariert) {
// licht anschalten, etc.
}
else player.Say("Ich kann nix sehen, zu dunkel hier.");
// öffnen
if (schrank == 0) player.Say("Er ist verschlossen.");
else if (schrank == 2) player.Say("Er ist schon offen.");
else {
// schrank öffnen, etc.
...
}
// use inv
if (player.ActiveInventory != iSchrankSchluessel) player.Say("Das macht keinen Sinn.");
else {
if (schrank == 1) player.Say("Ich werde den Schrank nicht wieder zuschließen, warum auch?");
else if (schrank == 2) player.Say("Ich werde den Schlüssel nicht in den Schrank legen, warum auch?");
else {
schrank = 1; // nicht verschlossen aber zu
player.Say("Der Schlüssel passt! Ich schließe den Schrank auf.");
}
}
//Zustand des Tresor, 0 = verschlossen, 1 = zu, 2 = offendesweiteren im script:
int Tresor;
function hTresor_AnyClick()
{
if (any_click_move(895, 135, eDirRight))
{
if (UsedAction(eActWalkTo))
{
// Wait(5);
}
else if (UsedAction(eActLookAt))
{
Wait(5);
player.Say("Was da wohl drin ist?");
}
else if (UsedAction(eActPickUp))
{
Wait(5);
player.Say("Das geht nicht.");
}
else if( UsedAction(eActOpen))
{
if (Tresor == 0) player.Say("Er ist verschlossen.");
else if (Tresor == 2) player.Say("Er ist schon offen.");
else if(Tresor == 1)player.Say("o.k.");
}
PlaySound(1);
oTresor.Visible = true;
if (Game.DoOnceOnly("Ein Werkzeugkasten")){
Wait(40);
player.Say("Ein Werkzeugkasten!");
Wait(20);
player.Say("Den nehme ich mal mit.");
Wait(5);
PlaySound(4);
player.AddInventory(iWerkzeug);
}
}
if (UsedAction(eActClose))
{
Wait(5);
player.Say("Der ist doch zu.");
}
else if (UsedAction(eActPull))
{
Wait(5);
PlaySound(1);
oTresor.Visible=true;
}
else if (UsedAction(eActPush))
{
Wait(5);
player.Say("Ich will nichts kaputt machen.");
}
if (player.ActiveInventory != iScluesselkarte) player.Say("Das macht keinen Sinn.");
else {
if (Tresor == 1) player.Say("Ich werde den Schrank nicht wieder zuschließen, warum auch?");
else if (Tresor == 2) player.Say("Ich werde den Schlüssel nicht in den Schrank legen, warum auch?");
else {
Tresor = 1; // nicht verschlossen aber zu
player.Say("Der Schlüssel passt! Ich schließe den Schrank auf.");
}
}
}
else if( UsedAction(eActOpen))
{
if (Tresor == 0) player.Say("Er ist verschlossen.");
else if (Tresor == 2) player.Say("Er ist schon offen.");
else if(Tresor == 1)
{
player.Say("o.k.");
PlaySound(1);
oTresor.Visible = true;
Tresor = 2; // Tresor -> "AUF"
if (Game.DoOnceOnly("Ein Werkzeugkasten"))
{
Wait(40);
player.Say("Ein Werkzeugkasten!");
Wait(20);
player.Say("Den nehme ich mal mit.");
Wait(5);
PlaySound(4);
player.AddInventory(iWerkzeug);
}
}
}
...und der Teil unten sollte wohl in die "eActUseInv"-Section (?) - also so:if (UsedAction (eActUseInv)) {
if (player.ActiveInventory != iScluesselkarte) player.Say ("Das macht keinen Sinn.");
else
{
if (Tresor == 1) player.Say("Ich werde den Schrank nicht wieder zuschließen, warum auch?");
else if (Tresor == 2) player.Say("Ich werde den Schlüssel nicht in den Schrank legen, warum auch?");
else {
Tresor = 1; // nicht verschlossen aber zu
player.Say("Der Schlüssel passt! Ich schließe den Schrank auf.");
}
}
}
else if( UsedAction(eActOpen))
{
if (Tresor == 0) player.Say("Er ist verschlossen.");
else if (Tresor == 2) player.Say("Er ist schon offen.");
else if(Tresor == 1)
{
player.Say("o.k.");
PlaySound(1);
oTresor.Visible = true;
Tresor = 2; // Tresor -> "AUF"
if (Game.DoOnceOnly("Ein Werkzeugkasten"))
{
Wait(40);
player.Say("Ein Werkzeugkasten!");
Wait(20);
player.Say("Den nehme ich mal mit.");
Wait(5);
PlaySound(4);
player.AddInventory(iWerkzeug);
}
}
}
else if (UsedAction (eActUseInventory))
{
if (player.ActiveInventory != iSchluesselkarte) player.Say ("Das macht keinen Sinn.");
else if (Tresor == 1) player.Say("Ich werde den Schrank nicht wieder zuschließen, warum auch?");
else if (Tresor == 2) player.Say("Ich werde den Schlüssel nicht in den Schrank legen, warum auch?");
else {
Tresor = 1; // nicht verschlossen aber zu
player.Say("Der Schlüssel passt! Ich schließe den Schrank auf.");
}
}
}
function oTresor_AnyClick()
{
if (any_click_move(895, 135, eDirRight))
{
if (UsedAction(eActWalkTo))
{
// Wait(5);
}
else if (UsedAction(eActLookAt))
{
Wait(5);
player.Say("Leer.");
}
else if (UsedAction(eActOpen))
{
PlaySound(1);
oTresor.Visible = true;
}
else if (UsedAction(eActClose))
{
Wait(5);
PlaySound(1);
oTresor.Visible=false;
}
else if (UsedAction(eActPush))
{
Wait(5);
PlaySound(1);
oTresor.Visible=false;
}
else if (UsedAction(eActPull))
{
Wait(5);
player.Say("Ist doch schon offen.");
}
else if (UsedAction(eActPickUp))
{
Wait(5);
player.Say("Soll den Schrank da etwa rausreißen?");
}
else if (UsedAction(eActUse))
{
Wait(5);
PlaySound(1);
oTresor.Visible=false;
}
else Unhandled();
}
}
function hTresor_AnyClick()
{
if (any_click_move(895, 135, eDirRight))
{
if (UsedAction(eActWalkTo))
{
// Wait(5);
}
else if (UsedAction(eActLookAt))
{
Wait(5);
player.Say("Was da wohl drin ist?");
}
else if (UsedAction(eActPickUp))
{
Wait(5);
player.Say("Das geht nicht.");
}
else if( UsedAction(eActOpen))
{
if (Tresor == 0) player.Say("Er ist verschlossen.");
else if (Tresor == 2) player.Say("Er ist schon offen.");
else if(Tresor == 1)
{
PlaySound(1);
oTresor.Visible = true;
Tresor = 2; // Tresor -> "AUF"
if (Game.DoOnceOnly("Ein Werkzeugkasten"))
{
Wait(40);
player.Say("Ein Werkzeugkasten!");
Wait(20);
player.Say("Den nehme ich mal mit.");
Wait(5);
PlaySound(4);
player.AddInventory(iWerkzeug);
}
}
}
if (UsedAction(eActClose))
{
Wait(5);
PlaySound(1);
oTresor.Visible=false;
}
else if (UsedAction(eActPull))
{
Wait(5);
PlaySound(1);
oTresor.Visible=true;
}
else if (UsedAction(eActPush))
{
Wait(5);
player.Say("Ich will nichts kaputt machen.");
}
else if (UsedAction (eActUseInventory))
{
if (player.ActiveInventory != iSchluesselkarte) player.Say ("Das macht keinen Sinn.");
else if (Tresor == 1) player.Say("Ist doch offen.");
else if (Tresor == 2) player.Say("Das behalte ich besser. ");
else {
Tresor = 1; // nicht verschlossen aber zu
player.Say("Jetzt ist der Tresor offen.");
}
}
}
}
...
if (Tresor == 0) player.Say("Er ist verschlossen.");
else if (Tresor == 2) player.Say("Er ist schon offen.");
else if(Tresor == 1)
{
PlaySound(1);
oTresor.Visible = true;
Tresor = 2; // Tresor -> "AUF" <----------------Tresor = 1; (ist richtig)---------------
...
else if (UsedAction(eActClose))
{
Wait(5);
PlaySound(1);
oTresor.Visible=false;
Tresor = 1; <- neu eingefügt: Status auf "ZU".
}
function hTresor_AnyClick()
{
if (any_click_move(895, 135, eDirRight))
{
if (UsedAction(eActWalkTo))
{
// Wait(5);
}
else if (UsedAction(eActLookAt))
{
Wait(5);
player.Say("Was da wohl drin ist?");
}
else if (UsedAction(eActPickUp))
{
Wait(5);
player.Say("Das geht nicht.");
}
else if( UsedAction(eActOpen))
{
if (Tresor == 0) player.Say("Er ist verschlossen.");
else if (Tresor == 2) player.Say("Er ist schon offen.");
else if(Tresor == 1) player.Say("Ist doch zu.");
{
PlaySound(1);
oTresor.Visible = true;
Tresor = 1; // Tresor -> "AUF"
if (Game.DoOnceOnly("Ein Werkzeugkasten"))
{
Wait(40);
player.Say("Ein Werkzeugkasten!");
Wait(20);
player.Say("Den nehme ich mal mit.");
Wait(5);
PlaySound(4);
player.AddInventory(iWerkzeug);
}
}
}
if (UsedAction(eActClose))
{
Wait(5);
PlaySound(1);
oTresor.Visible=false;
}
else if (UsedAction(eActPull))
{
Wait(5);
PlaySound(1);
oTresor.Visible=true;
}
else if (UsedAction(eActPush))
{
Wait(5);
player.Say("Ich will nichts kaputt machen.");
}
else if (UsedAction (eActUseInventory))
{
if (player.ActiveInventory != iStetoskop) player.Say ("Das macht keinen Sinn.");
else if (Tresor == 1) player.Say("Ist doch offen.");
else if (Tresor == 2) player.Say("Das behalte ich besser. ");
else {
Tresor = 1; // nicht verschlossen aber zu
player.Say("Jetzt ist der Tresor offen.");
}
}
}
}
function oTresor_AnyClick()
{
if (any_click_move(895, 135, eDirRight))
{
if (UsedAction(eActWalkTo))
{
// Wait(5);
}
else if (UsedAction(eActLookAt))
{
Wait(5);
player.Say("Leer.");
}
else if (UsedAction(eActOpen))
{
PlaySound(1);
oTresor.Visible = true;
}
else if (UsedAction(eActClose))
{
Wait(5);
PlaySound(1);
oTresor.Visible=false;
}
else if (UsedAction(eActPush))
{
Wait(5);
PlaySound(1);
oTresor.Visible=false;
}
else if (UsedAction(eActPull))
{
Wait(5);
player.Say("Ist doch schon offen.");
}
else if (UsedAction(eActPickUp))
{
Wait(5);
player.Say("Soll den Schrank da etwa rausreißen?");
}
else if (UsedAction(eActUse))
{
Wait(5);
PlaySound(1);
oTresor.Visible=false;
}
else Unhandled();
}
}
else if( UsedAction(eActOpen))
{
if (Tresor == 0) player.Say("Er ist verschlossen.");
else if (Tresor == 2) player.Say("Er ist schon offen.");
else if(Tresor == 1) player.Say("Ist doch zu.");
{ <------------------------------ // klammer zuviel
PlaySound(1);
oTresor.Visible = true;
Tresor = 1; // Tresor -> "AUF"
if (Game.DoOnceOnly("Ein Werkzeugkasten"))
{
Wait(40);
player.Say("Ein Werkzeugkasten!");
Wait(20);
player.Say("Den nehme ich mal mit.");
Wait(5);
PlaySound(4);
player.AddInventory(iWerkzeug);
}
}
else if(Tresor == 1) {
PlaySound(1);
oTresor.Visible = true;
Tresor = 2;
if(Game.DoOnceOnly("Ein Werkzeugkasten")) {
Wait(40);
player.Say("Ein Werkzeugkasten!");
Wait(20);
player.Say("Den nehme ich mal mit.");
Wait(5);
PlaySound(4);
player.AddInventory(iWerkzeug);
}
}
function bla() {
if (dingens) {
blablabla();
zeuch();
if (a == b) {
das_noch();
und_das_auch();
}
}
else {
wat_anderes();
}
}
function bla()
{
if (dings)
{
mach_das();
}
tu_dies();
}
function iWerkzeug_Look()
{
player.Say("Ein Werkzeugkasten.");
Wait(5);
if (Game.DoOnceOnly("Ein Schraubendreher!"))
{
Wait(5);
player.Say("...da ist ein Schraubendreher drin!");
Wait(5);
PlaySound(4);
player.AddInventory(iSchraubendreher);
}
}
function iSchraubendreher_Interact()
{
if(UsedAction(eActUse))
Wait(5);
if (Game.DoOnceOnly("Öffnen"))
{
Wait(5);
player.Say("...dann mache ich die Dose mal au.!");
Wait(5);
PlaySound(4);
player.AddInventory(iKleber02);
}
}
Beim Schraubenzieher:
function iSchraubenzieher_UseInv()
{
if (player.ActiveInventory == iKleberdose)
{
DoseOeffnen ();
}
}
Bei der Dose:
function iKleberdose_UseInv()
{
if (player.ActiveInventory == iSchraubenzieher)
{
DoseOeffnen ();
}
}
function iKleber01_UseInv()und siehe da.... ich habe eine "offene Dose" im Inventar....
{
if (player.ActiveInventory == iSchraubendreher)
{
player.Say("Die Dose ist offen.");
player.LoseInventory(iKleber01);
player.AddInventory(iKleber02);
}
}
function DoseOeffnen() {
Wait(5);
player.Say("Ich versuch mal, die Dose mit dem Schraubenzieher aufzuhebeln.");
Wait(10);
player.LoseInventory(iKleberdose);
player.AddInventory(iKleberdoseoffen);
UpdateInventory();
Wait(10);
player.Say("Es hat geklappt! Die Dose ist offen.");
}
function iKleber01_UseInv()
{
if (player.ActiveInventory == iSchraubendreher)
{
PlaySound(42);
Wait(5);
player.LoseInventory(iKleber01);
player.AddInventory(iKleber02);
Wait(15);
player.Say("Die Dose ist nun offen.");
}
}
function iKleber02_UseInv()
{
if (player.ActiveInventory == iPinsel01)
{
PlaySound(36);
Wait(5);
player.LoseInventory(iPinsel01);
player.AddInventory(iPinsel02);
Wait(15);
player.Say("Es ist Kleber am Pinsel.");
}
}
und siehe da.... ich habe eine "offene Dose" im Inventar....Ja, aber jetzt lassen sich die beiden Gegenstände "nur in eine Richtung" kombinieren.
ohne im script vom schraubendreher was zu schreiben...
function iLukenoeffner_Look()
{
player.Say("Ein Lukenöffner.");
}
function iLukenoeffner_OtherClick()
{
Unhandled_Inventory();
}
und habe schon 13MB als fertiges spiel... ist das zuviel... ??? woran mag das liegen.. ???Soooviel ist das doch gar nicht, hatten schon einige Folgen die über 30 MB gross waren (ungezippt).
//Edit:
nach langer suche habe ich den fehler gefunden....
habe im "game.DoOnceOnly" 2 mal den selben befehl gehabt.......
in 'Global.asc' Line 2060
Error:Error running function 'repeatedly_execute':
ErroR: null pointer referenced
InvWindow *invMain = gMainInventory;
if ( null != invMain.ItemAtIndex[0] )
{
if ( 0 != gMainInventory.TopItem )
{
// if inventory can scroll up
gMainInvUp.NormalGraphic = invUparrowONsprite;
InventoryItem *invItem = InventoryItem.GetAtScreenXY(180, 160);
if (invItem.ID < 0) <-----------2060---------
gMainInventory.ScrollUp();
}
else
gMainInvUp.NormalGraphic = invUparrowOFFsprite;
}
if ((gMainInventory.TopItem + (gMainInventory.ItemsPerRow * gMainInventory.RowCount)) < gMainInventory.ItemCount)
gMainInvDown.NormalGraphic = invDownarrowONsprite;
else
gMainInvDown.NormalGraphic = invDownarrowOFFsprite;
}
#sectionend repeatedly_execute // DO NOT EDIT OR REMOVE THIS LINE
// ============================= on_key_press ===========================================
if ( NULL != invItem )
{
if (invItem.ID < 0) <-----------2060---------
gMainInventory.ScrollUp();
}
player.Transparency = 100;
cSyd.EnterRoom(4, 30, 140, eDirRight);
cSyd.SetPlayer();
bool bStrom = false;unter variable extensions eingefügt, das andere im roomscript, bekomme aber eine fehlermeldung
export bStrom;
undefined symbol 'bStrom'
if ( this.i_GlobalInt == 0 )
if ( this.i_GlobalInt != 1 )
was muss ich noch machen?
Adventure Game Studio
---------------------------
An error has occurred. Please contact the game author for support, as this is likely to be a scripting error and not a bug in AGS.
(ACI version 3.20.1108)
in "GlobalScript.asc", line 593
from "GlobalScript.asc", line 687
from "GlobalScript.asc", line 1611
Error: Error running function 'game_start':
Error: Null pointer referenced
der Fehler dürfte in dieser Funktion stecken: [...]
Beim Kompilieren kommen immer Warnings, weil nach einem Stop ein return in den Dialogen vorkommt.
Die kann man einfach rauschlöschen, weil sie ja ohnehin nicht ausgeführt werden können, da der Dialog mit Stop beendet wird.
[ags]font_info = GetTranslation ("font_640: 13 14 14 14 14 14 14 14 14 14 14 14 14 14 14");[/ags]
ob da generell dieser Error kommt, wenn die 640er Auflösung vom System genommen wird. :cl
... font_info = GetTranslation ("font_640: 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4");
(Auch in den Übersetzungen.)Zumindest in der Theorie, bei 3.1.x/3.2 wird das eh nie ausgeführt, da system.screen_width immer 320 sein wird.Also das kann ich leider so nicht bestätigen.
Returns the actual screen width that the game is running at. If a graphic filter is in use, the resolution returned will be that before any stretching by the filter has been applied.
NOTE: This information is provided in case you need it to optimise your game, however please do not use it to force the player to run at a particular resolution. AGS is designed to allow players to choose different resolutions to help get the game working on their PC.
Ich hab mir mal System.ScreenWidth und system.screen_width ausgeben lassen, Vollbild oder nicht, Filter oder kein Filter, es war immer 320.
Ich weiss jetzt den Grund für den Error.Soweit war ich auch schon... Kann sein, dass ihr das nur anders Verstanden habt. Rocco hats treffender erklärt. ;)
Da meine Grafikkarte (oder System keine 320x200) mehr unterstützt, wird automatisch auf was anderes umgeschaltet.
Jetzt ist es offenbar so, dass zu dem Zeitpunkt wo system.screen_width abgefragt wird, entweder die variable noch nicht zugewiesen wurde und deswegen nichts enthält,
oder die Auflösung eine andere ist wie die abgefragten, deswegen ist keine if-abfrage wahr und in font_info ist ganz einfach nichts drinnen wenn die Funktion die Variable auslesen will,
daher der Error wegen NULL-Pointer.
Ich weiss jetzt leider auf die Schnelle keine einfache Lösung um die Variable system.screen_width auszugeben, ausser vielleicht die Ausgabe in ein TXT-File,
da ja das Spiel eben sofort beim Starten abstürzt.
If widescreen side borders are enabled, the screen width reported will include the size of these borders.
font_info = GetTranslation ("font_320: 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0");
if (System.ViewportWidth >= 640) font_info = GetTranslation ("font_640: 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4");
The only exceptions to this rule are the special tags:
$SAVEGAMEDIR$, which allows you to access files in the save game directory.
$APPDATADIR$, which allows you to write/read files to a folder on the system which is accessible by and shared by all users
Habe nochmal wegen den Savegames nachgeguckt. Es gibt den Funktionsaufruf Game.SetSaveGameDirectory("."); der als einziger den Ordner des Spiels als Speicherort verwenden kann, so wie vor AGS 3.x. Allerdings eben nur mit dieser Funktion, ansonsten wird es unter "Eigene Dateien/My Saved Games/[...]" gemacht. Also einfach bei game_start einbauen und gut ist. :)Jo, sollte aber halt schon im Starterpack drin sein, denn Newbies werden sowas kaum selbstständig einbauen. (Es hat ja auch kaum einer den Ziehe-Befehl auf die Y-Taste korrigiert... ist das eigentlich mittlerweile in allen Starterpacks behoben?)
Und beim Debug-Modus kann man sich auch streiten. Ich persönlich bin dafür, dass er standardmäßig an ist, aber wenn ihr meint, dass die Newbies das nicht selbst vorm veröffentlichen deaktiviert kriegen...Manche Newbies wissen vermutlich nichtmal, daß es überhaupt einen Debug-Modus gibt (braucht man bei der Erstellung schließlich nicht) und rechnen daher auch gar nicht damit, daß in ihrem Spiel dieser "Bug" standardmässig drin ist. Wenn sie den Modus erst einschalten müssen (sofern sie ihn überhaupt benutzen wollen - ich hab ihn jedenfalls nie benutzt), dann wissen sie zumindest daß es ihn gibt und daß er jetzt aktiviert ist.
Zu den Savegames: Wenn man in den General settings bei "Save games folder name" den text komplett entfernt, landen die Savegames auch im Ordner des Spiels.
enum KeyCodesF
{
eKeyF1 = 359, // F1
eKeyF2 = 360, // F2
eKeyF3 = 361, // F3
eKeyF4 = 362, // F4
eKeyF5 = 363, // F5
eKeyF6 = 364, // F6
eKeyF7 = 365, // F7
eKeyF8 = 366, // F8
eKeyF9 = 367, // F9
eKeyF10 = 368, // F10
eKeyF11 = 433, // F11
eKeyF12 = 434, // F12
};