Page 3 of 6

Posted: Tue Aug 12, 2008 10:30 pm
by penguinflyer5234
She is making a fountain...
So I think she means that there are lots of particles at the same time, but the die as well.

Posted: Tue Aug 12, 2008 10:35 pm
by penguinflyer2222
Ok, I think it's like that already, but I didn't know it would keep going.
Thanks for your help.

Posted: Tue Aug 19, 2008 11:41 pm
by PurpleSquerkle
Can someone help me with this script (it's for the Templar Hero Class)?

Code: Select all

IfSpawned
  tmpargument = 0
  SetState

IfUsed
  tmpargument = 0
  IfStateIs
    tmpargument = 0
    SpawnParticle
    tmpargument = 1
    SetState
  Else
    tmpargument = 1
    IfStateIs
      tmpargument = 4
      SpawnParticle
      tmpargument = 2
      SetState
    Else
      tmpargument = 4
      SpawnParticle
      tmpargument = 0
      SetState
It's supposed to spawn particle 0 the first time it's used, and then spawn particle 4 the next two times it's used, then go back to 0, etc.

But the way it is now, after it cycles through once, it spawns particle 0 EVERY time, as well as either particle 4 or ANOTHER particle 0.

Help?

Posted: Wed Aug 20, 2008 12:38 am
by bgbirdsey
You can use the Set_XY and Get_XY functions to store variables in the script's memory.

[edit]I forgot to add some guard code to make sure that the spawning only happens once per use. Just changing the state could cause more than one of the particle to spawn. Since you only have 2 states, I just changed it to an Else.[/edit]

Code: Select all

IfUsed
  IfStateIs0
    tmpargument = 0
    SpawnParticle
    tmpargument = 1
    SetState

    tmpargument = 0         // reset the loop
    tmpx = 0                     //   initial counter
    tmpy = 2                     //  number of loops
    SetXY

  Else
    tmpargument = 4
    SpawnParticle

    tmpargument = 0
    GetXY
    IfXIsLessThanY
      tmpargument = 0         // increment the counter
      tmpx = 1
      tmpy = 0
      AddXY
    Else
      tmpargument = 0
      SetState

      tmpargument = 0         // reset the loop
      tmpx = 0                     //   initial counter
      tmpy = 0                     //  number of loops
      SetXY
you could use this format to program a large number of states and loops. Also, IfStateIsXX is defined for XX up to 15.

Code: Select all

IfSpawned
  tmpargument = 0         // set the initial IfUsed loop
  tmpx = 0                     //   initial counter
  tmpy = 1                     //  number of loops
  SetXY

  tmpargument = 0
  SetState

IfUsed

  tmpargument = 1         // set the "first time through" flag in slot 1
  tmpx = 1
  SetXY  

  IfStateIs0

    // guard code
    tmpargument = 1         // set the "first time through" flag in slot 1
    GetXY     
    tmpy = 0
    IfXIsEqualToY
      DoNothing
    Else
      tmpargument = 1         // clear the "first time through" flag in slot 1
      tmpx = 0
      SetXY      
    
      // do blah for state 0

      // loop control
      tmpargument = 0
      GetXY
      IfXIsLessThanY
        tmpargument = 0         // increment the counter
        tmpx = 1
        tmpy = 0
        AddXY
      Else
        tmpargument = 1
        SetState

        tmpargument = 0         // do the state 1 loop 5 times
        tmpx = 0
        tmpy = 5
        SetXY

  IfStateIs1

    // guard code
    tmpargument = 1         // set the "first time through" flag in slot 1
    GetXY     
    tmpy = 0
    IfXIsEqualToY
      DoNothing
    Else
      tmpargument = 1         // clear the "first time through" flag in slot 1
      tmpx = 0
      SetXY      
    
      // do blah for state 1

      // loop control
      tmpargument = 0
      GetXY
      IfXIsLessThanY
        tmpargument = 0         // increment the counter
        tmpx = 1
        tmpy = 0
        AddXY
      Else
        tmpargument = 2
        SetState

        tmpargument = 0         // do the state 2 loop 999 times
        tmpx = 0
        tmpy = 999
        SetXY

....

  tmpargument = "N"
  IfStateIs

    // guard code
    tmpargument = 1         // set the "first time through" flag in slot 1
    GetXY     
    tmpy = 0
    IfXIsEqualToY
      DoNothing
    Else
      tmpargument = 1         // clear the "first time through" flag in slot 1
      tmpx = 0
      SetXY      
    
      // do blah for state "N"

      // loop control
      tmpargument = 0
      GetXY
      IfXIsLessThanY
        tmpargument = 0         // increment the counter
        tmpx = 1
        tmpy = 0
        AddXY
      Else
        tmpargument = 0
        SetState

        tmpargument = 0         // do the state 0 loop 2 times
        tmpx = 0
        tmpy = 2
        SetXY


Posted: Wed Aug 20, 2008 1:18 am
by PurpleSquerkle
That's still not working. :?
It always spawns particle 0, even when it should just spawn particle 4.
:?

Also, another question:
How would I go about giving him bonus damage when using polearms?

The Archaeologist was supposed to have this with whips, but it was apparently never implemented.

Posted: Wed Aug 20, 2008 6:00 am
by bgbirdsey
Does your script use SetXY for anything else?

That is a little funny. If it ever spawns particle 0, then it must set the state to state 1.

Posted: Wed Aug 20, 2008 7:37 am
by Cimeries
PurpleSquerkle wrote: Also, another question:
How would I go about giving him bonus damage when using polearms?
I need this too for my Archer class. :?

The way I see it, there are two ways:
1. Either add a new function that checks if the holder scored a hit (which also adjusts to the hand that scored, for checking purposes).
or
2. Edit the script of every weapon he has a bonus with to include that extra damage.

Posted: Wed Aug 20, 2008 1:27 pm
by PurpleSquerkle
No, it doesn't ever use SetXY for anything else....
Does it have something to do with all the times it's setting the argument to zero for other purposes...?

If I can't get this to work, I had two other ideas:

1. It could spawn both particles every time, and just take more mana to use.
2. If you hold down the key and charge it up, it does effect 0, otherwise it does effect 4.

Option 2 is more appealing to me... how would I go about doing that?
Chainsaw wrote:...add a new function that checks if the holder scored a hit (which also adjusts to the hand that scored, for checking purposes).
Zefz already added this; it's even in the stable version.
But wouldn't that still require editing the scripts of all the individual weapons, as it checks if the holder scored a hit?

Posted: Wed Aug 20, 2008 2:16 pm
by Cimeries
Sorry, I meant 'if the weapon held scored a hit'. :P

Posted: Wed Aug 20, 2008 9:19 pm
by Zefz
I've added the archaeologist damage bonus a while ago for using whips (not released yet though).

Code: Select all

//Archaeologist whip bonus damage
IfHeld
  tmpargument = [ARCH]
  IfTargetHasID
    IfHolderScoredAHit
      tmpargument = 512
      tmpdistance = DAMAGESLASH
      DamageTarget
Particle code something like this?:

Code: Select all

IfUsed
  tmpx = selfstate              //Use counter
  tmpy = 0
  IfXIsMoreThanY
    tmpargument = 4
    tmpy = 2                     //Used twice now
    IfXIsMoreThanY
      tmpargument = 0
      SetState                   //Reset!

  IfStateIs0                  //It has been reset
    tmpargument = 0

  SpawnParticle
  
  //Increase use count
  tmpargument = selfstate+1
  SetState
    

Posted: Thu Aug 21, 2008 7:13 am
by Cimeries
Zefz wrote:

Code: Select all

//Archaeologist whip bonus damage
IfHeld
  tmpargument = [ARCH]
  IfTargetHasID
    IfHolderScoredAHit
      tmpargument = 512
      tmpdistance = DAMAGESLASH
      DamageTarget
That's very similar to what I had, but like in my script, there's this flaw:
Won't that give out bonus damage to any attack as long as a whip is held?
So one could hold a whip and use the other hand to attack, and he will still get the bonus damage for that other hand.

Also, will you consider changing the Archaeologist tags back to [ARCE] or whatever it was? Because [ARCH] was supposed to be the Archer's tag...

Posted: Thu Aug 21, 2008 7:51 am
by Zefz
No, not with the IfHolderScoredAHit as opposed to IfScoredAHit. I think I coded it that way at least.

IfHolderScoredAHit checks if the attack was made by Self. It also sets the target to the one last one who was hit by said attack.

We should test this by debugging, but I think soulcarver worked as it should while holding another melee weapon.

Posted: Thu Aug 21, 2008 8:45 am
by Cimeries
So I had it figured out all that time... :bang:

Posted: Thu Oct 02, 2008 3:55 pm
by HyugaNeji
Hey guys, long time no see, please, help me with this:

Starting Egoboo 2.6.5b...
INFO: Initializing high-performance counter...
INFO: Frequency is 3579545 hz
INFO: Initializing clock services...
INFO: Initializing filesystem services...
INFO: Game directories are:
Game: D:\Seba\Egoboo
Temp: C:\DOCUME~1\ADMINI~1\CONFIG~1\Temp\
Save: D:\Mis documentos\egoboo\
Import: C:\DOCUME~1\ADMINI~1\CONFIG~1\Temp\import\
INFO: net_initialize: Networking not enabled.
WARN: Object is missing an skin (modules/zippy.mod/objects/light.obj/)!
NOTE: I am missing a AI script (modules/heist.mod/objects/tree.obj/script.txt)
Using the default AI script instead (basicdat/script.txt)
NOTE: I am missing a AI script (modules/heist.mod/objects/tree.obj/script.txt)
Using the default AI script instead (basicdat/script.txt)
NOTE: I am missing a AI script (modules/heist.mod/objects/tree.obj/script.txt)
Using the default AI script instead (basicdat/script.txt)
NOTE: I am missing a AI script (modules/bishopiacity.mod/objects/haypile.obj/script.txt)
Using the default AI script instead (basicdat/script.txt)
NOTE: I am missing a AI script (modules/bishopiacity.mod/objects/stool.obj/script.txt)
Using the default AI script instead (basicdat/script.txt)
NOTE: I am missing a AI script (modules/bishopiacity.mod/objects/table2.obj/script.txt)
Using the default AI script instead (basicdat/script.txt)
NOTE: I am missing a AI script (modules/bishopiacity.mod/objects/tree.obj/script.txt)
Using the default AI script instead (basicdat/script.txt)
SCRIPT ERROR: modules/palash.mod/objects/whip.obj/script.txt - DAMAGeSLASH undefined
INFO: Exiting Egoboo 2.6.5b the good way...
INFO: net_shutDown: Turning off networking.

Posted: Thu Oct 02, 2008 4:24 pm
by bgbirdsey
Change DAMAGeSLASH to DAMAGESLASH.

2.6.5c, anyone?