Script related questions

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

Post by Zefz »

Two ways. In partX.txt there is a spawn attached on bump. Those defines which particles are spawned attached on the target when bumped.

Other is one or more script functions named SpawnAttachedParticle or something like that...
User avatar
PurpleSquerkle
Massive Gelfeet (Developer)
Massive Gelfeet (Developer)
Posts: 3176
Joined: Wed Jul 23, 2008 4:54 am
Location: Oakland, CA
Contact:

Post by PurpleSquerkle »

Does that spawn it attached to the target or the object with the script?
From what I can tell from the topic on script functions, it spawns it on the object with the script.
Is there any way to do something else?

Otherwise, I think I could make the particles that spawn on a critical hit spawn the smoke particles when bumped... It's tricky, because the object already has the maximum number of particles (8, right?), so I'll have to arrange them carefully and redo some stuff.


Other changes I made already:
-Random critical messages rather than the single one it has now.
-Better whispering (it whispers constantly now, and I like that better... it's still randomized, but the intervals are shorter)
-Changed sound on effective hits... It now uses the gasps (though the volume of them has been increased significantly) as I originally intended. Not that there's anything wrong with that gong/chime noise, but it just didn't work well; it was weird having that noise on every hit. Also, the gasps are spookier. :twisted:

...Maybe some other subtle things, but I don't remember all of them.
I'll post it when I'm done.
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 »

Use the Spawn attached particles at bump function then.

If you want the attached particles to spawn every time you hit the enemy, make them spawn on bump with the generic attack particle.

And that sound effect was mostly to clarify if it really was a effective blow (the previous sound was kinda hard to distinguish from the other sounds).
User avatar
PurpleSquerkle
Massive Gelfeet (Developer)
Massive Gelfeet (Developer)
Posts: 3176
Joined: Wed Jul 23, 2008 4:54 am
Location: Oakland, CA
Contact:

Post by PurpleSquerkle »

It's more easily distinguished now that it's louder... I still need to do some testing; I may increase the volume even more.
Zefz wrote:If you want the attached particles to spawn every time you hit the enemy, make them spawn on bump with the generic attack particle.
But how can I make it so that it only does that when you hit monsters with the [DEMO] IDSZ?
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 »

Code: Select all

  IfHolderScoredAHit
    tmpargument = [DEMO]
    IfTargetYaddaYadda
      tmpargument = 1                    //The particle which spawns attaches if bumped
      tmpdistance = SPAWNLAST
      SpawnParticle
?
User avatar
PurpleSquerkle
Massive Gelfeet (Developer)
Massive Gelfeet (Developer)
Posts: 3176
Joined: Wed Jul 23, 2008 4:54 am
Location: Oakland, CA
Contact:

Post by PurpleSquerkle »

I don't get it....

What's supposed to be where "IfTargetYaddaYadda" is?
...Unless that's really a script function. :D

Also, I don't think I have enough particle slots to have ANOTHER particle that spawns MORE particles....
bgbirdsey
{]-[0{0|307 (Developer)
{]-[0{0|307 (Developer)
Posts: 1864
Joined: Wed Jul 23, 2008 4:22 am
Location: Minnesota, USA

Post by bgbirdsey »

There are a lot of IfTargetYaddaYadda functions

Code: Select all

IfTargetKilled
IfTargetHasID
IfTargetHasItemID
IfTargetHoldingItemID
IfTargetHasSkillID
IfTargetCanOpenStuff
IfTargetIsOnOtherTeam
IfTargetIsOnHatedTeam
IfTargetIsOldTarget
IfTargetHasVulnerabilityID
IfTargetIsHurt
IfTargetIsAPlayer
IfTargetIsAlive
IfTargetIsSelf
IfTargetIsMale
IfTargetIsFemale
IfTargetHasSpecialID
IfTargetIsOnSameTeam
IfTargetHasAnyID
IfTargetIsDefending
IfTargetIsAttacking
IfTargetIsKursed
IfTargetIsDressedUp
IfTargetHasItemIDEquipped
IfTargetIsMounted
IfTargetIsSneaking
IfTargetCanSeeInvisible
IfTargetIsFlying
IfTargetIsAMount
IfTargetIsAPlatform
IfTargetHasQuest
IfTargetHasNotFullMana
IfTargetIsOwner
you could use any of these that fit your purpose
User avatar
PurpleSquerkle
Massive Gelfeet (Developer)
Massive Gelfeet (Developer)
Posts: 3176
Joined: Wed Jul 23, 2008 4:54 am
Location: Oakland, CA
Contact:

Post by PurpleSquerkle »

Why do I have to put it in an "if" statement at all?
bgbirdsey
{]-[0{0|307 (Developer)
{]-[0{0|307 (Developer)
Posts: 1864
Joined: Wed Jul 23, 2008 4:22 am
Location: Minnesota, USA

Post by bgbirdsey »

If you need to know whether the target has [DEMO], then you need to do some kind of test
User avatar
PurpleSquerkle
Massive Gelfeet (Developer)
Massive Gelfeet (Developer)
Posts: 3176
Joined: Wed Jul 23, 2008 4:54 am
Location: Oakland, CA
Contact:

Post by PurpleSquerkle »

Oh, it already has tests for if it has that ID... it does extra damage and sounds and such.
Cimeries
Lumberjack (Developer)
Lumberjack (Developer)
Posts: 7720
Joined: Wed Jul 23, 2008 6:56 am

Post by Cimeries »

After the sounds and such, just make it SpawnExactParticle.
Use: tmpx = targetx, tmpy = targety, ect.
:wink:
User avatar
PurpleSquerkle
Massive Gelfeet (Developer)
Massive Gelfeet (Developer)
Posts: 3176
Joined: Wed Jul 23, 2008 4:54 am
Location: Oakland, CA
Contact:

Post by PurpleSquerkle »

Ahhh. OK, thanks.
User avatar
penguinflyer2222
Queen Penguin (Senior Member)
Queen Penguin (Senior Member)
Posts: 6614
Joined: Wed Jul 23, 2008 1:51 am

Post by penguinflyer2222 »

Is there a way to make a particle spawn forever?
Or at least when the player is able to look at it?
......
User avatar
PurpleSquerkle
Massive Gelfeet (Developer)
Massive Gelfeet (Developer)
Posts: 3176
Joined: Wed Jul 23, 2008 4:54 am
Location: Oakland, CA
Contact:

Post by PurpleSquerkle »

You could make your script spawn the particle with every step.
Also (although I have not tried this myself) you could do circular end spawning. So that one particle spawns another particle when it ends, and that particle spawns the first one when it ends. Or maybe you could just make a particle spawn itself when it ends.
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 »

I think she means particles with permanent duration. The candles in wizard starter is a good example at those.

Just disable all end conditions for the said particle.
Post Reply