Author Topic: Alternative Fuels  (Read 600 times)

The title here is a rather ban pun.

However, I do need help with create an alternative energy variable.

Basically, I'm using the current energy bar for something else, but I still need to use energy for other purposes. Seeing as datablocks use energy by default, I'm presented with a problem. I'm not going to make a seperate GUI for this, as that defeats the purpose of me doing this. The alternative energy variable will not need to be displayed.

How would I go about doing this?

In other words, how can I make variables, such as runEnergyDrain, use a variable of my own, rather than the default energy variable.

Wouldn't a simple variable do enough then?

Of course, that's what I'm using. I just don't know how to tell the player datablock to use that variable as opposed to the energy variable.

Of course, that's what I'm using. I just don't know how to tell the player datablock to use that variable as opposed to the energy variable.
You can't tell the datablock directly.
You have to make functions that update and/or set the variable on a specific value.

Like if you want to make it so that if you press jet you will rain energy from the variable, you will have to find a way to update your variable everytime the jet function is used.
You can't just say:"Hey, you are going to use some variable i just made."
You have to let him know how.

The energy is allready there an alternative energy would require an alternative method to work with it.
Get it?

Yes, I do, and have.

My question is what is that alternative method?

I'll be using runEnergyDrain, jumpEnergyDrain, minRunEnergy, and rechargeRate.

I think you're getting into the region of stuff that's hardwired into the engine here.

I am. Thus why it's difficult.

I'm sure it's doable though.

I love how all of my questions here end up dying without an answer.

This probably explains why I haven't made many script-based add-ons.

Well if its really hardwired like I think it is, you'll have to take a third, extremely uncomfortable option.

I know what I'm supposed to do. That's make triggers for each action, or find a way to tell if an action is being performed. However, I don't know the names of those triggers, or how to test for those circumstances.