Setcustomstate and other problems fix blitz sonic.
BlitzPlus Forums/BlitzPlus Beginners Area/Setcustomstate and other problems fix blitz sonic.
| ||
So i found a sonic 3d engine with source code and when i try to run it with simple minor edits i get The error Not Enough parameters Im using blitzplus please help! |
| ||
Do you think you have provided enough information? At some point in the code, some command that expects X number of parameters is being given less than X number of parameters. |
| ||
@H&K>>notice the mention of "3d" (using BlitzPlus) and realize how entertaining the next questions will be :) official description of BlitzPlus : Create 2D Games and GUI Applications for Windows |
| ||
@Remi Well he posted in the b3b section then posted that it was the wrong section and posted here PLUS "sonic 3d engine" sounds like a positional sound engine, it still might be b+. It just all adds to my question as to if he thinks enough information has been provided. |
| ||
"sonic 3d" is also a Blitz3d game... |
| ||
i can see |
| ||
anyways when i try to use blitz 3d i still get the same error not enough parameters but this time it points me to the code should move this thread onto the blitz3d section or paste the code here? |
| ||
when i try to use blitz 3d i still get the same error not enough parameters but this time it points me to the code this is a good start... should move this thread onto the blitz3d section or paste the code here i doubt anybody will help you to debug/improve the whole code, but if you ask for a specific question we can help you to determine the cause of the error. |
| ||
what i meant should i move the thread or paste the line of code it tells me |
| ||
For a Blitz3d code problem, post in a Blitz3d forum About your error, maybe give us the error message and the line it refers to. (or a screenshot) |
| ||
alright https://gyazo.com/afae4e8d96e1dd8b53b1a5157c25a969 link to screenshot |
| ||
You have accidentally put a space in Graphics3D, turning it into Graphics 3D. Thus it looks like Graphics with just one parameter, a function named 3D(). |
| ||
that fixed that then i get function not found |
| ||
heres the block of code it blames https://gyazo.com/3280646d47570172445bf71a2915f37a |
| ||
When you get back to the code after an error the cursor should on the offending line. And note that using Input as a variable name is asking for trouble. It is a reserved word, as indicated by the syntax coloring. |
| ||
now it changed for some reason but heres the one it points to https://gyazo.com/58cf7156bbcac449c6fa4fc2b7d4ef83 |
| ||
What is your goal ? To fix the whole code ? What if the creator of the code used a modified version of Blitz3d ? Or external libraries ? You may never manage to fix it entirely... If your intent is to create a similar game, i suggest to use the existing meshes/textures/animations/sounds and try to code your own game by studying the code source and the codes on this forum. |
| ||
well my intent is not to make a similar game this is a engine designed to help people make games and plus it even tells you to add a splash screen, engines are base games designed for you to build on top of. |
| ||
so i actually tried running a newer version of blitz3d and i got a different error Function 'SetCustomState' not foundand points me to this https://gyazo.com/115f6b2ca6e55920d7a901d04985c029 |
| ||
What if the creator of the code used a modified version of Blitz3d ? Or external libraries ? (that you don't have) |
| ||
Somewhere there is a command/definition/function in your code or an external code lib that should be called SetCustomState, but you have either typed its name wrong (either here or where in is defined) or it doesn't exist. Ditto to what RemiD said. I have things that I wrote in earlier Bmax builds, that would be easier to start from scratch than to chase old includes and the like |
| ||
On the positive side, you already have a source code with all the complicated formulas/methods and all the necessary meshes/textures/animations/sounds to create a clone/similar game... You just have to learn to code with Blitz3d. in the introduction of Blitz3d it is written : the more effort you put into Blitz Basic the bigger the rewards will be good luck ! |
| ||
The code should have a readme and if I remember they have their own forum. |
| ||
Graphics 3D should be Graphics3D, just sayin. |
| ||
Have you managed to successfully run the original engine code? You mentioned doing minor edits, so there's no way to tell if the problem is in the edits you made or in the original engine source that is missing some files or something. Try to run the original engine source and fix those problems until they're gone. Then can you safely add your edits one by one and test them, if any error comes up you know it's your edits and not the engine. |
| ||
i have tried running it without edits and the same error |
| ||
Well ... I would guess that SetCustomState is part of the SDK, or is calling the SDK. And you dont have it |
| ||
The error message happens because the code tries to use SetCustomState, which is not part of Blitz3D or any other version of Blitz. It must be defined somewhere in the engine code, or possibly in some external library which the engine uses. Did this "sonic 3d engine with source code" come with any instructions? If so then did you read them? |
| ||
No theres no instructions only how to customize the controls. |
| ||
Hello anyone there? |
| ||
hello ! |
| ||
Well ... I would guess that SetCustomState is part of the SDK, or is calling the SDK. And you dont have it The error message happens because the code tries to use SetCustomState, which is not part of Blitz3D or any other version of Blitz. It must be defined somewhere in the engine code, or possibly in some external library which the engine uses. When you found the Sonic 3d code you didn't find everything you need |
| ||
alright have any ideas what i could be so i can try to find it |
| ||
the best approach would be to ask the developer of this game. because for the same external library (decls dll) there could be different versions. So, unless you know the version of the external library, you don't even know what to search for... |
| ||
I guess he just has a decls + dll in the source code he didn't copy/past to blitz3d/userlibs, or simpler, the dll are not free. (SetCustomState is part of an external library that includes some extra Dx stuff ... and I'm pretty sure it's FastImage from fastlibs -> MikhaelV stuff which does probably not work with latest versions of blitz3d) |
| ||
i will look into it if it says anything about including those dlls |
| ||
bobysait you have a point the folder has fastimage.dll it might not be included |
| ||
i tried to include it didnt work its was unable to execute the dll and the bb name is libriary_FastImage |
| ||
Where do you have the Code from ? Maybe someone can download it too, and check it for you ? Its easier if we have the full code instead of small snippets which doesnt really say anything. |
| ||
i just installed it it fixed that now i get too many parameters ugh.. it points me to this Return CreateImageFont( Image, FI_FontProperty ) |
| ||
I GOT IT TO WORK THERE WAS A FOLDER WITH ALL OF THE EXTENSIONS YES! |
| ||
Also i got a memory acces violation it pointed to StartDraw() ; Setup rendering methods SetBlend(FI_ALPHABLEND) SetAlpha(f\Alpha#) SetScale(1, 1) SetColor(f\R, f\G, f\B) ; Render rect DrawRect(0, 0, GAME_WINDOW_W, GAME_WINDOW_H, 1) EndDraw() |
| ||
fixed it by getting a newer version of fastimage |
| ||
but now i get not enough parameters it blames If Len(AnimTexture)>0 And FrameWidth>0 And FrameHeight>0 And FrameCount>0 Then If FI_FontProperty\Width=0 Then FI_FontProperty\Width=FrameWidth If FI_FontProperty\Height=0 Then FI_FontProperty\Height=FrameHeight If FrameCount>256 Then FrameCount=256 For i=0 To (FrameCount-1) If FI_FontProperty\Chars[i]=0 Then FI_FontProperty\Chars[i]=FI_FontProperty\Width Next f=1 Repeat i=Instr(filename,"\",f) If i<>0 Then f=i+1 Until i=0 Texture = LoadAnimTexture( Left(filename,f-1)+AnimTexture, (AnimTextureFlags And $33F) Or $139, FrameWidth, FrameHeight, 0, FrameCount) If flags=FI_SMOOTHFONT Then flags=FI_FILTEREDIMAGE Else flags=FI_NONE EndIf Image = CreateImageEx_( Texture, FrameWidth, FrameHeight, flags ) Return CreateImageFont( Image, FI_FontProperty ) |
| ||
not enough parameters means either that there is one or several missing parameters when you call a function or that the function you call is not the same that the one that the program expects to call (hence the problem of not knowing which versions of the external libs to use) Honestly it would probably be easier if you started from scratch, create a simple scene, and add little by little more entities and logic by using the code sources you have as a guide. (you already have all the necessary procedures, formulas, meshes, textures, animations, images, sounds, fonts.) |
| ||
Once again i do not want to start from scratch and oops i got it wrong its now not enough parameters. |
| ||
then good luck debugging |
| ||
so appareantly it fixed itself idk how that works but now i get Type "menu_machine" Not found and points me too ; ========================================================================================================= Function Menu_Callback(m.Menu_Machine, i.tMenu_Interface, Callback$) Select i\Name$ Case "Test01" Select Callback$ Case "PreStart" PostEffect_Create_FadeIn(0.01, 0, 0, 0) Case "Start" If ((First tPostEffect_Fade) = Null) Then Return True Return False Case "Step" Case "PreEnd" PostEffect_Create_FadeOut(0.01, 0, 0, 0) Case "End" If (First tPostEffect_Fade = Null) Then Return True Return False Case "Change" Case "Pressed" Case "Pre-Render" Case "Post-Render" End Select End Select End Function |
| ||
I FIXED IT IT WAS THE VERSION OF BLITZ 3D I WAS USING IM NOW USING UPDATE 103 |
| ||
CONGRATS, PLEASE DON'T USE EVERY CHAR IN CAPS AS IT IS CONSIDERED AS YELLING AT (when using to chat with others). I see you are excited, but :p Yeah, some of the older Blitzbasic versions have a slightly changed or completly missing commands. |
| ||
Im gonna change the title that to read it if you have any problems |
| ||
By the way, that's not a blitz "plus" program, it's clearly a Blitz3D one. Hope you didn't try to compile it with a blitzplus version ... |
| ||
Dear wiktor, i can't have any problems (i don't feel the need to explain the reasons why it is so). I just told you not to yell, nothing more and nothing else. Because at some point, the people wont answer you, well at least i wont be bothered. |
| ||
I think I had the source to this too, but long time ago. So, if complete, why not share the source with the community(just use mediafire.com or so). It's not the type of game I'm after but I remember this project being very neatly done, with XML used for settings etc. Perhaps other people, mainly beginners, will find it useful to see how things are done. And always nice to see other people solved things. I'm not sure but wasn't this making use of FastLibs? |