Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
You also have an extra } on line 50
You're also not returning anything in ServerExecute, make sure you add "return null;" at the end.
You probably also want to do: SetText("" + var.Value), since integers don't implicitly convert to strings.
https://pastebin.com/pTnM29g1
The editor does not report any compiling errors, however whenever I try to palce the script, I crash
I also apologise for my poor understanding.
"b" here will always be null, because the engine does not construct a GUIBuilder for you. You will have to obtain the gamemode's GUIBuilder@ at runtime, eg. get it from a casted g_gameMode in the Initialize function of the script and then call LoadWidget.
I believe the editor crashes because of this because an exception in the constructor means the object will always be null, and the editor doesn't like that. I'll see if I can add an error for this instead of a crash.
Also, in your logfile, it shows this after the crash:
So I need to initialize this?
https://pastebin.com/W4azsCwZ
https://pastebin.com/GwjCBiK6 = The CheckScore Script
I cannot see why the script would not want to work however.
I tried using the SetText to say something, but that did not appear either, so It must be something within that
Thinking about your code again, if you intend to have multiple ChangeScore worldscripts in your level, the behavior of your interface might not be what you expect, depending on how you handle the drawing of the widgets. (Since that would mean you have multiple widget hosters at the same time)
As well as that, when you want to draw the interface, where does the code actually go?a When you make an instance of the widget hoster and such, is this inside a new script, or one that already exsists (which I cannot locate)
m_scoobyWidget.SetText("♥♥♥♥);
This was under the update function.
Which worked correcty, as it was shown. So why does this not work on my ChangeScore script?
However, since you say you are already using HUDSurvival (which I assume you're doing in a custom scripted gamemode), you need to refer to that interface rather than make a completely new one with your worldscript.
For example, in the case that you are inheriting from (or directly using) the Survival gamemode, you could do something like this in a worldscript: