Help with summoning / stuff like that

Help regarding development/scripting, troubleshooting or just general gameplay -- anything that hasn't already been answered in the Wiki or pinned FAQs.

Moderator: Developers

User avatar
woodmouse
Monolich (Senior Member)
Monolich (Senior Member)
Posts: 4586
Joined: Wed Jul 23, 2008 3:53 pm
Location: Finland
Contact:

Help with summoning / stuff like that

Post by woodmouse »

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...
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...
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

Probably something specific in the deamon wing script. Try sharing the summoning part here in

Code: Select all

 tags.
User avatar
woodmouse
Monolich (Senior Member)
Monolich (Senior Member)
Posts: 4586
Joined: Wed Jul 23, 2008 3:53 pm
Location: Finland
Contact:

Post by woodmouse »

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...
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

Try this:

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
Make sure the monster enters STATECOMBAT at some point or the whole thing won't work!
User avatar
woodmouse
Monolich (Senior Member)
Monolich (Senior Member)
Posts: 4586
Joined: Wed Jul 23, 2008 3:53 pm
Location: Finland
Contact:

Post by woodmouse »

Zefz, that thing made me get a heart attack! :shock:
:lol:

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. :lol:
Once upon a time, when unicorns roamed the earth...
User avatar
octagon
Darkshine Knight (Extremist fanatic)
Darkshine Knight (Extremist fanatic)
Posts: 2589
Joined: Sat Feb 20, 2010 1:07 pm

Post by octagon »

Reminds me of a certain song...
["Hundertmal duplizieren" roughly translates into "Duplicate a hundred times"]... :lol:
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

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!)
User avatar
woodmouse
Monolich (Senior Member)
Monolich (Senior Member)
Posts: 4586
Joined: Wed Jul 23, 2008 3:53 pm
Location: Finland
Contact:

Post by woodmouse »

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!)
Hmm, all the slot numbers are used for the monsters. :think:
Once upon a time, when unicorns roamed the earth...
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

tmpargument = 260 //Demon2

tmpargument = 259 //Demon

These two slot numbers do not exist. Slot numbers only go up to 255.
User avatar
woodmouse
Monolich (Senior Member)
Monolich (Senior Member)
Posts: 4586
Joined: Wed Jul 23, 2008 3:53 pm
Location: Finland
Contact:

Post by woodmouse »

Zefz wrote:tmpargument = 260 //Demon2

tmpargument = 259 //Demon

These two slot numbers do not exist. Slot numbers only go up to 255.
But... whoa. That's weird. :shock:
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. :o
Once upon a time, when unicorns roamed the earth...
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

Always been like that. Older version were even capped at 127. (hence the 0 to 127 in data.txt)
User avatar
woodmouse
Monolich (Senior Member)
Monolich (Senior Member)
Posts: 4586
Joined: Wed Jul 23, 2008 3:53 pm
Location: Finland
Contact:

Post by woodmouse »

Zefz wrote:Always been like that. Older version were even capped at 127. (hence the 0 to 127 in data.txt)
Weeeeird... :shock:

Is there a reason for that, btw?
Once upon a time, when unicorns roamed the earth...
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

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.
User avatar
woodmouse
Monolich (Senior Member)
Monolich (Senior Member)
Posts: 4586
Joined: Wed Jul 23, 2008 3:53 pm
Location: Finland
Contact:

Post by woodmouse »

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.
Oh.


...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...
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

Could be birdsey had added a code snippet that clipped all numbers above 255 to a valid number.

Also, know that in spawn.txt you no longer need to use slot numbers, you can simply use -1 for any slot number and Egoboo will fix all slots for you, preventing any slot number collisions!
Post Reply