Aerisetta
Active member
Hi, I tried using ChatGPT to write scripts, I wonder if it makes sense or is just gibberish
my input
write a script for an attack that freezes all enemies and hits all enemies on the screen then unfreeze the enemies for openbor
the output
Here is a script in OpenBOR that will make an attack that freezes all enemies, hits all enemies on the screen, and then unfreezes the enemies:
Copy code
#include "global.h"
void FreezeHitAllEnemies()
{
int i;
// Freeze all enemies
for(i=0; i<MAX_ENEMIES; i++)
{
if(enemies.health > 0)
{
enemies.freeze = 1;
}
}
// Wait for a moment to allow the freeze effect to take place
wait(30);
// Hit all enemies
for(i=0; i<MAX_ENEMIES; i++)
{
if(enemies.health > 0 && enemies.freeze == 1)
{
enemies.health = 0;
enemies.hitby = playerindex;
enemies.hitdir = player[playerindex].facedir;
}
}
// Wait for a moment to allow the hit effect to take place
wait(30);
// Unfreeze all enemies
for(i=0; i<MAX_ENEMIES; i++)
{
if(enemies.freeze == 1)
{
enemies.freeze = 0;
}
}
}
This script uses for loop to iterate through all the enemies in the game. First, it sets the freeze variable for all enemies to 1, which will freeze them. Then, it waits for a moment to allow the freeze effect to take place. Next, it checks if the health of the enemies are greater than 0 and they are frozen, it sets their health to 0 (killing them) and sets the "hitby" and "hitdir" variables to the player's index and facing direction. After that, it waits for a moment to allow the hit effect to take place. Finally, it sets the freeze variable for all enemies to 0, which will unfreeze them.
You can call this function whenever you want the player to perform the attack that freezes all enemies, hits all enemies on the screen, and then unfreezes the enemies.
Please be aware that this is a basic example, and you may need to adjust or extend the script depending on your particular game and needs.
my input
write a script for an attack that freezes all enemies and hits all enemies on the screen then unfreeze the enemies for openbor
the output
Here is a script in OpenBOR that will make an attack that freezes all enemies, hits all enemies on the screen, and then unfreezes the enemies:
Copy code
#include "global.h"
void FreezeHitAllEnemies()
{
int i;
// Freeze all enemies
for(i=0; i<MAX_ENEMIES; i++)
{
if(enemies.health > 0)
{
enemies.freeze = 1;
}
}
// Wait for a moment to allow the freeze effect to take place
wait(30);
// Hit all enemies
for(i=0; i<MAX_ENEMIES; i++)
{
if(enemies.health > 0 && enemies.freeze == 1)
{
enemies.health = 0;
enemies.hitby = playerindex;
enemies.hitdir = player[playerindex].facedir;
}
}
// Wait for a moment to allow the hit effect to take place
wait(30);
// Unfreeze all enemies
for(i=0; i<MAX_ENEMIES; i++)
{
if(enemies.freeze == 1)
{
enemies.freeze = 0;
}
}
}
This script uses for loop to iterate through all the enemies in the game. First, it sets the freeze variable for all enemies to 1, which will freeze them. Then, it waits for a moment to allow the freeze effect to take place. Next, it checks if the health of the enemies are greater than 0 and they are frozen, it sets their health to 0 (killing them) and sets the "hitby" and "hitdir" variables to the player's index and facing direction. After that, it waits for a moment to allow the hit effect to take place. Finally, it sets the freeze variable for all enemies to 0, which will unfreeze them.
You can call this function whenever you want the player to perform the attack that freezes all enemies, hits all enemies on the screen, and then unfreezes the enemies.
Please be aware that this is a basic example, and you may need to adjust or extend the script depending on your particular game and needs.