Jump to content

Recommended Posts

Posted

I often see comments about the scripting wiki missing information or wishing it was "moar betterer" without giving specifics. Use this thread to request which pages you want to see improved or created. Please limit it to scripting engine and mission making topics. 

https://wiki.hoggitworld.com/view/Simulator_Scripting_Engine_Documentation

  • Thanks 2

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

  • 2 weeks later...
Posted

One thing I noticed when looking for a function by name, was, the routing of where to start.

I've got about four pages bookmarked, class functions, singleton functions, enums which are always useful https://wiki.hoggitworld.com/view/DCS_enum_weapon_flag and the tasking one. I find that finding things and navigating is hard on the site. So I don't I just try each page for a function not realising their differences.

For example. To find getResourceMap() and starting at the home page --> https://wiki.hoggitworld.com/view/Simulator_Scripting_Engine_Documentation
You need to know that getResourceMap() is in the Warehouse class to click --> https://wiki.hoggitworld.com/view/DCS_Class_Warehouse
Then this isn't a list of functions, in fact, its not listed as a member function? It's a static function, whatever that means and its lower on the page.

For idiots like me at least, a big bucket of functions would make more sense than different pages that don't make sense. Maybe just understanding why they are split could help me to find what I was looking for?

It probably makes sense to someone, and I don't have great ideas on a different way of doing it, so I apologise, but I think it's hard to navigate and find things.

  • Like 1

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Posted

So this page?

https://wiki.hoggitworld.com/view/Category:Functions

Granted it mixes in gameGUI API functions. 

 

The "Static Function" naming comes from what the original documentation had for functions that are part of a class, but don't require the object in order to actually run and return data. For instance X.getByName is a static function since it returns the object. Similarly getDescByName() is the same as object:getDesc(), but getDescByName takes a string value to return the desc table. Warehouse.getResourceMap is the same way. It probably wouldn't hurt to add the static functions to the list of class functions for each class. 

  • Like 2

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted

First, I greatly appreciate all the work you and others have put into those pages. THANK YOU!

Now, everything I write here is not criticism, but merely ideas to maybe improve this great work. I'll post whenever one of my (frequent) trips to the pages yields an unexpected sight or somehthing may be clearer.

Here's one I came across today:

net.get_player_list()

I recommend to amend the description by the (implicit, but not obvious) information that the table returned is a table of playerID.

Here's a demo script

net.log("all players:")
local all = net.get_player_list() -- list of playerID
for idx, pid in pairs (all) do 
	pName = net.get_player_info(playerID, 'name')
	net.log("player <" .. pName .. ">")
end

 

  • Like 1
Posted

Some suggestions for onPlayerChangeSlot(id)

 

The description could mention that the id passed is the playerID (people may assume it's a slotID).

It may also help to remind people here (and in other places) that slotID and unitID are the same, and can be used interchangeably (I'm unsure in this regard when it comes to crew, I did not find any place that describes how it is handled if you try to getUnitProperty with a crew slot, e.g. "23_2" for a Huey).

To underscore this, perhaps the following demo is helpful

function sq.onPlayerChangeSlot(playerID) 
	local slotID = net.get_player_info(playerID, 'slot') -- get slot
	local uName = DCS.getUnitProperty(slotID, DCS.UNIT_NAME) -- slotID and unitID are the same!
	net.log("player <" .. name .. "> slotted to <" .. uName .. ">")
end

 

  • Like 1
Posted
On 8/17/2023 at 7:01 AM, Grimes said:

So this page?

https://wiki.hoggitworld.com/view/Category:Functions

Granted it mixes in gameGUI API functions. 

 

The "Static Function" naming comes from what the original documentation had for functions that are part of a class, but don't require the object in order to actually run and return data. For instance X.getByName is a static function since it returns the object. Similarly getDescByName() is the same as object:getDesc(), but getDescByName takes a string value to return the desc table. Warehouse.getResourceMap is the same way. It probably wouldn't hurt to add the static functions to the list of class functions for each class. 

omg, you see I never knew that existed!! I was finding them through... I can't explain how i was finding/looking/searching!! Would it help to understand how people use first to be able to fix how they are failing maybe? For me I often want to scan the lot because I am trying to see if there is another function I maybe didn't consider. Not sure if that helps 🙂

On 8/17/2023 at 11:18 AM, cfrag said:

Some suggestions for onPlayerChangeSlot(id)

 

The description could mention that the id passed is the playerID (people may assume it's a slotID).

It may also help to remind people here (and in other places) that slotID and unitID are the same, and can be used interchangeably (I'm unsure in this regard when it comes to crew, I did not find any place that describes how it is handled if you try to getUnitProperty with a crew slot, e.g. "23_2" for a Huey).

To underscore this, perhaps the following demo is helpful

function sq.onPlayerChangeSlot(playerID) 
	local slotID = net.get_player_info(playerID, 'slot') -- get slot
	local uName = DCS.getUnitProperty(slotID, DCS.UNIT_NAME) -- slotID and unitID are the same!
	net.log("player <" .. name .. "> slotted to <" .. uName .. ">")
end

 

This one threw me, but iirc its the way it was written in the API docs just pasted in. It's weird that no one but Grimes actually updates this, I'm wondering if this is the barrier. I've updated Wikipedia more times than API docs.

  • Like 1

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Posted
6 hours ago, Pikey said:

It's weird that no one but Grimes actually updates this, I'm wondering if this is the barrier. I've updated Wikipedia more times than API docs.

They never setup the email service to create accounts or to recover passwords on their wiki. Which means that someone with moderator powers, usually me, has to create an account for anyone who wants one. I've only done it a handful of times and the users either forget their login credentials or never actually make any edits. On one hand its spam free which plagued ED's wiki when they had one. On the other its a gate that blocks the advantage of it being a wiki. So I just edit stuff when people give specific examples of pages that need love or see someone asking for help and the relevant page could use some edits. 

  • Like 1

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted

Here's possible suggestion for (the recently added - great stuff!) method Airbase.setCoalition()

I recommend you add the following to notes:

"Changing an airbase's coalition via setCoalition() will not trigger a capture event even if the airbase belonged to a different faction prior to calling setCoalition()."

  • Like 1
  • 10 months later...
Posted

As of 2.9.6 the S_EVENT_MAX is now 61 while the wiki still shows 46

S_EVENT_SIMULATION_START = 46
S_EVENT_WEAPON_REARM = 47
S_EVENT_WEAPON_DROP = 48
S_EVENT_UNIT_TASK_COMPLETE = 49
S_EVENT_UNIT_TASK_STAGE = 50
S_EVENT_MAC_EXTRA_SCORE = 51
S_EVENT_MISSION_RESTART = 52
S_EVENT_MISSION_WINNER = 53
S_EVENT_RUNWAY_TAKEOFF = 54
S_EVENT_RUNWAY_TOUCH = 55
S_EVENT_MAC_LMS_RESTART = 56
S_EVENT_SIMULATION_FREEZE = 57
S_EVENT_SIMULATION_UNFREEZE = 58
S_EVENT_HUMAN_AIRCRAFT_REPAIR_START = 59
S_EVENT_HUMAN_AIRCRAFT_REPAIR_FINISH = 60
S_EVENT_MAX = 61

Adding these events to the world enum could be useful, I think.
Thanks for all your efforts over the years in the DCS community, Grimes.

Posted

https://wiki.hoggitworld.com/view/DCS_singleton_world
 

Which page were you looking at?

On 7/16/2024 at 3:48 PM, Moezilla said:

As of 2.9.6 the S_EVENT_MAX is now 61 while the wiki still shows 46

S_EVENT_SIMULATION_START = 46
S_EVENT_WEAPON_REARM = 47
S_EVENT_WEAPON_DROP = 48
S_EVENT_UNIT_TASK_COMPLETE = 49
S_EVENT_UNIT_TASK_STAGE = 50
S_EVENT_MAC_EXTRA_SCORE = 51
S_EVENT_MISSION_RESTART = 52
S_EVENT_MISSION_WINNER = 53
S_EVENT_RUNWAY_TAKEOFF = 54
S_EVENT_RUNWAY_TOUCH = 55
S_EVENT_MAC_LMS_RESTART = 56
S_EVENT_SIMULATION_FREEZE = 57
S_EVENT_SIMULATION_UNFREEZE = 58
S_EVENT_HUMAN_AIRCRAFT_REPAIR_START = 59
S_EVENT_HUMAN_AIRCRAFT_REPAIR_FINISH = 60
S_EVENT_MAX = 61

Adding these events to the world enum could be useful, I think.
Thanks for all your efforts over the years in the DCS community, Grimes.

 

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...