Jump to content


YOUSLESS

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

Posts I've Made

In Topic: Understanding SGroups

01 July 2022 - 03:14 AM

Update:

function Punisher_Init()
	ind = Tut_GetLocalPlayerIndex()
	client = World_GetPlayerAt(ind)
	build = Player_GetEntities(client)
	PID = Player_GetID(client)
	hq = EGroup_GetSpawnedEntityAt(string.format("__Player%dEntities", PID),1)
	spawn = Entity_GetPosition(hq)
	child = Squad_Create("guard_squad_civilian_child_a", client, spawn, 0)
	one = SGroup_Create("1")
	two = SGroup_Create("2")
	three = SGroup_Create("3")
	four = SGroup_Create("4")
	SGroup_Add(one, child)
	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()
	Misc_GetSelectedSquads(SGroup_CreateIfNotFound("sg_Player1selection"))
	t_builder1 = Util_MakeBlueprintTable(
		"guard_squad_civilian_child_a"
		)
	if SGroup_ContainsBlueprints("sg_Player1selection", t_builder1, false) ==  true then
		print("pressed 0")
	end
end

I switched to this, SGroup_IsSelected didn't seem to work, but this configuration isn't working either, I think its becuase the squad I spawn in doesn't actually show up but I'm trying to find out why


In Topic: Understanding SGroups

30 June 2022 - 10:07 PM

I am not 100% sure, but I think the SGroup must not be empty...

(Arbitrary conjecture) I think that the SGroup_IsSelected boolean function  is True, only if at least one squad of the SGroup is selected...

reading the documentation it says all squads have to be selected, I'll try to put something in the SGroup. Its done with Sgroup_Add right?


In Topic: triggering SCAR function with button press

29 June 2022 - 01:49 AM

I just found this thread https://forums.revor...ript-questions/ and I think it solved my issue

 

EDIT:
After reviewing that forum post I realized that the only way to trigger a scar function with a key press is by creating a bunch of squads and assigning hotkeys to them, I might just do that and make the squads. But I would like to know if there is a better way? 


In Topic: Scar Group objects Question along with other Scar Questions

26 June 2022 - 05:57 AM

Thank you again Gambit 


In Topic: Scar Group objects Question along with other Scar Questions

26 June 2022 - 12:18 AM

also, can you use lua extensions in SCAR? I want to use the socket library so my scar script can talk to a python script running locally
 

EDIT: I tried using the io library and I got an "attempt to index a nil value" from that does SCAR have its own io?