#No argument for required parameter (baseValue) of Features.Features(float)
1 messages · Page 1 of 1 (latest)
Ok, what is "Features"
because the error is telling me that Features requires a float parameter
I've been following Kryzarel's tutorials
um, maybe you need a baseValue in your Ambition class
I thought the 'BaseValue' declaration in Awake was providing that float...
but apparently not
try adding public float baseValue to the ambition class
i'm gonna be honest with you i've never seen a parameter be required for a subclass
yeah, it's confounding me - no dice on the baseValue bit
you try this yet?
yeah, I just tried that
is this a runtime error or compiler error
what happens when you right click the highlighted part and press suggestions
I only get a reference to the error code, and the page it links to has no idea what to do about it
I don't get suggestions
ok this is a longshot, but have you tried putting a ((float)) after Features
unexpected argument list XD
you said you're following a tutorial, right?
it's a ponderable - thanks for your suggestions, at least
yeah - I haven't quite finished the third video yet, but I've watched them before & I don't think there will be any more information in this regard
one moment....
one sec
: base (float baseValue)
try adding that after public Features(float baseValue) in Features class
@stuck geode
nope - that just makes a mess; sorry
damnit
nevermind - I'll ponder it with the help of google; something might gel
thanks again for your suggestions
i'm so confused
me too - it's the only error I've got in all the scripts I've nutted out
'scuse the crass
You probably did something wrong when making the constructor but I dont know what
and your code is IDENTICAL?
not identical, but near enough as damn it
nope - the only exception appears to be that the class Pteryx (I'm trying to add modifiers to base scores through that) is a scriptable object
but I don't think that's the issue
I've never seen a tutorial with such sophisticated code
it's from 2017
thats a bad and good thing.. (the sophisticated code)
I doubt it
by now, anyway
they dont just update C# and break code
unless it was completely deprecated
which tutorial are you following specifically
In this video we make a system to organize the stats (also known as attributes) and stat bonuses of our game characters.
There's also a text version of this tutorial: https://forum.unity.com/threads/tutorial-character-stats-aka-attributes-system.504095/
Part 2: https://youtu.be/uvOSx5FzDnU
Part 3: https://youtu.be/obxBk2pSR5U
I do realize Bra...
I'm up to the third video in the series, which is the last one
(I just noticed your profile greeting - right on)
my status? lol
yeah
oHHhh
select the class name of the subclass , press ctrl + .
select "generate constructors"
so there were suggestions
I'm not sure I understand...
right click on ambition and click suggestions and then click generate constructors
I don't get suggestions for it when hovering over the error
not hovering
click on it, press ctrl + .
its same as the lamp icon, or rmb suggestions, but faster
got it now
when you right click on a class there should be a button that says generate constructor
"pick members to be used as constructor parameters" - baseValue isn't there
show screenshot
okay, so I went ahead & did it with the defaults
there are 2 options in suggestions, one just straight up generates, other opens that refactoring window
the one that doesnt open that window lol
show screenshot with suggestions
suggestions are: generate constructor, generate overrides, extract base class
no idea why it opens refactoring for you
sorry, point; showing screenshot with suggestions is beyond me XD
this is vs not vsc right
vsc?
lol - gimme your machine
ctrl+ highlights most of the code
I can't figure out how to keep suggestions active when I use the snipping tool
my bigger issues are that I'm a noob at all this
forget the snipping tool
use sharex
one moment
its pretty big, so study it when you have the time, you can setup automated actions for stuff
like "on this key, make a screenshot and upload it to this website, as well as save on disk"
also records screen area, sound included!
really is the best in its category, no competition
oops - I kinda just installed & ran with it
I got a conflict with oneDrive, too
ah, that sounds too much like you know what you're doing: I don't XD
keep doing stuff, eventually youll know what youre doing
dont be scared of any tech stuff, its all made by humans for humans
except blender
lol - I use blender; or I try to
i just joke
thats all?
done
even if fails
go to your project root folder, delete folder named .vs
open visual studio
no compilation
nope - it's hanging on the error with the Ambition class
not 'hanging', but hanging onto it
no
show unity console
it just won't compile while this error is here
that would be in Explorer?
yes
open vs, try generating the ctor
same options as before
and same window?
write it myself might be easier
then only thing you should know is that you have to call the base constructor
this would be in the Ambition class script?
generally unity calls "script" anything that extends MonoBehaviour
ah
tho the whole usage of word "script" is so idiotic i dont know why its still used
can you give me the constructor to copy out?
so far, so good...
show me
sorry for the image
yeah it generated the default empty constructor
you need it to match the ctor in the base class
i.e. parameter must match
yes now, you have to call the base constructor and pass it the same param
you do that by adding : base(param)
to the method name
public Ambition(float baseValue) : base(baseValue)
{
///```
lol nothanks
its why you need eventually to fix the generate ctor thing
just so you know...:
https://i.imgur.com/F3Upthv.png
😛
but that's for another time - thanks for your help
I'll let you get back to more pressing issues
you've been super about all this
you & Ellie both
it means you tried to use it as a "script"
its just a class you cant attach it to a gameobject