int DC_UP[33];
int DC_DOWN[33];
int DC_LEFT[33];
int DC_RIGHT[33];
DC_UP[0]=0; <---ERROR
DC_DOWN[0]=1;
error: room41.asc(6): Error (line 6): Parse error: unexpected 'DC_UP'
:/
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menuint DC_UP[33];
int DC_DOWN[33];
int DC_LEFT[33];
int DC_RIGHT[33];
DC_UP[0]=0; <---ERROR
DC_DOWN[0]=1;
function repeatedly_execute_always()
{
mouse.Update(); //update the position of the mouse hopefully this tick
...
function UpdateMouseGraphic()
{
...
if (gInventory.Visible) { //looking at an icon IN THE INVENTORY
if (mouse.y >= 175 && (mouse.x <= 180 || mouse.x >= 1170) && !JustHitTabInv) {
gInventory.Visible = false;
if (player.ActiveInventory==null)
mouse.Mode = PreviousMouseModeOutsideInventory;
return;
}
...
function on_key_press(eKeyCode keycode)
{
...
if (keycode == eKeyTab) {
if (!gInventory.Visible) {
mouse.SetPosition(400, 350);
mouse.Update(); <--- plus there's this, still does nothing
gInventory.Visible=true;
PreviousMouseModeOutsideInventory=mouse.Mode;
mouse.Mode=eModeLookat;
JustHitTabInv=true;
} else{
gInventory.Visible=false;
}
}
...
function repeatedly_execute_always()
{
...
int gFloatingText_X=0;
int gFloatingText_Y=0;
// Position the floating text
if (ConversationIsOn) {
gFloatingText.X = 0;
gFloatingText.Y = 120;
} else {
if (mouse.Mode==eModeInteract) {
if ((gFloatingText.X+gFloatingText.Width)>SCREEN_WIDTH) {
Display("changing x for interact...");
gFloatingText_X = mouse.x - 64 - 5 - gFloatingText.Width; //past right-hand edge
Display("changed x for interact, it is now %d",gFloatingText_X);
gFloatingText_Y = mouse.y-30;
} else {
gFloatingText_X = mouse.x+17;
gFloatingText_Y = mouse.y-30;
}
} else {
if ((gFloatingText.X+gFloatingText.Width)>SCREEN_WIDTH) { //<--THIS CODE BLOCK RUNS.....
Display("changing x for any mode but interact...");
gFloatingText_X = mouse.x - 64 - gFloatingText.Width; //past right-hand edge
Display("TEMP VAR changed x for any mode but interact, it is now %d",gFloatingText_X);
Display("1 gfloatingtext x is %d",gFloatingText_X);
gFloatingText_Y = mouse.y-18;
} else {
gFloatingText_X = mouse.x;
gFloatingText_Y = mouse.y-18;
}
}
}
if ((gFloatingText.X+gFloatingText.Width)>SCREEN_WIDTH) Display("BEFORE ASSIGNMENT TO .X gfloatingtext x is %d from %d",gFloatingText_X, gFloatingText.X);
gFloatingText.X=gFloatingText_X;
gFloatingText.Y=gFloatingText_Y;
if ((gFloatingText.X+gFloatingText.Width)>SCREEN_WIDTH) Display("MIDDLE gfloatingtext x is %d from %d",gFloatingText_X, gFloatingText.X);
...
for (int i=1;i<=Game.InventoryItemCount;i++) {
player.ActiveInventory=inventory[i];
for (int j=1;j<=Game.InventoryItemCount;j++) {
Display("combining object index %s (%d/%d) with %s (%d/%d)",inventory[i].Name, i, Game.InventoryItemCount, inventory[j].Name, j, Game.InventoryItemCount);
Display("modeusinv interaction with %s is %d",inventory[j].Name, inventory[j].IsInteractionAvailable(eModeUseinv));
inventory[j].RunInteraction(eModeUseinv);
}
}
//add all 'starts game with' items back to empty inventory
for (int x=1; x<=Game.InventoryItemCount; x++) {
if (player.InventoryItemStartsWith[x])
player.InventoryQuantity=1;
}
function SetFloatingText(String floatingText)
{
if (ConversationIsOn) {
DrawingSurface* dsFloatingText_2 = sprtFloatingText.GetDrawingSurface();
dsFloatingText_2.Clear(COLOR_TRANSPARENT);
dsFloatingText_2.Release();
} else {
if (textContent == null)
textContent = "";
if(sprtFloatingText == null)
sprtFloatingText = DynamicSprite.Create(FLOATING_TEXT_GUI.Width, FLOATING_TEXT_GUI.Height, true);
if (floatingText != textContent) {
textContent = floatingText;
DrawingSurface* dsFloatingText = sprtFloatingText.GetDrawingSurface();
dsFloatingText.Clear(COLOR_TRANSPARENT);
if(!String.IsNullOrEmpty(textContent)) {
dsFloatingText.DrawingColor = FLOATING_TEXT_COLOR;
dsFloatingText.drawStringWrappedOutline(mouse.x,
mouse.y
FLOATING_TEXT_GUI.Width - 2*FLOATING_TEXT_OUTLINE_WIDTH,
eTextOutlineRounded,
FLOATING_TEXT_FONT,
eAlignLeft,
textContent,
0,
FLOATING_TEXT_OUTLINE_COLOR,
FLOATING_TEXT_OUTLINE_WIDTH);
}
dsFloatingText.Release();
FLOATING_TEXT_GUI.BackgroundGraphic = sprtFloatingText.Graphic;
}
}
}
...
function repeatedly_execute_always()
{
...
if (Game.GetLocationName(mouse.x, mouse.y)!=null) {
SetFloatingText(Game.GetLocationName(mouse.x, mouse.y));
}
...
}
//for gFloatingText 'description of what mouse is over'
#define FLOATING_TEXT_GUI gFloatingText
#define FLOATING_TEXT_FONT eFontSpeech
#define FLOATING_TEXT_OUTLINE_WIDTH 2
#define FLOATING_TEXT_COLOR 2047
#define FLOATING_TEXT_OUTLINE_COLOR 0
if (Parser.LastRunCommandMatched) aSound.Play(....
if (Parser.Said("eat apple")) {
....
x=true;
}
if (Parser.Said("steal apple")) {
....
x=true;
}
if (Parser.Said("get,buy drink")) {
....
x=true;
}
if (Parser.Said("steal drink")) {
....
x=true;
}
if (x) aSound.Play(...);
x=false;
DynamicSprite *buttonSavePic1;
DynamicSprite *buttonSavePic2;
DynamicSprite *buttonSavePic3;
DynamicSprite *buttonSavePic4;
function ShowSaveGUI() {
buttonSavePic1 = DynamicSprite.CreateFromSaveGame(1, 171, 96);
if (buttonSavePic1 != null) {
buttonLoad1.Visible=true;
//LabelLoad1.Visible=true;
LabelDescr1.Text=Game.GetSaveSlotDescription(1);
buttonSaveSlot1.NormalGraphic = buttonSavePic1.Graphic;
buttonSaveSlot1.Visible=true;
}
buttonSavePic2 = DynamicSprite.CreateFromSaveGame(2, 171, 96);
if (buttonSavePic2 != null) {
buttonLoad2.Visible=true;
//LabelLoad2.Visible=true;
LabelDescr2.Text=Game.GetSaveSlotDescription(2);
buttonSaveSlot2.NormalGraphic = buttonSavePic2.Graphic;
buttonSaveSlot2.Visible=true;
}
buttonSavePic3 = DynamicSprite.CreateFromSaveGame(3, 171, 96);
if (buttonSavePic3 != null) {
buttonLoad3.Visible=true;
//LabelLoad3.Visible=true;
LabelDescr3.Text=Game.GetSaveSlotDescription(3);
buttonSaveSlot3.NormalGraphic = buttonSavePic3.Graphic;
buttonSaveSlot3.Visible=true;
}
buttonSavePic4 = DynamicSprite.CreateFromSaveGame(4, 171, 96);
if (buttonSavePic4 != null) {
buttonLoad4.Visible=true;
//LabelLoad4.Visible=true;
LabelDescr4.Text=Game.GetSaveSlotDescription(4);
buttonSaveSlot4.NormalGraphic = buttonSavePic4.Graphic;
buttonSaveSlot4.Visible=true;
}
gSaveLoad.Visible = true;
}
// SAVE gSaveLoad save button functions
function buttonSave1_OnClick(GUIControl *control, MouseButton button)
{
gSaveLoad.Visible=false;
DateTime *dt = DateTime.Now;
String SaveDesc=String.Format("SLOT #1 @%02d:%02d:%02d %02d:%02d:%04d",dt.Hour, dt.Minute, dt.Second, dt.DayOfMonth, dt.Month, dt.Year);
SaveGameSlot(1, SaveDesc);
aCameraSnap.Play(eAudioPriorityNormal, eOnce);
buttonSavePic1 = DynamicSprite.CreateFromSaveGame(1, 171, 96);
Wait(GetGameSpeed()*1);
if (buttonSavePic1 != null) {
buttonSaveSlot1.NormalGraphic = buttonSavePic1.Graphic;
buttonSaveSlot1.Visible=true;
buttonLoad1.Visible=true;
//LabelLoad1.Visible=true;
LabelDescr1.Text=Game.GetSaveSlotDescription(1);
}
gSaveLoad.Visible=true;
}
function buttonSave2_OnClick(GUIControl *control, MouseButton button)
{
gSaveLoad.Visible=false;
DateTime *dt = DateTime.Now;
String SaveDesc=String.Format("SLOT #2 @%02d:%02d:%02d %02d:%02d:%04d",dt.Hour, dt.Minute, dt.Second, dt.DayOfMonth, dt.Month, dt.Year);
SaveGameSlot(2, SaveDesc);
aCameraSnap.Play(eAudioPriorityNormal, eOnce);
buttonSavePic2 = DynamicSprite.CreateFromSaveGame(2, 171, 96);
Wait(GetGameSpeed()*1);
gSaveLoad.Visible=true;
if (buttonSavePic2 != null) {
buttonSaveSlot2.NormalGraphic = buttonSavePic2.Graphic;
buttonSaveSlot2.Visible=true;
buttonLoad2.Visible=true;
//LabelLoad2.Visible=true;
LabelDescr2.Text=Game.GetSaveSlotDescription(2);
}
}
function buttonSave3_OnClick(GUIControl *control, MouseButton button)
{
gSaveLoad.Visible=false;
DateTime *dt = DateTime.Now;
String SaveDesc=String.Format("SLOT #3 @%02d:%02d:%02d %02d:%02d:%04d",dt.Hour, dt.Minute, dt.Second, dt.DayOfMonth, dt.Month, dt.Year);
SaveGameSlot(3, SaveDesc);
aCameraSnap.Play(eAudioPriorityNormal, eOnce);
buttonSavePic3 = DynamicSprite.CreateFromSaveGame(3, 171, 96);
Wait(GetGameSpeed()*1);
gSaveLoad.Visible=true;
if (buttonSavePic3 != null) {
buttonSaveSlot3.NormalGraphic = buttonSavePic3.Graphic;
buttonSaveSlot3.Visible=true;
buttonLoad3.Visible=true;
//LabelLoad3.Visible=true;
LabelDescr3.Text=Game.GetSaveSlotDescription(3);
}
}
function buttonSave4_OnClick(GUIControl *control, MouseButton button)
{
gSaveLoad.Visible=false;
DateTime *dt = DateTime.Now;
String SaveDesc=String.Format("SLOT #4 @%02d:%02d:%02d %02d:%02d:%04d",dt.Hour, dt.Minute, dt.Second, dt.DayOfMonth, dt.Month, dt.Year);
SaveGameSlot(4, SaveDesc);
aCameraSnap.Play(eAudioPriorityNormal, eOnce);
buttonSavePic4 = DynamicSprite.CreateFromSaveGame(4, 171, 96);
Wait(GetGameSpeed()*1);
gSaveLoad.Visible=true;
if (buttonSavePic4 != null) {
buttonSaveSlot4.NormalGraphic = buttonSavePic4.Graphic;
buttonSaveSlot4.Visible=true;
buttonLoad4.Visible=true;
//LabelLoad4.Visible=true;
LabelDescr4.Text=Game.GetSaveSlotDescription(4);
}
}
// LOAD gSaveLoaad load button functions
function buttonLoad1_OnClick(GUIControl *control, MouseButton button)
{
gSaveLoad.Visible=false;
RestoreGameSlot(1);
GameJustRestored=1;
}
function buttonLoad2_OnClick(GUIControl *control, MouseButton button)
{
gSaveLoad.Visible=false;
RestoreGameSlot(2);
GameJustRestored=2;
}
function buttonLoad3_OnClick(GUIControl *control, MouseButton button)
{
gSaveLoad.Visible=false;
RestoreGameSlot(3);
GameJustRestored=3;
}
function buttonLoad4_OnClick(GUIControl *control, MouseButton button)
{
gSaveLoad.Visible=false;
RestoreGameSlot(4);
GameJustRestored=4;
}
// click save icon in giconbar
function btnIconSave_OnClick(GUIControl *control, MouseButton button)
{
gPanel.Visible = false;
gIconbar.Visible = false;
mouse.UseModeGraphic(eModePointer);
ShowSaveGUI();
}
// click load icon in gIconbar
function btnIconLoad_Click(GUIControl* control, MouseButton button)
{
gPanel.Visible=false;
gIconbar.Visible=false;
gSaveLoad.Visible=true;
mouse.UseModeGraphic(eModePointer);
}
function SoundDistDS(int x, int y, int radius, int minVolume)
{
int Volume=0;
int dx = 610 - x; //hard coded in pos of darkseeds sign
int dy = 515 - y;
int d_squared = dx*dx + dy*dy;
if(d_squared >= (radius * radius))
Volume = minVolume;
else
Volume = FloatToInt(100.0 - (Maths.Sqrt(IntToFloat(d_squared))/IntToFloat(radius)) * (100.0 - IntToFloat(minVolume)));
return Volume;
}
function PlaySoundDS(int animFrame)
{
switch (animFrame) {
case 0: ds_chan=aNeon_1.Play(eAudioPriorityNormal, eOnce);break;
case 1: ds_chan=aNeon_2.Play(eAudioPriorityNormal, eOnce);break;
case 2: ds_chan=aNeon_1.Play(eAudioPriorityNormal, eOnce);break;
case 3: ds_chan=aNeon_2.Play(eAudioPriorityNormal, eOnce);break;
case 4: ds_chan=aNeon_1.Play(eAudioPriorityNormal, eOnce);break;
case 5: ds_chan=aNeon_2.Play(eAudioPriorityNormal, eOnce);break;
case 6: ds_chan=aNeon_1.Play(eAudioPriorityNormal, eOnce);break;
case 7: ds_chan=aNeon_2.Play(eAudioPriorityNormal, eOnce);break;
case 8: ds_chan=aNeon_1.Play(eAudioPriorityNormal, eOnce);break;
case 9: ds_chan=aNeon_2.Play(eAudioPriorityNormal, eOnce);break;
case 10: ds_chan=aNeon_3.Play(eAudioPriorityNormal, eOnce);break;
case 11: break;
case 12: break;
case 13: break;
}
ds_chan.Volume=SoundDistDS(cJulius.x, cJulius.y, 300, 3);
}
function late_repeatedly_execute_always()
{
//Display("wa %d, yctr %d", wa, yctr);
wa++;
if (wa>20) {
wa=0;
yctr++;
if (yctr>13)
yctr=0;
ViewFrame *vf;
vf=Game.GetViewFrame(10, 0, yctr);
oDarkSeedsSign.Graphic=vf.Graphic;
PlaySoundDS(yctr);
}
}
function room_Load()
{
...
oDarkSeedsSign.SetView(10);
wa=0;//global
yctr=0;//global
...
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.047 seconds with 14 queries.