I have a subclass control ‘A’ which is abstract and extends AbstractControl.
However, when I go to the ‘add custom control’ in the JDK to add my subclassed custom control it can’t find it and thus can’t add it to the scene/object.
Yeah, it will only recognize classes that are coming from the base class atm but you can enter your (full) classname in the field below. May I ask why you extend your class? YOu might get stuck in the same “anti-pattern” that we suggest not extending Node for. You should only extend classes if you want some class that does the same on the same level bu slightly different, not if you want to really “extend” something, like for example a HeavyWeaponControl extends WeaponControl, that would be bad. Just attach a WeaponControl and a WeaponSpecifier and let the WeaponControl use that. Else you extend WeaponControl to RangedWeaponControl and HeavyWeaponControl and can’t have heavy ranged weapons
The content of this post is meant to be read as a straight information or question without an implicit dismissive stance or interest in having the other party feel offended unless there’s emotes that hint otherwise or there’s an increased use of exclamation marks and all-capital words.
@normen said:
Yeah, it will only recognize classes that are coming from the base class atm but you can enter your (full) classname in the field below. May I ask why you extend your class? YOu might get stuck in the same "anti-pattern" that we suggest not extending Node for. You should only extend classes if you want some class that does the same on the same level bu slightly different, not if you want to really "extend" something, like for example a HeavyWeaponControl extends WeaponControl, that would be bad. Just attach a WeaponControl and a WeaponSpecifier and let the WeaponControl use that. Else you extend WeaponControl to RangedWeaponControl and HeavyWeaponControl and can't have heavy ranged weapons ;)
The content of this post is meant to be read as a straight information or question without an implicit dismissive stance or interest in having the other party feel offended unless there's emotes that hint otherwise or there's an increased use of exclamation marks and all-capital words.
Hey Norman, cheers for the reply.
In this context what exactly do you mean by a specifier?
Erm, I was extending controls for collision detection.
The “specifier” would do or define something else about the weapon like if its ranged or has some other properties. Maybe also contain some code to do that. Like in the quixote example video I could have done a “WalkingQuixoteControl” but I chose to make a separate AnimUpdateControl instead.
@normen said:
The "specifier" would do or define something else about the weapon like if its ranged or has some other properties. Maybe also contain some code to do that. Like in the quixote example video I could have done a "WalkingQuixoteControl" but I chose to make a separate AnimUpdateControl instead.
Hmm.
Does setting the properties work on Strings? I couldn’t get it to work with Strings but i’m not sure if it’s something i’m doing incorrect. It shows in the properties just doesn’t set it.
I guess at the moment I was thinking of having certain controls subclass the main ‘Interaction Control’ so that the subclasses can define certain actions depending on the type of object/control. Thus when doing the collision I can simply go
InteractionControl ic = blah;
ic.getActions(); // which will differ depending on the type of collision
doAction();
I guess I could use simply have a control which defines the actions. But then the doAction() of each interactable object would still need to be different (like doors opening for example)… Wouldn’t I end up with a bunch of if statements checking the type of control and then calling the ‘doAction’ on them? But if I have one ‘InteractionControl’ I can just call doAction if it is an interactable object.
Does setting the properties work on Strings? I couldn’t get it to work with Strings but i’m not sure if it’s something i’m doing incorrect. It shows in the properties just doesn’t set it.
I guess at the moment I was thinking of having certain controls subclass the main ‘Interaction Control’ so that the subclasses can define certain actions depending on the type of object/control. Thus when doing the collision I can simply go
InteractionControl ic = blah;
ic.getActions(); // which will differ depending on the type of collision
doAction();
I guess I could use simply have a control which defines the actions. But then the doAction() of each interactable object would still need to be different (like doors opening for example)… Wouldn’t I end up with a bunch of if statements checking the type of control and then calling the ‘doAction’ on them? But if I have one ‘InteractionControl’ I can just call doAction if it is an interactable object.
Oh…think I just realised you can use states to update the fact an action needs to be done.
@normen said:
The "specifier" would do or define something else about the weapon like if its ranged or has some other properties. Maybe also contain some code to do that. Like in the quixote example video I could have done a "WalkingQuixoteControl" but I chose to make a separate AnimUpdateControl instead.
Norman, does the ‘setting properties’ for controls as you did in the quixote example (with speed), work for Strings? I can’t seem to get it to work with Strings =(
Yes, just use normal bean properties, with proper getters and setters (best use Refactor-> wrap fields) to create these for some sensibly named field Btw my name is actually spelled with an “e”
The content of this post is meant to be read as a straight information or question without an implicit dismissive stance or interest in having the other party feel offended unless there’s emotes that hint otherwise or there’s an increased use of exclamation marks and all-capital words.
@normen said:
Yes, just use normal bean properties, with proper getters and setters (best use Refactor-> wrap fields) to create these for some sensibly named field :) Btw my name is actually spelled with an "e" ;)
The content of this post is meant to be read as a straight information or question without an implicit dismissive stance or interest in having the other party feel offended unless there’s emotes that hint otherwise or there’s an increased use of exclamation marks and all-capital words.
Sorry :P. Dyslexic so names are not my forte. Causes me problems with never remembering how I spelt variable names either haha.
Turns out the problem with strings was because it wasn’t working for me overall. Not even with numbercal values. It shows up so I can set them but doesn’t show in-game. Probably just something i’m doing wrong but good to know when I get it working it will work with Strings :D. Thankyou.