Help with summoning / stuff like that
Moderator: Developers
- woodmouse
- Monolich (Senior Member)
- Posts: 4586
- Joined: Wed Jul 23, 2008 3:53 pm
- Location: Finland
- Contact:
Help with summoning / stuff like that
So, I've been working on a Bargel boss battle module, where he's in monster form...
And I ran into a problem:
I can't get the summoning script to work. I just copied it from the Deamon Lord's wing script and edited the monsters it summons, but it doesn't work...
And I ran into a problem:
I can't get the summoning script to work. I just copied it from the Deamon Lord's wing script and edited the monsters it summons, but it doesn't work...
Last edited by woodmouse on Sun Dec 26, 2010 4:06 pm, edited 1 time in total.
Once upon a time, when unicorns roamed the earth...
- Zefz
- Squirrel Knight (Administrator)
- Posts: 3820
- Joined: Wed Jul 23, 2008 1:27 am
- Location: Norway
- Contact:
Probably something specific in the deamon wing script. Try sharing the summoning part here in
Code: Select all
tags.
- woodmouse
- Monolich (Senior Member)
- Posts: 4586
- Joined: Wed Jul 23, 2008 3:53 pm
- Location: Finland
- Contact:
Ok.
Code: Select all
//Summoning AI
IfStateIsCombat //Every so often
tmpargument = 10
SetTime
tmpx = selfmorale
tmpy = 8
IfXIsLessThanY //Max 6 monsters at the time -2 for each of the wings
tmpx = rand & 100
GetContent //More monsters reduces chance for summoning even more
tmpy = 16 - selfmorale *2 //Reduce with 2% for each monster summoned
IfXIsLessThanY //14% base chance if no monsters are summoned
SetTargetToNearestEnemy
tmpx = rand & 255 + targetx - 128
tmpy = rand & 255 + targety - 128
tmpdistance = rand & 100 + selfz + 25
tmpturn = rand
tmpargument = rand % 3 //Randomize monster type
SetState
IfStateIs0
tmpargument = 260 //Demon2
IfStateIs1
tmpargument = 259 //Demon
IfStateIs2
tmpargument = 98 //Ghuul
SpawnExactCharacterXYZ
tmpargument = 261 //Toast
SpawnExactParticle
tmpargument = 896 //Costs 3.5 mana points
CostTargetMana
tmpargument = 1
SendMessageNear
tmpargument = 1 //Return to combat state
SetState
Once upon a time, when unicorns roamed the earth...
- Zefz
- Squirrel Knight (Administrator)
- Posts: 3820
- Joined: Wed Jul 23, 2008 1:27 am
- Location: Norway
- Contact:
Try this:
Make sure the monster enters STATECOMBAT at some point or the whole thing won't work!
Code: Select all
//Summoning AI
IfStateIsCombat //Every so often
tmpargument = 10
SetTime
SetTargetToNearestEnemy
tmpx = rand & 255 + targetx - 128
tmpy = rand & 255 + targety - 128
tmpdistance = rand & 100 + selfz + 25
tmpturn = rand
tmpargument = rand % 3 //Randomize monster type
SetState
IfStateIs0
tmpargument = 260 //Demon2
IfStateIs1
tmpargument = 259 //Demon
IfStateIs2
tmpargument = 98 //Ghuul
SpawnExactCharacterXYZ
tmpargument = 261 //Toast
SpawnExactParticle
SetTargetToSelf
tmpargument = 896 //Costs 3.5 mana points
CostTargetMana
tmpargument = 1
SendMessageNear
tmpargument = STATECOMBAT //Return to combat state
SetState
- woodmouse
- Monolich (Senior Member)
- Posts: 4586
- Joined: Wed Jul 23, 2008 3:53 pm
- Location: Finland
- Contact:
Zefz, that thing made me get a heart attack!
I mean, that worked, but I dunno if it's a problem in the monsters or something, but when he starts summoning, instead of making new enemies, it starts cloning the player endlessly. I'm having nightmares this night.
I mean, that worked, but I dunno if it's a problem in the monsters or something, but when he starts summoning, instead of making new enemies, it starts cloning the player endlessly. I'm having nightmares this night.
Once upon a time, when unicorns roamed the earth...
Reminds me of a certain song...
["Hundertmal duplizieren" roughly translates into "Duplicate a hundred times"]...
["Hundertmal duplizieren" roughly translates into "Duplicate a hundred times"]...
- Zefz
- Squirrel Knight (Administrator)
- Posts: 3820
- Joined: Wed Jul 23, 2008 1:27 am
- Location: Norway
- Contact:
Issue 1: It duplicates the player because you are referring to the incorrect slot for the monster you want to summon in tmpargument.
Issue 2: It spams spawning because I removed the cap on number of monsters that can be summoned. Try increasing the SetTime to 500 instead of 10. (spawn once every 10 seconds instead of spawn five every second!)
Issue 2: It spams spawning because I removed the cap on number of monsters that can be summoned. Try increasing the SetTime to 500 instead of 10. (spawn once every 10 seconds instead of spawn five every second!)
- woodmouse
- Monolich (Senior Member)
- Posts: 4586
- Joined: Wed Jul 23, 2008 3:53 pm
- Location: Finland
- Contact:
Hmm, all the slot numbers are used for the monsters.Zefz wrote:Issue 1: It duplicates the player because you are referring to the incorrect slot for the monster you want to summon in tmpargument.
Issue 2: It spams spawning because I removed the cap on number of monsters that can be summoned. Try increasing the SetTime to 500 instead of 10. (spawn once every 10 seconds instead of spawn five every second!)
Once upon a time, when unicorns roamed the earth...
- woodmouse
- Monolich (Senior Member)
- Posts: 4586
- Joined: Wed Jul 23, 2008 3:53 pm
- Location: Finland
- Contact:
But... whoa. That's weird.Zefz wrote:tmpargument = 260 //Demon2
tmpargument = 259 //Demon
These two slot numbers do not exist. Slot numbers only go up to 255.
Has it always been like that? Because I remember that I used to put everything to something like 300 and they worked in 2.5x or something.
Once upon a time, when unicorns roamed the earth...
- woodmouse
- Monolich (Senior Member)
- Posts: 4586
- Joined: Wed Jul 23, 2008 3:53 pm
- Location: Finland
- Contact:
Oh.Zefz wrote:Yes, each profile is stored in an array (list) with length of 256. The slots number is the index number in that array where the profile data is stored.
...But I'm seriously sure I've used slot numbers like 300-something and they've worked...
Once upon a time, when unicorns roamed the earth...