Solarus Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
SMF - Just Installed!
Home
Help
Search
Login
Register
Solarus Forum
»
Solarus
»
Development
»
(Solved)Sword variants?
« previous
next »
Print
Pages: [
1
]
Author
Topic: (Solved)Sword variants? (Read 589 times)
zutokaza
Full Member
Posts: 146
Active - Making stories can take the most time.
(Solved)Sword variants?
«
on:
March 24, 2017, 11:54:20 pm »
Can a sword have different variants? For example, variant 2 for a red sword graphic?
Code: Lua
game
:
set_ability
(
"sword"
,
2
)
«
Last Edit: April 06, 2017, 01:24:28 am by zutokaza
»
Logged
Solarus Works on ReactOS Opensource Windows OS
https://www.reactos.org/forum/viewtopic.php?f=2&t=14759&p=120616#p120616
Zefk
Sr. Member
Posts: 492
Just helping Solarus
Re: Sword variants?
«
Reply #1 on:
March 25, 2017, 12:29:53 am »
Yes, you can do that. Make another sword and call it "sword2" and change the graphics to red swords. The sword will be at level 2. That means it will inflict more damage.
sword2
counts as the second variant in
Code: Lua
game
:
set_ability
(
"sword"
,
2
)
You will need to create other names with a "2" after it. Follow the error messages. It will mentions names like "sword_stars2."
Your second option would be to just change the sprite. Make a new animation called, "red_sword."
http://www.solarus-games.org/doc/latest/lua_api_hero.html#lua_api_hero_set_sword_sprite_id
Code: Lua
hero
:
set_sword_sprite_id
(
"red_sword"
)
«
Last Edit: March 25, 2017, 08:13:25 pm by Zefk
»
Logged
Fairyolica Graphic Pack
A Solarus Help Guide Project
zutokaza
Full Member
Posts: 146
Active - Making stories can take the most time.
(Solved)Sword variants?
«
Reply #2 on:
March 25, 2017, 01:03:42 am »
Thanks again Zefk! The sword variant change is working.
«
Last Edit: April 06, 2017, 01:24:48 am by zutokaza
»
Logged
Solarus Works on ReactOS Opensource Windows OS
https://www.reactos.org/forum/viewtopic.php?f=2&t=14759&p=120616#p120616
Print
Pages: [
1
]
« previous
next »
Solarus Forum
»
Solarus
»
Development
»
(Solved)Sword variants?