Author Topic: Danmakufu Q&A/Problem Thread II  (Read 107096 times)

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread II
« Reply #990 on: January 25, 2010, 12:49:21 AM »
(GetCenterX*2,GetCenterY*2)

How did I not think of that?

Next question: Can I use Obj_IsIntersected to check for collisions with the player? I'll worry about that one later; more pressing matters are at hand.
Code: [Select]
task LayoutSet{
HoriWall(GetCenterX*2/5,GetCenterX*2/5,GetCenterX*2/5,WHITE47);
HoriWall(GetCenterX*6/5,GetCenterX*2/5,GetCenterX*2/5,WHITE47);
HoriWall(GetCenterX*2/5,GetCenterY*2-GetCenterX*2/5,GetCenterX*2/5,WHITE47);
HoriWall(GetCenterX*6/5,GetCenterY*2-GetCenterX*2/5,GetCenterX*2/5,WHITE47);
HoriWall(GetCenterX*4/5,GetCenterY+GetCenterX/5,GetCenterX*2/5,WHITE47);
HoriWall(GetCenterX*4/5,GetCenterY-GetCenterX/5,GetCenterX*2/5,WHITE47);
VertWall(GetCenterX*2/5,GetCenterX*2/5,GetCenterY*2-GetCenterX*4/5,WHITE47);
VertWall(GetCenterX*6/5,GetCenterX*2/5,GetCenterY*2-GetCenterX*4/5,WHITE47);
VertWall(GetCenterX*4/5,GetCenterY+GetCenterX/5,GetCenterX*2/5,WHITE47);
VertWall(GetCenterX*4/5,GetCenterY-GetCenterX/5,GetCenterX*2/5,WHITE47);
}

task HoriWall(x,y,length,graphic){
let hwall = Obj_Create(OBJ_LASER);
Obj_SetPosition(hwall,x,y);
Obj_SetAngle(hwall,0);
ObjShot_SetGraphic(hwall,graphic);
ObjLaser_SetLength(hwall,length);
ObjLaser_SetWidth(hwall,10);
ObjLaser_SetSource(hwall,false);
ObjShot_SetBombResist(hwall,true);
ObjShot_SetDelay(hwall,60);
}

task VertWall(x,y,length,graphic){
let vwall = Obj_Create(OBJ_LASER);
Obj_SetPosition(vwall,x,y);
Obj_SetAngle(vwall,90)
ObjShot_SetGraphic(vwall,graphic);
ObjLaser_SetLength(vwall,length);
ObjLaser_SetWidth(vwall,10);
ObjLaser_SetSource(vwall,false);
ObjShot_SetBombResist(vwall,true);
ObjShot_SetDelay(vwall,60);
}

task ReflectPod(angle){
let reflect = Obj_Create(OBJ_SHOT);
Obj_SetPosition(reflect,GetX,GetY);
Obj_SetAngle(reflect,angle);
ObjShot_SetGraphic(reflect,ORANGE02);
Obj_SetSpeed(reflect,1);
ObjShot_SetBombResist(reflect,true);
Obj_SetCollisionToPlayer(reflect,false);
while(!Obj_BeDeleted(reflect)){
if(Collision_Obj_Obj(reflect,hwall)==true{
Obj_SetAngle(reflect,-angle);
}
if(Collision_Obj_Obj(reflect,vwall)==true{
Obj_SetAngle(reflect,180-angle);
}
if(Obj_GetX(reflect)<=0||Obj_GetX(reflect)>=GetCenterX*2){
Obj_SetAngle(reflect,180-angle);
}
if(Obj_GetY(reflect)<=0||Obj_GetY(reflect)>=GetCenterY*2){
Obj_SetAngle(reflect,-angle);
}
if(reflecttime==2700){
explosion(Obj_GetX(reflect),Obj_GetY(reflect));
Obj_Delete(reflect);
}
reflecttime++;
wait(1);
}
}

On attempting to run a script with this section of code in it, I get the following:
---------------------------
ScriptError「C:\Users\ASN\Downloads\th_dnh\script\AweScript\ReflectionSniper.txt」
---------------------------
hwallは未定義の識別子です(392行目)

         if(Collision_Obj_Obj(reflect,hwall)==true{
            Obj_SetAngle(reflect,-angle);
         }
         if(Collision_Obj_Obj(reflect,vwall)
~~~
---------------------------
OK   
---------------------------
I know there are several hwalls in play by the time this will happen. What's wrong?

(LayoutSet is run once at the beginning of the card. ReflectPod is run at regular intervals.)
« Last Edit: January 25, 2010, 04:39:48 AM by AweStriker Nova »

Drake

  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #991 on: January 25, 2010, 06:16:12 AM »
They have to be defined in the same task. hwall isn't a variable inside of ReflectPod, just in HoriWall.



I have effects such as the red magic circle that are with the boss at all times. However, every time an attack is finished and another starts, the circle resets to the default angle and does the startup animation. I want it to have fluid motion throughout the entire fight. In addition, at the end of the fight, many effects freeze (object effect freeze on finalize) or disappear (child enemies). This is also very bad and must be avoided.

A totally possible solution is adding CommonData and passing it between attacks. But this is a retarded cop-out solution to this and I don't want to have to deal with it.

The other solution would be to create an entirely separate enemy. Although obviously if it's set as a child enemy, it will disappear like the rest. I presume that it would be possible to have the effects controlled by the parent enemy and control the main boss as the child, but the problem is that plural files cannot be passed through the Create series and other miscellaneous problems arise.

How the hell would I do this?

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Stuffman

  • *
  • We're having a ball!
Re: Danmakufu Q&A/Problem Thread II
« Reply #992 on: January 25, 2010, 06:44:48 AM »
Pass boss position to commondata constantly, and make the circle into part of the stage @background?

Also I am pretty sure it is impossible to avoid the freeze on @finalize if it's part of the boss.

Kylesky

  • *The Unknown*
  • Local Unbalanced Danmakufu Idiot Scripter
    • My useless youtube account... (will be useful in the future *I promise*)
Re: Danmakufu Q&A/Problem Thread II
« Reply #993 on: January 25, 2010, 09:23:34 AM »
Also I am pretty sure it is impossible to avoid the freeze on @finalize if it's part of the boss.

is it possible to just put
if(GetLife<1){Obj_Delete(whatever);}
???

it's extremely rare that you're able to get the enemy's life to 0.___ anyway... I'm just not that sure if that'll be able to delete it before the enemy dies...
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread II
« Reply #994 on: January 25, 2010, 01:43:27 PM »
is it possible to just put
if(GetEnemyLife<1){Obj_Delete(whatever);}
???

it's extremely rare that you're able to get the enemy's life to 0.___ anyway... I'm just not that sure if that'll be able to delete it before the enemy dies...

Kylesky

  • *The Unknown*
  • Local Unbalanced Danmakufu Idiot Scripter
    • My useless youtube account... (will be useful in the future *I promise*)
Re: Danmakufu Q&A/Problem Thread II
« Reply #995 on: January 25, 2010, 02:49:53 PM »
whoops... sorry ;D
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

Re: Danmakufu Q&A/Problem Thread II
« Reply #996 on: January 26, 2010, 01:30:06 AM »
is it possible to just put
if(GetLife<1){Obj_Delete(whatever);}
???

it's extremely rare that you're able to get the enemy's life to 0.___ anyway... I'm just not that sure if that'll be able to delete it before the enemy dies...

So rare that it's not possible. When the life of an enemy is less than 1, it proceeds to @Finalize and then deletes the enemy. I know people think "when the enemy has 0 or less than 0 life", but it's actually when the enemy has anything less than 1.



@Drake:
Make it an object effect if it isn't one already, spawn it through the stage (like the explosion effects and items), use GetEnemyX, GetEnemyY, while(IsBossExisting){}, etc. If the circle runs through the stage's yield tree it won't freeze on the boss' @Finalize.

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem Thread II
« Reply #997 on: January 26, 2010, 01:35:47 AM »
Also, before someone says it, checking if GetLife<2 won't work either. If the enemy has, say, 3 health and your shot does 2.1 or more damage, then that check won't be executed. There's really no way to achieve what you want without using common data.

(Also, a small note regarding something this reminded me of. The @Missed loop in player scripts runs once per frame while the player is dead, not just once. So if you have problems with the hitbox freezing, homing shots going straight, etc. during the death animation, just stick yield; in @Missed.)

Re: Danmakufu Q&A/Problem Thread II
« Reply #998 on: January 26, 2010, 01:42:21 AM »
(Also, a small note regarding something this reminded me of. The @Missed loop in player scripts runs once per frame while the player is dead, not just once. So if you have problems with the hitbox freezing, homing shots going straight, etc. during the death animation, just stick yield; in @Missed.)

@Missed runs for 75 frames, which is the amount of time it takes for you to spawn. Eff why eye.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread II
« Reply #999 on: January 26, 2010, 01:43:09 AM »
So rare that it's not possible. When the life of an enemy is less than 1, it proceeds to @Finalize and then deletes the enemy. I know people think "when the enemy has 0 or less than 0 life", but it's actually when the enemy has anything less than 1.

That can't be right. If you put SetLife(1); in @Initialize, and press h (which takes off 10% life) during the script, the boss won't die. Although the health bar will drop to 0 (probably cause Danmakfu floored the float rather than rounded it), the boss won't die until you press h another 9 times.
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread II
« Reply #1000 on: January 26, 2010, 01:48:49 AM »
1000th post... we need a new topic...
This happens on my survival cards (see my Ex Riolu boss)

Re: Danmakufu Q&A/Problem Thread II
« Reply #1001 on: January 26, 2010, 01:51:14 AM »
I have no idea where I read that, but I swear I read it in some documentation somewhere >: |

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread II
« Reply #1002 on: January 26, 2010, 01:55:01 AM »
New thread.

Someone, please lock this thread.