SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Help

Thread Tools Search this Thread
Old 07-07-2017   #1
méga trovăo!
vinicius's Avatar
Default how i do for the "RUN SCRIPT" work?

How do I display these letters on the screen when I press a button? I did not find any tutorial on this, and I already saw the srb2 wiki about it, but I could not find where he wrote those letters to appear on the screen.
vinicius is offline   Reply With Quote
Old 07-07-2017   #2
Lach's Avatar

Your best bet is to check out the Lua HUD functions that the game has to offer. If you're unfamiliar with Lua, it'll probably be pretty hard to understand, so make sure you've learnt a little bit at least before attempting anything involving the HUD.

The most primitive HUD function I can think of that falls under your specifications works like this:

hud.add(function(v, player, camera)
	if (player.cmd.buttons & BT_JUMP)
		v.drawString(16, 160, "JUMPING")
		v.drawString(16, 160, "NOT JUMPING")
end, "game")
Basically, "v" represents the game's "drawer" (what renders the HUD), and "player" represents the player the drawer is currently running for. This code says, if the player is holding down the jump button, have the drawer print "JUMPING", otherwise (i.e. the player is not holding jump), print "NOT JUMPING".
Lach is offline   Reply With Quote
Old 07-08-2017   #3
Monster Iestyn
Friendly Neighbour-Hood
Monster Iestyn's Avatar

...I think he was actually talking about this linedef effect:

In order to make pressing a button run a script using this linedef type, you need to make a "linedef executor". There's a tutorial for making a linedef executor here: (the example is kind of similar to what you want, except pressing the button opens a door instead of running a script)

Just so you know though, Linedef type 415 only runs text files with a list of console commands, not Lua or SOC. Old level packs that use the "Run Script" linedef, such as Mystic Realm, usually used "cecho" to make text appear in the middle of the screen.
My page stuffed full of MIDI goodness!
The Hitchhiker's Guide to the Robo-Hoodiverse
Timeline of Sonic Robo Blast History!

That's an uppercase i, not a lowercase L, for the record. Also, it's pronounced "Yes-tin".

Last edited by Monster Iestyn; 07-08-2017 at 12:53 AM.
Monster Iestyn is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 12:11 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.