Jump to content


YOUSLESS

Member Since 01 Sep 2021
Offline Last Active Jul 02 2022 01:56 AM

Topics I've Started

Understanding SGroups

30 June 2022 - 02:33 AM

Hello, I have started trying to use SGroups as a means to read input from the keyboard

function Punisher_Init()
	ind = Tut_GetLocalPlayerIndex()
	client = World_GetPlayerAt(ind)
	SGroup_Create("1")
	SGroup_Create("2")
	SGroup_Create("3")
	SGroup_Create("4")
	W40k_AssignHotkeySGroup( "1", 0 )
	W40k_AssignHotkeySGroup( "2", 9 )
	W40k_AssignHotkeySGroup( "3", 8 )
	W40k_AssignHotkeySGroup( "4", 7 )
	Rule_Add(Rule_Monitor1)
	print("successfully initialized")
end

function Rule_Monitor1()
	if SGroup_IsSelected("1") then
		print("pressed 0")
	end
end

When I press 0 the game selects an empty squad but when I check the logs nothing printed, what am I doing wrong?


triggering SCAR function with button press

29 June 2022 - 01:39 AM

Hello, I am wondering if I can trigger a scar function in my scar script by pressing a key on my keyboard. I was looking around in the ScarDoc and there doesn't seem to be an obvious way to do it


Need Help Reading Files with Scar

27 June 2022 - 04:18 AM

I found out that the standard lua library "io" doesn't work with scar, however, I saw lua folders the game folder. So I made a lua file of my own which contains a class that reads a txt file. and I am wondering if I can import this lua file into scar or read data from it somehow, since lua's "require" doesn't work in SCAR.


Scar Group objects Question along with other Scar Questions

25 June 2022 - 09:21 PM

I'm working with several functions that return these group objects. for example Player_GetEntities returns an Egroup, and I wonder if I can randomly select individual entities in the Egroup. It doesn't seem like it works like a standard Lua table with some added functionality. I've been looking around the groups.scar file and groupcallers.scar file and there doesn't seem to be any underlying data structure I can access.

Aside from these group objects I've been trying to print the players name with Player_GetDisplayName. But it prints out "table: 312B0D10" does this mean the LocString object is a table? and if so how do I get the display name out of it?

And lastly I've been tryong to get an alert to show up with the following line:
UIWarning_Show("hello World")

but it seems it doesn't do anything, I feel I'm missing something but I don't know what.

Thanks in advance.


SCAR question

24 June 2022 - 01:14 AM

Hello, I have recently been poking around in the scardoc file and I want to start working on a script that works across all maps, all the implementations I've see so far are applied to an individual map. Is it possible to make a SCAR file that is used by every map?