|
Post by Jeff on Mar 4, 2011 21:03:02 GMT
Bump: once again, another coding problem. I am trying to make a powerup that changes the surface friction. I have seen in other powerup codes that you use the function "onPowerUpUse". The script does compile but it does not show up. Any help would be greatful.
|
|
|
Post by Stal on Mar 4, 2011 21:38:28 GMT
Can you see the power up in the mission editor, and does the onPowerUpUse actually work (Test using a help line)?
If it does why are you just playing/stopping animations in the onPowerUpUse?
|
|
|
Post by Jeff on Mar 4, 2011 21:52:11 GMT
It does not show up. The stop/play thing needs to be removed. thats probebly why. updated code. my variable is also defined as: $Highfrictionmaterial=new MaterialProperty(HighFrictionMaterial);
|
|
|
Post by Stal on Mar 4, 2011 22:22:49 GMT
That looks better. However that's not the real problem at the moment, if you can't even add it in the mission editor that's a problem before the problem.
EDIT: Fail below the mission editor hook. Instead of
powerUpId = 0; use
powerUpId = 6;
|
|
|
Post by Jeff on Mar 4, 2011 22:29:50 GMT
I cant. It has already been used up to 9 I cant say anymore to risk mod security on how that was done. :X I will try 10 Edit: 10 did not make a difference. Any help would be greatful. (especially stal, Higuy, siezure22, Phil)
|
|
|
Post by Stal on Mar 4, 2011 22:44:45 GMT
Wait, if you've made PU's before why can't you copy their code? I think it only goes to 5 (gyro) is vanilla mbg.
|
|
|
Post by Jeff on Mar 4, 2011 22:47:04 GMT
Wait, if you've made PU's before why can't you copy their code? I think it only goes to 5 (gyro) is vanilla mbg. HiGuy coded it to make it go as high as it needs too. IDK how he did it. and, you cant use the same PowerUpID which I know you know so, why would I need to copy there code. I cant make it in powerups .cs because I could mess something up really bad in opal if it is worked on.
|
|
|
Post by Stal on Mar 4, 2011 23:01:51 GMT
I know, that's why I told you six. 6-9 are used where? About PU.cs, why not? The game seems to be having trouble using your extra script.
|
|
|
Post by Jeff on Mar 4, 2011 23:12:50 GMT
cause I told HiGuy I would not mess around in there. It is so top-secrete that I cant even distribute the file to our own staff. I promised HiGuy. Its for 4 new powerups already in the game that no other mod has.
So HiGuy, you may have to put this file in it.
|
|
|
Post by Stal on Mar 4, 2011 23:21:28 GMT
You're the co-leader of your own mod and you can't mess with powerups.cs, you can't even distribute it among your staff? That's ridicules. If you've got new power ups already, add this one the same way.
|
|
|
Post by Jeff on Mar 4, 2011 23:23:26 GMT
see, the anti-hack system prevents me from changing things in powerups.cs that higuy gave us (I think)
|
|
|
Post by IsraeliRD on Mar 4, 2011 23:24:52 GMT
You know, from HERE this entire section could have gone to the MBOpal forums instead of derailing a topic. You cannot also claim stuff about your mod without knowing what other mods have, and since you don't know what they have or not, you cannot really claim anything as "no one else has". Anyway, if you want to keep doing this MBOpal talk in other topics or off-topicing topics like this, then you'll start receiving warnings.
|
|
Greg Hutchinson
Advanced Marbler
Newb Programmer[ss:Phil'sEmpire Skin]
MBG NEWB PROGRAMMER
Posts: 324
|
Post by Greg Hutchinson on Mar 4, 2011 23:39:55 GMT
You know, from HERE this entire section could have gone to the MBOpal forums instead of derailing a topic. You cannot also claim stuff about your mod without knowing what other mods have, and since you don't know what they have or not, you cannot really claim anything as "no one else has". Anyway, if you want to keep doing this MBOpal talk in other topics or off-topicing topics like this, then you'll start receiving warnings. Agree. Jeff, try answering questions and making it look like higuy's fault we can't distribute, right? Matan I totaly agree. Stal, we cannot go into the powerups.cs. It has a anti hack on it, and there are 3 files that have just one pu. Y? Idk. I could look though, cause i could just back it up, if that helps. ONTOPIC: Stal, tl;dr. I'm guessing you want to learn how to make a powerup? If so, I'll teach, I made many before so, if thats ur q & needs an a, lemme know.
|
|
|
Post by Stal on Mar 5, 2011 1:30:49 GMT
Jeff You should have a special staff version without that, Jeff. Anyway your question is null as you've just told us what you need to do to solve it. Do that. greg Yeah. I managed to add an object for the mission editor (looks like sj powerup) and can move it around and stuff, but how do I use an onUse() type function? Same for my hazards, addable but they don't do anything. If your wondering, I was guessing^^
|
|
Greg Hutchinson
Advanced Marbler
Newb Programmer[ss:Phil'sEmpire Skin]
MBG NEWB PROGRAMMER
Posts: 324
|
Post by Greg Hutchinson on Mar 5, 2011 1:38:51 GMT
Oh, oops no i don't know that, hahaha. what i know is how to add a powerup and change its sounds and stuff, well text too.
|
|
|
Post by Jeff on Mar 5, 2011 1:41:28 GMT
Greg Hutchinson I will take over for that question brother... @stal wouldn't you use the onpowerupUsed function and then state your conditions within the function.
|
|
|
Post by Stal on Mar 5, 2011 2:01:01 GMT
greg me too Jeff Oh god... how did I not notice you said it compiled correctly earlier on this page? I'll try that now.
|
|
|
Post by Jeff on Mar 5, 2011 2:10:09 GMT
@stal yes that is correct. I compiled it through init.cs and there were no syntax errors. It just wont show up in the game.
|
|
|
Post by Stal on Mar 5, 2011 2:30:08 GMT
Wao... So I used my new powerup and it gave me a game crash I've never seen before. Something about abnormal C++ runtime environment. I was using pu id 10, the change seemed to cause it. Halp?
|
|
|
Post by Jeff on Mar 5, 2011 2:33:05 GMT
Wao... So I used my new powerup and it gave me a game crash I've never seen before. Something about abnormal C++ runtime environment. I was using pu id 10, the change seemed to cause it. Halp? Is there a syntax error that is present in the console. If so, please post.
|
|
|
Post by Stal on Mar 6, 2011 16:56:03 GMT
Entire console.log:
|
|
|
Post by Jeff on Mar 6, 2011 19:07:52 GMT
there is no syntax error as I see. Please post your code so that I can take a look at that.
|
|
dobrakmato
Advanced Marbler
C# Code master[ss:Default Skin]
Are you a XNA developer? Contact me!
Posts: 314
|
Post by dobrakmato on Mar 6, 2011 19:09:26 GMT
How to make marble jump(code) not using spacebar.
|
|
|
Post by Jeff on Mar 6, 2011 19:12:08 GMT
@dobrak mato
make the code of the jump impulse in marble.cs and set a new movement key in defualtbind.cs (i think)
Siezure22, correct me if I am wrong.
|
|
|
Post by Stal on Mar 6, 2011 19:27:39 GMT
datablock ItemData(OOBSoundItem) { // Mission editor category category = "Powerups"; className = "PowerUp"; powerUpId = 10;
activeAudio = DoSuperJumpSfx; pickupAudio = PuSuperJumpVoiceSfx;
// Basic Item properties shapeFile = "~/data/shapes/items/superjump.dts"; mass = 1; friction = 1; elasticity = 0.3; emap = false;
// Dynamic properties defined by the scripts pickupName = "a annoying sound PowerUp!"; useName = "bwahhaa PowerUp"; maxInventory = 1; };
function OOBSoundItem::onpowerUpUse(%this,%obj,%col,%vec, %vecLen) { }
Thats in powerups.cs.
|
|
|
Post by Jeff on Mar 6, 2011 20:16:31 GMT
Seizure22 says,
Well, thats what you would have to do and that probebly explains why it wont show up in game.
BTW, it seems to me that the script does compile but you and I are having the same problem lol
|
|
|
Post by Stal on Mar 6, 2011 23:51:33 GMT
No, I can place the item in game, and pick it up. I get an error when I try to use it. Where would I find Marble:setPowerUp ?
|
|
|
Post by Jeff on Mar 7, 2011 0:23:24 GMT
thats in marble.cs
btw, can I use your code as a model for mbopal?
|
|
|
Post by Stal on Mar 7, 2011 0:31:37 GMT
Sure, it's not very difficult to make though. Anyway I'm not sure what to change. It doesn't have any defined 1-5 kind of thing afaik.
|
|
|
Post by Jeff on Mar 7, 2011 0:36:21 GMT
This would be the general area.
Maybe try:
Just replace that part. Note, this is only a guess.
|
|