SRB2 Message Board  

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

Reply
 
Thread Tools Search this Thread
Old 08-13-2018   #1
Bigadre
Hello!
Default Scriping help

Code:
addHook("ThinkFrame", function()
	for player in players.iterate do
		if player.mo.skin ~= "Euphorica" then
			continue
			
					if not (player.cmd.buttons & BT_CUSTOM1) then
			player.objspawntapready = true
			player.objspawntapping = false
		elseif player.objspawntapready then
			player.objspawntapping = true
			player.objspawntapready = false
		else
			player.objspawntapping = false
		end
 
		if player.objspawntapping then -- New line
			player.spawnedspring = P_SpawnMobj(player.mo.x+FixedMul(0*FRACUNIT, cos(player.mo.angle)), -- New line
					player.mo.y+FixedMul(0*FRACUNIT, sin(player.mo.angle)), player.mo.z, MT_BLUESPRING)
		end -- New line
	end
end)
i may need help .-.
Bigadre is offline   Reply With Quote
Old 08-13-2018   #2
Rapidgame7
Rookie modder
 
Rapidgame7's Avatar
Default

Quote:
Originally Posted by Bigadre View Post
i may need help .-.
With?

I assume you're getting an error - Before "end -- New line" an assignment operator is missing. If you're setting player.mo.y to something else, you need an equal sign instead of a plus before FixedMul.

EDIT after reading the reply below: haha whoops i don't know how did i miss that, my b
__________________
Ever tried to start a project until you find out it's too complicated then you abandon it

Last edited by Rapidgame7; 08-13-2018 at 02:42 PM. Reason: edite
Rapidgame7 is offline   Reply With Quote
Old 08-13-2018   #3
Zwip-Zwap Zapony
Please just call me Zappy.
 
Zwip-Zwap Zapony's Avatar
Default

Quote:
Originally Posted by Rapidgame7 View Post
- I assume you're getting an error - Before "end -- New line" an assignment operator is missing. If you're setting player.mo.y to something else, you need an equal sign instead of a plus before FixedMul.
That line is part of the arguments for P_SpawnMobj in the above line. Note that in said "above line", there are 3 ('s but only 2 )'s, while in said "that line", there are 2 ('s but 3 )'s.
Regardless, both of the FixedMul's in the P_SpawnMobj multiply something by 0, so the entire FixedMul functions might as well just be removed (as well as the plusses in front of them).
Zwip-Zwap Zapony is offline   Reply With Quote
Old 08-13-2018   #4
Lach
hop
 
Lach's Avatar
Default

Assuming this is a player ability for a Euphorica character, I think you may just be missing an "end" after "continue".

Also, player.mo.skin is always composed of lowercase letters, so you should un-capitalize "Euphorica" (replace it with "euphorica").
Lach is offline   Reply With Quote
Old 08-15-2018   #5
Bigadre
Hello!
Default

I'm just getting this error now:
WARNING: ./DOWNLOAD/Euphorica.wad|LUA_SPRI:22: ')' expected (to close '(' at line 1) near '<eof>'
Loading main config from ./DOWNLOAD/Euphorica.wad


Code:
addHook("ThinkFrame", function()
	for player in players.iterate do
		if player.mo.skin ~= "euphorica" then
			continue
				end
			
					if not (player.cmd.buttons & BT_CUSTOM1) then
			player.objspawntapready = true
			player.objspawntapping = false
		elseif player.objspawntapready then
			player.objspawntapping = true
			player.objspawntapready = false
		else
			player.objspawntapping = false
		end
 
		if player.objspawntapping then -- New line
			player.spawnedspring = P_SpawnMobj(player.mo.x, -- New line
					player.mo.y, player.mo.z, MT_BLUESPRING)
		end -- New line
	end
end

Last edited by Bigadre; 08-15-2018 at 01:38 PM. Reason: Posting the new Script
Bigadre is offline   Reply With Quote
Old 08-15-2018   #6
Rumia1
Backseat Developer
 
Rumia1's Avatar
Default

You forgot your close parenthesis on the last "end".
__________________
Quote:
Originally Posted by Cirno
Egguman-senpai...
Rumia1 is offline   Reply With Quote
Reply

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 11:46 AM.


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