Menu

Show posts

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 Menu

Topics - TheManInBoots

#1
I hope this has not been mentioned before, I did not find it mentioned in this forum when looking for it.

When you modify your comment and add just a word, or sometimes a small sentence, and then click on Save, you can't do it and instead the message appears:

"The body of the message has been left empty" and that's regardless of how long your message actually is.

And then I somehow try to work around it by cutting out and re-pasting passages, or writing some random stuff and then deleting it,and then sometimes it works.
Or sometimes I go back and click on the modify button of the comment again, and the second time it might work better.

It's not really reliable and doesn't always work when you do small editings.
#2
Might be both Engine or Editor related, I'll just post it here:

1) This might be long overdue, I'm sure it has been suggested before, but you cannot make audio files louder.
You can only adjust the volume lower. And that is very impractical.
If you have a single audio that is too quiet, you're in for a lot of trouble.
That's a function that would be quite useful.

2) In the Drawing Surface Manipulation I noticed that when you draw a sprite unto the Drawingsurface (using the DrawImage function) the Alphachannels are not properly imported and drawn unto a transparent drawing surface background. The outlines of the transitioning alpha show pink pixels. (And the original png file did not have a pink background at all btw).
The alternative to draw Drawing Surfaces unto Drawing Surfaces also is only very limited because you cannot choose the coordinate where to draw the surface unto. Nor stretch it.
So here the suggestion is to improve Alphachannels for the DrawImage  function and add coordinates and width/height regulation for the DrawSurface function, because their uses are too limited at the moment.
#3
HEy.

So for the project I wanted to submit for the February MAGS in the very last second the AGS editor completely gave up it's spirit!

On certain actions all of a sudden the mouse does not change it's mode anymore and stays on walk to mode all the time.

And then sometimes its start blending in and out...

I can't believe that this is a scripting error I made.

Also I can't remember having changed that much actually, just added animations and variables...

and it stopped working.


It happens when I for example click again quickly while the character talks during an interaction with an object.
Or during a room change.
Or while looking at an object twice in a row while standing in the same spot.

It's very peculiar.

And this seems more engine related.

I'm getting more and more intimidated to try ambitious, bigger projects with AGS...

But maybe someone has an idea what could cause this?


Here's a vid:

You can see that no matter how and where I click, the cursor does not change.
And 16 seconds into the video you see the cursor is starting to blink!?
Watch out though, it always automatically uses the mike for audio, turn the volume down ;)
https://streamable.com/ha8bm
#4
Edit: Actually I noticed that the offsets only happens when I rotate by certain degrees, so when I rotate 90,180,270 degrees there is no offset.

So I think I still need to experiment a little with this, since the reason does not appear to be rotating multiple times, but by what degree one rotates.

Spoiler


This was the original post

I am rotating object sprites, using dynamic sprites.

The first rotation works fine. But when I rotate it a second time, there is a little offset, it's about 33 pixels too far to the right and up.

The script I used:

In the script body:
Code: ags
DynamicSprite* shower;


Then in room after fade in:
Code: ags

shower=DynamicSprite.CreateFromExistingSprite(723, true);
shower.Rotate(90);
oindicator.Graphic =shower.Graphic;
Wait(20);

shower=DynamicSprite.CreateFromExistingSprite(723, true);
shower.Rotate(47);
oindicator.Graphic =shower.Graphic;
Wait(20);

shower=DynamicSprite.CreateFromExistingSprite(723, true);
shower.Rotate(154);
oindicator.Graphic =shower.Graphic;
Wait(20);

shower=DynamicSprite.CreateFromExistingSprite(723, true);
shower.Rotate(238);
oindicator.Graphic =shower.Graphic;
Wait(20);


So the first time it rotates normally the way I want it, too, and from the second time on there is this offset there.
I can fix it by simply moving the object 33 pixels left and down (-33 pixels on x-coordinate,  33 pixels on y-coordinate) after the first rotation, but I would like to understand why this happens in the first place, so that if I have more complicated things to rotate, I can calculate and asses exactly how big the offset is going to be, and not just fix it by eye sight and estimating the offset.
Does anyone have an idea why this happens?
It's exactly the same when I draw overlays instead of object sprites...
[close]
Thanks
#5
Hi everyone.

I would like to let specific things happen depending on the mouse movement.

For example if I move the mouse cursor to the right, a character animates and moves in a certain way, if I move the mouse up, the character animates differently and maybe moves differently.

It happened multiple times that I would have liked to be able to do that, but all my attempts failed.

Does anyone have an idea how this can be done?
#6
Hey.

In my adventure game I want to include some kind of 2 person fighter.
With a slight difference.
The main character, who flies, has to fly away from the constant attacks of the enemy character.
And after avoiding the attack quickly counter attack by clicking on the enemy.

So before creating this part I wanted to see if I can create the script more efficiently.
I have illustrations on how the game works, and a sample script how I would have scripted it.
I am open for any critic of the script or suggestions to do it completely differently or get a shorter and more efficient script.
You could even only suggest your idea on how to do it and completely ignore my script.

One can learn a lot from how other people do things.
Thanks for any ideas in advance.

(It says beginner's technical forum is for help with starting off scripts so I reckoned this is the right place to post this)

The game plan (illustrations):
Spoiler

In the first? level the screen is split into two fields.
The enemy is going to attack randomly one of the fields (announced with a title or a gui):


If you-re on the attacked field then you need to quickly move to the field that is not attacked to save yourself.


When the enemy reaches the middle of the attacked field, he changes the view to an "attack" frame, and now you have to click on him to counterattack.


If the enemy looses three lifes before you do, you move on to the next level.
If you loose all three lifes you die and have to restart the fight.

The further levels will evolve but I leave it with level 1 for simplicity's sake.
[close]

How I would have scripted it
Spoiler

Note: Apparently some space bar entries have been replaced with question marks when posting.


In Global variables I declare the following variables:



int life=3;
int enemylife=3;
int position;
int field;
int playerfield;
int currentlevel=1;
int n;
bool attackable=false;

life defines how much life the character has (starts with 3)
enemylife defines enemy's life.
position defines if the dog attacks from the left or right in level 1.
field defines which field the dog attacks (field 0 or 1 in level 1).
playerfield defines in which field the player cureently find himself in (field 0 or 1).
currentlevel defines what Level you are currently on.
n is used to run a loop later on.
attackable defines wether the monster has already reached the point where you can counterattack or not.

The game begins in a different room than the rest of the game.

before the room is loaded I put the enemy character and the attack sign gui outside the room borders so you see only the character flying.

Then in after the room fades in:
Code: ags

function room_AfterFadeIn()
{

field=Random(1); //decide which field will be attacked.
position=Random(1); //decide from which position/direction the enemy attacks
if(position==0)
? {gattack.x=...; //place the attackgui in the corresponding field.
? cEnemy.LockView(...);//Lock enemy into the right frame to attack from that position
? cEnemy.x=...;
? cEnemy.y=...;}//place the Enemy to attack from the right direction
else
? {gattack.x=...;
? cEnemy.LockView(...);
? cEnemy.x=...;
? cEnemy.y=...;}

Level[1]=Timer.Start(120);//Set Timer "Level" array 1 (stands for Level 1) to three seconds before the enemy attacks.

}


And In the Global Script:

Code: ags

// main global script file
Timer*Level[10];//Timer called "Level" to define time before enemy attacks for each level, created with Crimson Wizard's module. Level timer is exported to Global Header script
Timer*Hit;// Timer used define how long enemy stays in hitting/attack view
Timer*Waittimer[10];//Timer used when I want non-blocking Waiting time
bool avoidwrongtrigger[100];//this bool will help me differentiate different functions that are set off when the enemy finds himself on specific coordinates (see below)

function? repeatedly_execute_always() 
{

if(Timer.IsExpired(Level[1]))
? {gattack.x=-1000;//put gui out of screen
? if(field==0) 
? ? {cEnemy.move(x0,y0,eNoBlock...);//move enemy to attackpoint of field 0. The main character still has to be able to move around, so I need to do it non-blocking.
? ? avoidwrongtrigger[0]=true;}
? else 
? ? {cEnemy.move(x1,y1,eNoBlock...);//move enemy to attackpoint of field 1.
? ? avoidwrongtrigger[1]=true;}
? }

if((cEnemy.x==x0&&cEnemy.y==y0&&avoidwrongtrigger[0]==true)||(cEnemy.x==x1&&cEnemy.y==y1&&avoidwrongtrigger[1]==true))//if the enemy crosses x[sub]0[/sub],y[sub]0[/sub] or x[sub]1[/sub],y[sub]1[/sub] at any other point in the game accidentally I don't want this function to be triggered, that's why I use the avoidoverlap bool
? {
? for(n=0;n!=2;n? )
? {avoidwrongtrigger[n]=false;} //set all avoid bool arrays to false (important for later levels with more fields)
? if(field==playerfield)life=life-1;//if the character finds himself in the same field as the the attacked field he looses a life
? attackable=true;
? cEnemy.LockView(...);//Lock enemy into hitting/attacking view
? Bite=Timer.Start(40);//Start timer to unlock hit/attack view after 1 second
? cEnemy.Move(x2,y2,eNoBlock);//move enemy out of screen again
? }
//defining in which field the player finds himself in:
//level on is very easy. The screen resolution is 1600x900,so:

if(currentlevel==1)//the fields change for the upcoming levels
?? {if(cm.x<801) playerfield=0;
?? else playerfield=1;}

//how to proceed after the attack

//If both still have lifes:
if(life!=0&&enemylife!=0) Waittimer[1]=Timer.Start(40);

if(Timer.IsExpired(Waittimer[1]))
{//same script as above
field=Random(1); //decide which field will be attacked.
position=Random(1); //decide from which position/direction the enemy attacks
if(position==0)
? {gattack.x=...; //place the attackgui in the corresponding field.
? cEnemy.LockView(...);//Lock enemy into the right frame to attack from that position
? cEnemy.x=...;
? cEnemy.y=...;}
else
? {gattack.x=...;
? cEnemy.LockView(...);
? cEnemy.x=...;
? cEnemy.y=...;}
attackable=false;//make it so that you cannot attack the enemy again, until he reaches the attack point.
Level[1]=Timer.Start(120);//Set Timer "Level" array 1 (stands for Level 1) to three seconds before the enemy attacks.
}

//if player looses

if(life==0)gLoose.Visible=true;//Shows a full screen gui that pauses the game when visible. You have a funny YOU LOST image and two buttons: Quit or Retry. When you quit you change to the menu room. And when you click retry:

function Retrybutton_OnClick(GUIControl *control, MouseButton button)
{
life=3;
enemylife=3;
Waittimer=Timer.Start(1);
}

//if enemy looses

gWin.Visible=true; //Full screen gui that is as well a button. Any click on the gui will start Level two. (resetting lifes and everyting, and now starting Level[currentlevel 1]-timer)


THE COUNTERATTACK

For the counterattack I have a function that is triggered when clicking on the enemey.
In Global script I made it so that whenever you left click, the Usermode1 (mousemode8) Mouseclick is triggered at the mouse-coordinates.

So when clicking on the enemy this is what happens:
Code: ags

function cEnemy_Mode8()
{
if(attackable==true)
{
cplayer.Lockview(attackviewID);
cplayer.SetWalkspeed(50,50);
cplayer.Walk(cEnemy.x,cEnemy.y,eBlock);
aEnemyscream.Play(...);
enemylife=enemylife-1;
cplayer.Lockview(normalflyviewID);
cplayer.Walk(cEnemy.x,cEnemy.y,eBlock);
cplayer.Animte(cplayer.Loop...,eRepeat);//keep flapping the wings while in the air
}
else{}


[close]

The life bar
Spoiler


The life bar I want to create with a gui.
Every heart will be one button with a heart graphic.

Another function I will run in repeatedly execute in global script then will be:

Code: ags

function repeatedly_execute_always() 
{
if(life==0)
? {Button1.Visible=false;}
else
? {Button1.Visible=true;
? if(life==1)
? ? {Button2.Visible=false;}
? else
? ? {Button2.Visible=true;
? ? if(life==2)
? ? ? ? {Button3.Visible=false;}
? ? else
? ? ? ? {Button3.Visible=true;}
? ? }
? }
}

And then I repeat that with int monsterlife.
[close]
#7
Hi!

I was trying to use Crimson Wizard's Module "Timer 0.9", mainly so I can use more than 20 timers.

However the timer's name is only recognized within the function in which I defined the Timer.

For example:

I define the timer in global script in the game_start function:

Code: ags
Timer *MyTimer;


Then I start the timer in a different function:

Code: ags
Mytimer=Timer.Start(120, eOnce);


And I test for expiration in repeatedly execute:

Code: ags
if(Timer.IsExpired(Mytimer))
{}


All exactly as in the Module description. However the engine does not remember the "Mytimer" definition outside the function so I get an error:

Code: ags
GlobalScript.asc(494): Error (line 494): Undefined token 'Mytimer' 


I can place all the functions within the game_start function and the engine recognizes the defined term. Obviously that makes the timer unusable.

Is there something I'm not seeing here?

I imported the module normally into the scripts:



Just in case it matters I had a "pause" bool in Global variables that I eventually changed to "pause2" because the Time0.9 Module has defined something as "pause" as well.
#8
Hi!

I have been working on a game with 1600x900 dimensions and photo-realistic sprites. And now that I added a more elaborate intro animation of 500-600 sprites, the animation keeps lagging, the music is faltering and clicking, and repeating itself on one part like a damaged CD! Also I keep getting error reports like this:


Or this:



So my suggestion is to work on the procedure of especially loading Sprites into the Sprite Cache, and maybe the texturing of sprites, to make it possible to have longer-period, high resolution animations without bugs. To make it faster and not mess with the music.
In my game it is so troublesome to make it work. The animation with the lagging music is painful to watch.

For anyone who would like to do a higher resolution, higher quality game in the future, I think it would be very worthwhile to have a more solid engine and improve this part.

#9
Hi everyone!

I have been working on a game for the previous months. Now in the last steps of the process I want to see if I can improve the animated intro story, which is lagging a lot.
Because I use very high resolution animations (the game is in 1600x900, sometimes I have animations with 1600x900 sized sprites and additional animations on top of that), the animation becomes really slow and starts lagging, so that even the background music lags and cracks and pauses. And that is even before I added sound effects and voice over.
That's why I come back here again to seek help from creative, competent and inspired minds!

So far I tried changing the graphics driver to Direct3D 9, and turning "Limit display-mode to 16bit" as well as "Render sprites to screen resolution" to 'true'. I feel as if it improved the lagging a little bit, but the lagging still exists, especially during the higher resolution animations. Also, during the gameplay after the intro, I would like to animate the grass in the foreground, but doing so slows the game down. It creates lagging and the character does not move fluently anymore. (The grass covers a big area (1600x500). Also the animated grass is in the foreground so I cannot turn it into a background animation, in case you're thinking about it :) ) Increasing the sprite cache size does not work.

Are there any ways and tricks to reduce the lag or even eliminate it?

I'm aware most people don't create adventure games with those size dimensions and might not encounter this problem too often, so I'm really thankful for anyone who can help!
#10
Hello all!

What ideas do you guys have for starting an animation from a specific frame on, and not from the beginning?

I have some quirky or creative solutions, but if anyone else has their own way of doing it or any ideas, I'd be really curious to hear about it, if anyone ever came across that problem.

I would need to pause and play an animation very, very flexibly and very fast for what I'm trying to do, so the ideas I have so far are really sub-optimal.
So if you have any basic approaches  or ideas, I'd greatly appreciate it!
#11
Hi!

I just wondered if it's possible to use the current random frame that a Character is in as a Dynamic Sprite, even if the character is in the middle of an animation.

I know that you can extract the sprite of an object for a Dynamic Sprite, which would look as follows:

DynamicSprite* sprite = DynamicSprite.CreateFromExistingSprite(object[0].Graphic);

But can you do the same thing for a character?

I tried replacing (object[0].Graphic) with (character[0].Frame) or (cEgo.Frame) but that does not work, it just shows the blue cup dummy frame.
#12
Hi, I'm trying to add photos to threads but I have no clue how. When I click on the image icon I only get (img)(/img) in square brackets. I have no idea what to do with that.

And I didn't find anything about it in the forums.
#13
Hi all!

Is there a way to calculate the point of a walkable area that is closest to the character?
It would help if the character for example ends up outside the walkable area due to a random animation or view change, and so that I can correct that and make the character walk back to the walkable area in the most efficient way, especially since the walkable area is shaped in a complex way.
#14
Hi everyone!

I cannot make Adventure Game Studio function anymore for a game that I have been working on over the last months.

Each time I add at least one new Sprite and then try to save the project, I get and an error message with this bug report:



Error: Attempted to divide by zero.
Version: AGS 3.4.1.13

System.DivideByZeroException: Attempted to divide by zero. ---> System.DivideByZeroException: Attempted to divide by zero.
   at save_sprites(Boolean )
   at save_game(Boolean compressSprites)
   at AGS.Native.NativeMethods.SaveGame(Game game)
   at AGS.Editor.NativeProxy.SaveGame(Game game)
   at AGS.Editor.AGSEditor.SaveGameFilesProcess(Object parameter)
   at AGS.Editor.BusyDialog.RunHandlerOnThread()
   --- End of inner exception stack trace ---
   at AGS.Editor.BusyDialog.Show(String message, ProcessingHandler handler, Object parameter)
   at AGS.Editor.AGSEditor.SaveGameFiles()
   at AGS.Editor.Components.FileCommandsComponent.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)



I tried restarting the program, even restarting my computer, with no results. The problem remains.
Also it took quite a long time to save new files- the sprites- in the project, before the error occured, way longer than it does with new projects I work on.
I have a very high resolution for the game -1600x900- and I use high quality photos as graphics. My sprite file is a little over 2,8 GB big. I have approximately 1500 graphic files, maybe some more, around 1700, I cannot say for sure because the automatic graphic numbering of the software is not entirely regular.
I can still save projects with new Sprites when I open other projects, just with this game I have been working on for so long it does not work.

I have no idea how I could fix this problem, but I would greatly appreciate any helpful advice, I have been working on this game for a long time and I would soon finish it, but now this is holding me back.

TheManInBoots
SMF spam blocked by CleanTalk