Thanks for the information! I did some tests with the different drivers and see that there's a difference there. Good to know, thank you.
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 MenuQuote from: Crimson Wizard on Fri 06/12/2024 09:56:07Make sure you are using the new v4 script compiler. There's a Script compiler selection in General Settings -> Compiler.
Quote from: Snarky on Fri 06/12/2024 10:41:17Does this example have anything to do with the (very cool) lightning arc effect?
Quote from: Crimson Wizard on Fri 06/12/2024 10:47:50Note that with the linked list you do not have to do recursion, you may do a classic loop over linked list; pseudo-code:
for (int l = 0; l != 17; l++)
{
DrawLine(l);
}
Quote from: eri0o on Thu 05/12/2024 09:56:33Seeing this code I would refactor for something completely different, I don't have time right now, but in my head I have like an intermediary managed struct per entity with all things necessary and it's this intermediary managed struct that I would pass around to account for the lack of generics, it would be a bit verbose but I would try to repeat myself a lot only where logic is simple
function Flux(this Hotspot*)
{
//======================= initialisation=======================================================================================||
int player_energy = player.GetProperty(ENERGY);
int hotspot_energy = this.GetProperty(ENERGY);
int player_max = player.GetProperty(MAX_ENERGY);
int hotspot_max = this.GetProperty(MAX_ENERGY);
int x_coord = this.GetProperty(X_COORDINATE);
int y_coord = this.GetProperty(Y_COORDINATE);
ButtonReset(); //turn off the gui controls we have currently active and all related effects
ButtonLabel.Text = " "; //get rid of the button label text
this.HotspotWalk(); //walk to the hotspot, face the correct direction, apply any appropriate offsets and fire the default animation if one has been set
if (this.GetProperty(PROTECTED) == true) this.TakeProtection(); // first check if the hotspot has been protected from interference and remove if so
//=============================================================================================================================||
//======================== end the function if there is no energy==============================================================||
if (hotspot_energy == 0 && player_energy == 0)
{
zNoEnergy();
}
//=============================================================================================================================||
//======================== energy transfer for hotspot has energy==============================================================||
else if (hotspot_energy != 0) //if the hotspot DOES have energy
{
if (player_energy == player_max && hotspot_energy == hotspot_max)
{
zPowerFull(); //first make sure the player can take it
}
else if (player_energy == player_max && hotspot_energy != hotspot_max)//if player's at energy limit, put energy into the hotspot even if the hotspot has some energy
{
DrawPowerParticles(x_coord, y_coord, Give);
this.GivePower();
while (hotspot_energy != hotspot_max && player_energy != 0) //keep giving it until the player's energy is empty OR the hotspot can take no more power
{
this.ChangeProperty(ENERGY, 1);
hotspot_energy++;
player.ChangeProperty(ENERGY, -1);
player_energy--;
}
}
else
{
this.TakePower();//I think the reason I'm not handling DrawPowerParticles() within TakePower() & GivePower() is that the order has to be different to look right? I forget. Seems right.
DrawPowerParticles(x_coord, y_coord, Take);
while (hotspot_energy != 0 && player_energy != player_max) //then keep taking it until the player's energy is full OR the hotspot has no power left
{
this.ChangeProperty(ENERGY, -1);
hotspot_energy--;
player.ChangeProperty(ENERGY, 1);
player_energy++;
}
}
}
//=============================================================================================================================||
//======================== energy transfer for player has energy===============================================================||
else if (player_energy != 0) // the hotspot doesn't have some energy but the player does
{
if (hotspot_energy == hotspot_max) zAlreadyPowered(); // First check that the hotspot can take power
else
{
DrawPowerParticles(x_coord, y_coord, Give);
this.GivePower();
while (hotspot_energy != this.GetProperty(MAX_ENERGY) && player_energy != 0) //then keep giving it until the player's energy is empty OR the hotspot can take no more power
{
this.ChangeProperty(ENERGY, 1);
hotspot_energy++;
player.ChangeProperty(ENERGY, -1);
player_energy--;
}
}
}
//=============================================================================================================================||
//====================================================== reset ================================================================||
this.FinishHotspot();//Plays the interaction animation backwards, removes any offsets applied, resets the player's loop
//=============================================================================================================================||
}
Quote from: Jordanowen42 on Wed 04/12/2024 07:19:12I thought I was supposed to specify "BlueSphereisTakeable == true" but ChatGPT disagrees.
Quote from: Crimson Wizard on Wed 04/12/2024 01:46:33Normally anything you do in "room load" is happening prior to the first room's draw. There should not be any visible "jumps".
QuoteWhat I meant as debug was actually the setting in general settings
QuoteNo, it's not really necessary: when AGS closes it frees up all the memory anyway.
QuoteIf I remember correctly this warning is only emitted when running in debug mode (I don't remember if only when run from editor too or not).
QuoteThere's no AGS event that runs right before AGS closes as far as I remember.
QuoteThe engine reports a internal number, which is assigned automatically,
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.062 seconds with 17 queries.