In fact what I meant when I said I disabled the dynamicobstacle component is that I just disble it in the object definition, and after that I never enable it at any time. From what I see, enabling it is never needed for anything, even when the object is spawned. It just has to be there or you get an error, but it can stay disabled all the time. I will test it more and see if I really need to destroy and recreate it as you said. Whatever I find, thank you for your helpIsaac wrote:If you do not remove the dynamicobstacle component, it blocks the original tile, but releases as soon as the block is pushed. If you disable it instead of removing it, the tile is freed ~until you enable it again. If you remove it, and create it again, it just works as one would expect (aside from the unexpected need for this kludge). I don't think that anything is or would be missing, but I'm not exactly sure what you mean.AndakRainor wrote:Well, after testing it it seems the previous position is correctly released, and as an obstacle and a pushable block it still correctly moves. What would be missing without the destruction and creation you suggest ?Isaac wrote:Just remove the dynamicobstacle compontent, move the object, then create the dynamicobstacle component again.
(Disabling it is not sufficient.)
Ask a simple question, get a simple answer
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
- Zo Kath Ra
- Posts: 937
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Ask a simple question, get a simple answer
What's the difference between Champion:modifyFood(amount) and Champion:setFood(food) ?
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
From the names of those functions, I would say modify is relative (to the current food level) while set is absolute ?Zo Kath Ra wrote:What's the difference between Champion:modifyFood(amount) and Champion:setFood(food) ?
Re: Ask a simple question, get a simple answer
setFood(500) = the value is exact 500.Zo Kath Ra wrote:What's the difference between Champion:modifyFood(amount) and Champion:setFood(food) ?
modifyFood(500) = Currently + 500
Re: Ask a simple question, get a simple answer
modifyFood() seems only to add, with setFood() can define.
In script, I would imagine that one can just add modifyFood(5), and everytime it runs, it adds 5; where setFood(5), would ~set it to 5 every time.
In script, I would imagine that one can just add modifyFood(5), and everytime it runs, it adds 5; where setFood(5), would ~set it to 5 every time.
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
Ok you were right something is missing XDIsaac wrote:If you do not remove the dynamicobstacle component, it blocks the original tile, but releases as soon as the block is pushed. If you disable it instead of removing it, the tile is freed ~until you enable it again. If you remove it, and create it again, it just works as one would expect (aside from the unexpected need for this kludge). I don't think that anything is or would be missing, but I'm not exactly sure what you mean.AndakRainor wrote:Well, after testing it it seems the previous position is correctly released, and as an obstacle and a pushable block it still correctly moves. What would be missing without the destruction and creation you suggest ?Isaac wrote:Just remove the dynamicobstacle compontent, move the object, then create the dynamicobstacle component again.
(Disabling it is not sufficient.)
The block is no longer an obstacle WHILE it is moving to the next tile ! You can't pass through it when it stands, but you can when it moves... So, I will do as you said, destroy, move then recreate the component
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
Oh this ice block is seriously damaging my sanity !!! Now when I use
the game crashes (in removeComponent) with this error : "could not look up class name"
Code: Select all
local dyn = o:getComponent("dynamicobstacle")
if dyn then o:removeComponent(dyn) end
Re: Ask a simple question, get a simple answer
RemoveComponent wants the name.AndakRainor wrote:Oh this ice block is seriously damaging my sanity !!! Now when I usethe game crashes (in removeComponent) with this error : "could not look up class name"Code: Select all
local dyn = o:getComponent("dynamicobstacle") if dyn then o:removeComponent(dyn) end
Code: Select all
o:removeComponent("dynamicobstacle")
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
Thanks ! I saw GameObject:removeComponent(component) in the scripting reference so I gave it the component instead !
Re: Ask a simple question, get a simple answer
hi everyone
is it possible to check if the party moves against a wall?
i want script the system from DM to damage the party.
or has anyone else these system already?
is it possible to check if the party moves against a wall?
i want script the system from DM to damage the party.
or has anyone else these system already?