Would anyone accept a commision to add features to this existing module or create a new tile engine with additional features?
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 MenuError: The operation was canceled by the user
Version: AGS 3.5.0.24
System.Exception: The operation was canceled by the user ---> System.ComponentModel.Win32Exception: The operation was canceled by the user
at AGS.Editor.Tasks.RunEXEFile(String exeName, String parameter, Boolean raiseEventOnExit)
at AGS.Editor.Tasks.TestGame(Boolean withDebugger)
at AGS.Editor.InteractiveTasks.TestGame(Boolean withDebugger)
--- End of inner exception stack trace ---
at AGS.Editor.InteractiveTasks.TestGame(Boolean withDebugger)
at AGS.Editor.Components.BuildCommandsComponent.TestGame(Boolean withDebugger)
at AGS.Editor.Components.BuildCommandsComponent.CommandClick(String controlID)
at AGS.Editor.ToolBarManager.ToolbarEventHandler(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at AGS.Editor.ToolStripExtended.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Quote from: Snarky on Thu 14/03/2019 09:51:23
Just FYI, the way many games get around the room limit is to reuse the same room, just with different "decoration" depending on what room it's meant to represent. If several rooms have the same general layout (walkable area), you can vary the appearance and interaction using objects that you set to different sprites (and respond to based on logic that takes the "virtual room number" into account).
if (mouse.IsButtonDown(eMouseLeft)) {
DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
surface.DrawingColor = 14;
surface.DrawImage(GetViewportX()+236,GetViewportY()+175 , 563, 0, 9, 99);
surface.Release();
bGreenDot.X = viewportX/75 + (bGreenDot.Width) /5;
bGreenDot.X = viewportX/80 - (bGreenDot.Width) /5;
BEnemy1.X = cEnemy1.x/50 + (BEnemy1.Width) / 5;
BEnemy1.Y = cEnemy1.y/50 + (BEnemy1.Width) / 5;
bGreenDot.X = viewportX/50 + (bGreenDot.Width) /5;
bGreenDot.Y = viewportY/50 - (bGreenDot.Width) /5;
if (mouse.IsButtonDown(eMouseLeft) && phaser1_onscreen==false){
object[0].Visible=true; //laser beam
object[0].Move(220 , 0, 5, eNoBlock, eAnywhere); //laser beam
SetTimer(3, 50); //timer to give laser beam enough time to move off screen
phaser1_onscreen=true; //Book to say the laser is on screen
}
else if (mouse.IsButtonDown(eMouseLeft) && phaser1_onscreen==true) {
}
if (IsTimerExpired(3)) {
object[0].Visible=false; //Hide the laser Laser Beam
object[0].SetPosition(220, 267); // Reset Laser Beam Location at Bottom
phaser1_onscreen=false; //reset bool that laser beam is no longer moving on screen
}
center x coordinate is GetViewportX() + Screen.ViewportWidth / 2
BEnemy1.X = cEnemy1.x/75 + (BEnemy1.Width) / 5;
BEnemy1.Y = cEnemy1.y/80 + (BEnemy1.Width) / 5;
bGreenDot.X = mouse.x/75 + (bGreenDot.Width) / 5;
bGreenDot.Y = mouse.y/80 + (bGreenDot.Width) / 5;
roomX = screenX + GetViewportX();
screenY = roomY - GetViewportY();
BEnemy1.X = cEnemy1.x/50 + (BEnemy1.Width) / 5;
BEnemy1.Y = cEnemy1.y/50 + (BEnemy1.Width) / 5;
bGreenDot.X = viewportX/50 + (bGreenDot.Width) /5;
bGreenDot.Y = viewportY/50 - (bGreenDot.Width) /5;
BEnemy1.X = cEnemy1.x/75 + (BEnemy1.Width) / 5;
BEnemy1.Y = cEnemy1.y/80 + (BEnemy1.Width) / 5;
bGreenDot.X = mouse.x/75 + (bGreenDot.Width) / 5;
bGreenDot.Y = mouse.y/80 + (bGreenDot.Width) / 5;
BEnemy1.X = cEnemy1.x/75 + (BEnemy1.Width) / 5;
BEnemy1.Y = cEnemy1.y/80 + (BEnemy1.Width) / 5;
bGreenDot.X = mouse.x/75 + (BEnemy1.Width) /5;
bGreenDot.X= mouse.y/75 + (BEnemy1.Width) /5;
// room script file
//Functions
bool modeWasFlipped;
function Nav_Mode ()
{
Bridge_Battle=true;
mouse.Visible=false;
gTargetCursor.Visible=true;
gTargetCursor.Centre();
//cEgo.Transparency=100;
cEgo.Transparency=0;
mouse.Mode=eModeInteract;
gGui1.Visible=true;
}
function Cursor_Mode ()
{
Bridge_Battle=false;
Mouse.Mode=eModePointer;
mouse.Visible=true;
gTargetCursor.Visible=false;
cEgo.Transparency=100;
}
int centerX, centerY, wrapWidth=1, wrapHeight=1, viewportX, viewportY;
//BEFORE ROOM LOAD SCRIPTS
function room_Load()
{
BattleMode=true;
mouse.Mode=eModeInteract;
Nav_Mode();
// Just calculate some useful values:
centerX = System.ViewportWidth/2;
centerY = System.ViewportHeight/2;
wrapWidth = Room.Width - System.ViewportWidth;
wrapHeight = Room.Height - System.ViewportHeight;
}
// Moved all the stuff to do with the battle into its own function, to keep things tidy
void updateBattle()
{
// TODO: Update ships and stuff
mouse.Update(); // This makes sure we get the most up-to-date mouse coordinates
// Calculate viewport scrolling
int moveX = mouse.x - centerX;
int moveY = mouse.y - centerY;
// Move viewport, wrapping around
viewportX = (viewportX + moveX + wrapWidth) % wrapWidth;
viewportY = (viewportY + moveY + wrapWidth) % wrapWidth;
SetViewport(viewportX, viewportY);
mouse.SetPosition(centerX, centerY);
}
//scripts that repeatedly fire
function room_RepExec() {
if (cEnemy1.Room == 2) {
if (cEnemy1.Moving == false) {
cEnemy1.Walk(Random(Room.Width), Random(Room.Height));
}
}
///RADAR Enemy 1
BEnemy1.X = cEnemy1.x/75 + (BEnemy1.Width) / 5;
BEnemy1.Y = cEnemy1.y/80 + (BEnemy1.Width) / 5;
bGreenDot.X = mouse.x/75 + (BEnemy1.Width) /5;
bGreenDot.X= mouse.y/75 + (BEnemy1.Width) /5;
//lOCK Mouse to follow mouse
cEgo.x = mouse.x;
cEgo.y = mouse.y;
// Testing script to exit game
//Hot ket to find enemy
if (IsKeyPressed(eKeyT)){
SetViewport(cEgo.x, cEgo.y);
}
if (IsKeyPressed(eKeyEscape)) {
QuitGame(0);
}
//End of Testing Script
if(IsKeyPressed(eKeyZ))
{
// We only switch mode if we haven't already done so during this keypress
if(modeWasFlipped == false) // another way to write this is just: if(!modeWasFlipped)
{
if(Bridge_Battle == true) // or just: if(Bridge_Battle)
Cursor_Mode();
else
Nav_Mode();
modeWasFlipped = true; // We've switched mode, so set the flag
}
} // End: IsKeyPressed(eKeyZ)
else // the key is released, so we reset the flag
modeWasFlipped = false;
if(Bridge_Battle == true) // Same: if(Bridge_Battle)
updateBattle();
}
QuoteI take it what you're trying to achieve is some kind of space combat sim, sort of like Wing Commander, only from the viewpoint of the gunport of a "stationary" ship (so that you can't actually fly around dogfighting)?
Quote"Have some intelligent movement going on" â€" What do you mean by this? What sort of movement and behavior do you want from them?
As you've currently coded it, they fly in a straight line from Point A to Point B, then immediately "bounce" and head in some other straight line to Point C. Is that the sort of movement you want, or do you want to try to get something that seems more physically realistic?
You don't have any notion of "distance" to the ships, they're all moving along a flat invisible surface in space (or, I guess technically around the surface of an invisible sphere with you in the center, assuming that's what the wraparound effect is mean to simulate). Is that OK, or do you want ships to come closer and move further away from you?
QuoteAnd another observation that raises further questions: Since your visible screen is only a small part of the whole room, ships will often be outside of the visible region. Should they still behave the same way when out of view? Should they be able to attack even when you can't see them, for example? Should new ships only spawn in the visible part of the room, or anywhere? Do you need some kind of indicator letting you know where they are?
QuoteNo nowhere near comfortable enough coding it that way or good enough at math to do it that way. Besides faking it out even though less perfect will go with the retro look of the rest of the game like other games from that era did.
QuoteDecision 2: Implement any kind of "AI"
Enemy intelligence in games is usually pretty simple. The most common way is to give each enemy a few different "states" to switch between. In each state they follow some particular simple rule of what to do, and then they switch to another state when some condition is fulfilled. For example, ships could have states like "circling", "dodging", "distracting", "attacking" and "fleeing". Here, "circling" would be some variation of the "random movement" you already have implemented. "Dodging" would tell it to change direction more often, maybe speed up. "Distracting" would head towards the region of your viewport, close to but not directly under the targeting aim. "Attacking" would carry out an attack (if you have several, just pick one at random), and "Fleeing" would, well, flee (maybe engaging cloaking if available).
Then you have a rule that says, for example: If you're in the "circling" state and the player shoots somewhere closer than 10 pixels from you, switch to the "dodging" state. And another rule that says: If you've been in the circling state for more than 40 seconds, switch to the "attack" state. And another that says: If the player attacks another ship and its health/shield level is less than 33%, and you're less than 300 pixels away, go to the "distract" state. And so on. You add rules for transitioning from each state to each of the other states that make sense. (Usually you have at least a transition back to the "default" state, "circling", from every other state.)
The collection of states and rules for transitioning between them is called a state machine, and is very common for this kind of task. You can achieve surprisingly complex, "intelligent" behaviors with just a few states, some very basic behaviors in each state, and smart rules for transitioning between them.
if (cRomulanShip.Room == player.Room) {
if (cRomulanShip.Moving == false) {
cRomulanShip.Walk(Random(Room.Width), Random(Room.Height));
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.040 seconds with 15 queries.