Script related questions
Moderator: Developers
- penguinflyer5234
- Sheep (Developer)
- Posts: 3025
- Joined: Wed Jul 23, 2008 1:39 am
- Location: Best Southwest
- Zefz
- Squirrel Knight (Administrator)
- Posts: 3820
- Joined: Wed Jul 23, 2008 1:27 am
- Location: Norway
- Contact:
Rather than having the weapon change itself, have the character holding the weapon spawn the appropiate weapon and set content depending on that.
I added a SetTargetSize function a couple of versions ago, but you won't need that if you use the proper way mentioned above
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
- Ryrgwryr
- Grub Bug (Rookie)
- Posts: 42
- Joined: Sun Dec 14, 2008 12:49 pm
- Location: I'm here right now.
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...