setting up a 2nd monster projectile

red moon

Member
Hello,
I am looking for help on this specific situation. I am using the existing monster projectile to shoot left/right for some existing monsters (robed figures in this case) but wish to have a separate projectile that fires left only for the boss.
Each action is set to "shoot at player." If I create a new USER CONSTANT "OBJECT MONSTER 12" ...how do I set the monster object to use that constant instead of 11?

Thank you for taking the time to look at this.
 

Attachments

  • randomLR.jpg
    randomLR.jpg
    542.7 KB · Views: 1,035
  • shootleft.jpg
    shootleft.jpg
    506.7 KB · Views: 1,035
  • user.jpg
    user.jpg
    465.4 KB · Views: 1,035

axbakk

Member
I just did like this...
copied the "ShootStraight" script and changed wich gameobject that should be created to my new "fireball". Then I saved it to "ShootStraight2.asm" and assigned it to a new AI Action Step (in my case number 13).
Looks like this:

Code:
;; shoot fireball straight	
	TXA
	STA tempx
	LDA Object_movement,x
    AND #%00000111
    STA temp3
	TAY
    LDA DirectionMovementTable,y
    ORA temp3
	STA temp3
	;; get offset
    LDA Object_x_hi,x
    STA temp1
    LDA Object_y_hi,x
    STA temp2
	LDA Object_scroll,x
	STA temp
   CreateObject temp1, temp2, #$0B, #$00, temp
   
   PlaySound #SND_MONSTERSHOT
	
	LDA temp3
    STA Object_movement,x
	LDX tempx

Project Settings -----> Project Labels --------> Action Types = Change name of AI Behavior
Project Settings -----> Script Settings -------> AI Action ## = Assign script to speciffic behavior

Then you can assign that new AI Behavior to what ever you want. :D

Maybe it can be done on more easy way.. im not an expert of coding. :lol: if it is so, someone who knows a better way, please fill in. :)

Hope this helps.
 

red moon

Member
Thanks Axbakk, I will look closely at the script and see if I have any luck. I have not used shoot straight yet....I was hoping to use "move left" for the objects behavior.
 

dale_coop

Moderator
Staff member
A small tip for your boss to shoot left...
because he doesn't move (no speed and no acceleration), just set the action step to "Move Left"... he will not move but he will have the left direction... then to the next axtion step you can do Shoot (he will always shoot at left... because your boss direction is now to left ;))

You could also modify your Shoot Straight script, to shoot a differnt object (based on a constant value, yeah) instead of the normal one, when the shooter is your "boss" monster.
 

axbakk

Member
If you set ”move left ” and ”shoot straight” as action steps. As dale says it will always shoot left. 😊
 

red moon

Member
That sounds like it i will work perfectly, thank you both! That is really helpful and gives me ideas for things that hang on ceiling that may shoot down or traps in pits that can shoot up!
 

axbakk

Member
Glad i can give back and help a little. Not only ask for help. 😁 gr8 work with your game, looks really nice. 👍🏻
 

dale_coop

Moderator
Staff member
Love the work you are doing, red moon, on your game. And also the ART WORKS! I hope you will release a manual with ALL those <3
 

red moon

Member
Thank you both! I've really enjoyed working on it and bouncing ideas off the community here. Its been a rewarding experience for sure.
I should do a retro style manual, that would be a great deal of fun and a label as well for the cart!
 
Top Bottom