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
penguinflyer5234
Sheep (Developer)
Sheep (Developer)
Posts: 3025
Joined: Wed Jul 23, 2008 1:39 am
Location: Best Southwest

Post by penguinflyer5234 »

SetContent sets the object's content, not the target's content. And I don't believe there is a way to change the size without enchanting either.
...
User avatar
Ryrgwryr
Grub Bug (Rookie)
Grub Bug (Rookie)
Posts: 42
Joined: Sun Dec 14, 2008 12:49 pm
Location: I'm here right now.

Post by Ryrgwryr »

penguinflyer5234 wrote:SetContent sets the object's content, not the target's content. And I don't believe there is a way to change the size without enchanting either.

Ah, I see. Thanks anyway. I'll try to find a way around it.
Studying...
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 »

Rather than having the weapon change itself, have the character holding the weapon spawn the appropiate weapon and set content depending on that.

Code: Select all

IfSpawned
  SetTargetToSelf
  tmpx = rand % 10
  tmpy = 0
  IfXIsEqualToY
    tmpargument = XX
    tmpdistance = RIGHT
    SpawnAttachedCharacter
    tmpargument = 200
    SetContent
  tmpy = 1
  IfXIsEqualToY
    tmpargument = XX
    tmpdistance = RIGHT
    SpawnAttachedCharacter
    tmpargument = 200
    SetContent
  tmpy = 2
  IfXIsEqualToY
    tmpargument = XX
    tmpdistance = RIGHT
    SpawnAttachedCharacter
    tmpargument = XX
    tmpdistance = LEFT                //Also spawn shield
    SpawnAttachedCharacter
    tmpargument = 200
    SetContent


I added a SetTargetSize function a couple of versions ago, but you won't need that if you use the proper way mentioned above ;)
User avatar
Ryrgwryr
Grub Bug (Rookie)
Grub Bug (Rookie)
Posts: 42
Joined: Sun Dec 14, 2008 12:49 pm
Location: I'm here right now.

Post by Ryrgwryr »

Zefz wrote:Rather than having the weapon change itself, have the character holding the weapon spawn the appropiate weapon and set content depending on that.

Code: Select all

IfSpawned
  SetTargetToSelf
  tmpx = rand % 10
  tmpy = 0
  IfXIsEqualToY
    tmpargument = XX
    tmpdistance = RIGHT
    SpawnAttachedCharacter
    tmpargument = 200
    SetContent
  tmpy = 1
  IfXIsEqualToY
    tmpargument = XX
    tmpdistance = RIGHT
    SpawnAttachedCharacter
    tmpargument = 200
    SetContent
  tmpy = 2
  IfXIsEqualToY
    tmpargument = XX
    tmpdistance = RIGHT
    SpawnAttachedCharacter
    tmpargument = XX
    tmpdistance = LEFT                //Also spawn shield
    SpawnAttachedCharacter
    tmpargument = 200
    SetContent


I added a SetTargetSize function a couple of versions ago, but you won't need that if you use the proper way mentioned above ;)


Thanks, this itself works great although I have to convert my module to a newer version for that. When I started making this map it wasn't even possible to spawn a weapon for a creature(I wanted to do that first but then it was impossible). Also... I have a really weird problem: while I tried to change my module to a new version, most of static objects didn't appear, like braziers, lockdoors, customised knightsuit, chests, racks(I used dependency for chests and racks only). Shutdoor and trees did appear though.
I am pretty clueless about it. I might have too many objects but then, it worked just fine on 2.74 even when there was more objects on the map (I deleted many upon conversion)...
Studying...
Post Reply