Page 22 of 396
Re: Ask a simple question, get a simple answer
Posted: Wed Nov 19, 2014 11:44 pm
by kelly1111
Thanks that helped !
Re: Ask a simple question, get a simple answer
Posted: Thu Nov 20, 2014 2:13 am
by TheLastOrder
I'm trying to find a solution through counters for a button that rotates, sequentially, different force fields. And of course, it's not working. How could I solve this with a script??
The point is that when I'm using the "if" "then" + "else" method, I have only 2 outputs, and I need 4 different stages when pushing this button.
So> There are 4 force fields: the first click on the button will disable the first one. The second click will enable that first one, disabling only the second one. With the 3rd click, the 3rd is disabled. etc.
Any idea? Is there an alternative way to do that without using the "if+then+else"?
EDITED: I have to say that I actually solved WHAT I'm asking for through counters, but the real problem is that I need 2 buttons doing this with a total of 6 different force fields, 4 per button, 2 of which are shared in the buttons hahaha. So I think I need to do through scripting, as through counters there will be always 5 force fields activated (and I need to disable 2 of them).
Does it makes sense for you guys?
Thanks in advance guys!
Re: Ask a simple question, get a simple answer
Posted: Thu Nov 20, 2014 2:43 am
by GoldenShadowGS
Sounds like a problem I want to help solve. I will post back in a little while with a prototype.
Say button A cycles forcefields 1-4, button B cycles forcefield 3-6. What do you want to have happen if both buttons are trying to disable the same forcefield? Off or on?
edit:
Code: Select all
acycle = 0
bcycle = 2
function buttonA()
acycle = acycle + 1
if acycle > 4 then
acycle = 1
end
setTeleport()
end
function buttonB()
bcycle = bcycle + 1
if bcycle > 6 then
bcycle = 3
end
setTeleport()
end
function setTeleport()
for i = 1,6 do
ff = findEntity("force_field_"..i)
if i == acycle or i == bcycle then
ff.controller:deactivate()
else
ff.controller:activate()
end
end
end
name your teleports "force_field_n" where n is a number from 1 through 6
Re: Ask a simple question, get a simple answer
Posted: Thu Nov 20, 2014 3:10 am
by TheLastOrder
GoldenShadowGS wrote:Sounds like a problem I want to help solve. I will post back in a little while with a prototype.
Say button A cycles forcefields 1-4, button B cycles forcefield 3-6. What do you want to have happen if both buttons are trying to disable the same forcefield? Off or on?
edit:
Code: Select all
acycle = 0
bcycle = 2
function buttonA()
acycle = acycle + 1
if acycle > 4 then
acycle = 1
end
setTeleport()
end
function buttonB()
bcycle = bcycle + 1
if bcycle > 6 then
bcycle = 3
end
setTeleport()
end
function setTeleport()
for i = 1,6 do
ff = findEntity("force_field_"..i)
if i == acycle or i == bcycle then
ff.controller:deactivate()
else
ff.controller:activate()
end
end
end
name your teleports "force_field_n" where n is a number from 1 through 6
Yeah, you understood correctly the request!
This is just.... awesome. Woah! I couldn't have discovered this combination in years...
But it seems that is the answer to what I'm looking for.
I'm going to make some testing, and I'll post you back! Thanks A LOT!
Re: Ask a simple question, get a simple answer
Posted: Thu Nov 20, 2014 3:12 am
by GoldenShadowGS
Here Is an improvement:
Code: Select all
acycle = 0
bcycle = 2
function buttonA(self)
acycle = acycle + 1
if acycle > 4 then
acycle = 1
end
setTeleport(self.go.id)
end
function buttonB(self)
bcycle = bcycle + 1
if bcycle > 6 then
bcycle = 3
end
setTeleport(self.go.id)
end
function setTeleport(button)
for i = 1,6 do
ff = findEntity("force_field_"..i)
if button == "wall_button_1" then
if i == acycle then
ff.controller:deactivate()
else
ff.controller:activate()
end
elseif button == "wall_button_2" then
if i == bcycle then
ff.controller:deactivate()
else
ff.controller:activate()
end
end
end
end
Now only one forcefield will deactivate at a time. This time the button names matter too. wall_button_1 and wall_button_2. if they are different, then change it in the script to match
Re: Ask a simple question, get a simple answer
Posted: Thu Nov 20, 2014 5:41 am
by TheLastOrder
My personal Jesus, and I'm atheist!!
Re: Ask a simple question, get a simple answer
Posted: Thu Nov 20, 2014 7:56 pm
by cameronC
CastSpellComponent (ItemActionComponent)
...
CastSpellComponent:setEmptyItem(string)
When using an item with this set in its definition the editor says it is an "invalid component property". The string I gave it was an item, assuming that once the charges of the spell were used up the item would become what i pass it in the string. Has anyone got this to work? Obviously emptyItem isn't the right name for this property...
Re: Ask a simple question, get a simple answer
Posted: Fri Nov 21, 2014 3:52 pm
by Akimbo
Missile Weapons are bad.
I want to make them better, starting with improving the skill.
Where do I even begin? Extract all the data for the game?
Thanks >_>
Re: Ask a simple question, get a simple answer
Posted: Fri Nov 21, 2014 10:00 pm
by macBos
Hi
I can't find option for disabling custom party creation for custom dungeon. I was wondering about replacing created party by predefined one (using script) but I was hoping for more elegant solution. If I just missed that somewhere, please let me know
Re: Ask a simple question, get a simple answer
Posted: Mon Nov 24, 2014 2:06 am
by Ciccipicci
Hi. How to pop up a text line from one champion only when walking in a specific point or coordinates?
I'm using this
hudPrint(party.party:getChampion(x):getName() .. ": message you want the champion to say in quotes here" )
but the scripts pop up instantly everywhere.