More Assembly Reference Problems

OK so… as you’ve probably noticed by now, I’m working a lot with Assembly References nowadays.

Right now, I’m trying to create an Assembly Reference to my Health.cs script, because I need a component in there to link to a script that has nothing to do with any courses here (long story short, I’m trying to block my player from accessing the mounting trigger in Malbers’ code if he’s dead, to avoid a bug)

However, when I create the assembly reference, I will literally get 20 errors in a row that make the entire project unable to run. What’s the best way to go around this?

Unfortunately I can’t just write the entire system of theirs alone, because… well… it’s over 5000 lines of code :sweat_smile: (probably 10,000+ tbh)

Anyone knows an alternative solution to go around the problem of trying to link both scripts, or how do I fix my own problem at the very least?

I don’t even know if I should be using this excessively or not, as this will be my third run with assembly references, but I honestly can’t think of a better solution right now

and I’m using Unity 2021.3.21f1 LTS, if that helps in anyway

To be honest, I think you should get off the ‘assembly reference horse’ because you don’t seem to understand what they are and what they’re used for. It’s not something you use for logic.

So, forget about assembly references and write the code so that dead players don’t try to access the mount trigger

1 Like

I’d stay from it if I knew of any other solution to actually get these two scripts to communicate, because this is important tbh. Do I just create another static variable, since they seem to be a good point of communication between both scripts? I’m already getting worried about performance issues that this approach would cause

I’ll need a solution to get my script, and one of Malbers’ scripts, to communicate for that… That’s my big problem

Edit: I did what I did before, and created a new static variable to get both scripts to communicate, since my ‘RPG.Statics’ namespace is connected both (that, and the saving system as of earlier today). For now it seems to have solved the problem

i’m at least one or two weeks out from being able to support assembly definitions

You should know that I had MAJOR surgery last week on my neck, that will require time for swelling/therapy/etc so that I can answer anything complext for at leaste a few more weeks.

It’s all good for now. For the time being, I controlled the situation with a static variable in a namespace that connects between both (I also spoke to Malbers and managed to connect the saving system to his script. I haven’t implemented the saving logic yet, but for now I can use our saving system in his script). As long as I don’t touch them ever again it should be fine

I am certain. Sometimes I honestly write these questions because somehow, by god knows what miracle, I get the answer I was seeking in my mind a few minutes after writing it here, or something else happens that somehow leads to the required answer. Don’t ask me how, it just happens :sweat_smile:

again, take your time. I’m not in a rush :slight_smile:

This is a known phenomena in learning circles. It’s actually one of the reasons we often start our answers with “Let’s see your codel”. Often just pointing the student to look at the code in the error message is enough for the student to go over their code and see the error themselves. Same with when I ask for the details of the error messges. I don’t always know the answer right away, but I often get the student giving an informed new look at the problem. (Sadly, this often leads to the student never replying, because once the problem is solved, he/she is no longer interested in that particular problem anymore.)

and then it comes to hunt us down later on, and we are dealing with it again… it’s an interesting way of learning I suppose :stuck_out_tongue: (I used to do that, but because you always were punctual on a specific time, I would spend so long trying to fix a bug on my own over time, to the point that I started understanding my own code down the line, xD)

and all of a sudden, I was really interested in doing this

I mean sometimes people get impatient, espically when it comes to code, they jump the gun and ask for help. And long and behold the answer was staring them in the face the whole time(happens to us all), some times you got to look outside your normal thinking path, that way like you said you actually understand what you are doing. I have seen so many times people asking for help because they want an answer to let’s say add a mechanic to a game but they don’t actually understand the process behind why and how the way your implementing it.

well well, if that ain’t what just wasted 2 days of my life until like 3 hours ago… :sweat_smile: - I added a line of code that truly messed the logic of my function up, messed a function input up, and then went nuts about why my code wasn’t working… (I prayed for a solution. That’s usually my miracle ticket way out of problems :slight_smile:)

It’s still not polished, because the cost of fixing that bug was deleting an essential fix, and I still can’t think of a way around it… It’s all being documented here

I’m not the best with Quaternions just yet, so it’s safe to say I had no idea what I was doing for quite some time, but some experimenting was helpful

I did show off my combat system to reddit a couple of days ago… Reviews were, generally speaking, positive (and I hope it remains that way)

Privacy & Terms