User:Zeldrake: Difference between revisions

From Total War Modding
mNo edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:
bachsadhjsajkd
bachsadhjsajkd


<syntaxhighlight>
<syntaxhighlight lang="text">
YES WE FOUND A CODE BLOCK BUTTON
YES WE FOUND A CODE BLOCK BUTTON
NOW_DO_THESE_UNDERSCORES_ACTUALLY_WORK
NOW_DO_THESE_UNDERSCORES_ACTUALLY_WORK
Line 12: Line 12:


In this document, let’s take a look at two example commands to breakdown.
In this document, let’s take a look at two example commands to breakdown.
     <code>Command: transfer_region_to_faction
     <Command: transfer_region_to_faction
     Description: Transfer a region ownership to a faction.
     Description: Transfer a region ownership to a faction.
     Usage: transfer_region_to_faction("region", "faction")</code>
     Usage: transfer_region_to_faction("region", "faction")


NOW WHY DOESN'T THAT WORK
NOW WHY DOESN'T THAT WORK
    <syntaxhighlight lang="text">Command: transfer_region_to_faction
    Description: Transfer a region ownership to a faction.
    Usage: transfer_region_to_faction("region", "faction")</syntaxhighlight>you can see the above works because it's done with not SYNTAXHIGHLIGHT not CODE<syntaxhighlight lang="abap">
Do not tell me about whatever language AND
syntax highlighting this SUM
may have going on in it because I really don't care
</syntaxhighlight>ahsadsad<syntaxhighlight lang="lua">
It doesn't let me click None in the box :(
I mean
Why does it need to click None?
Surely we can just click Lua instead, right?
</syntaxhighlight>sjhsajkhdsad<syntaxhighlight lang="lua">Command: transfer_region_to_faction
    Description: Transfer a region ownership to a faction.
    Usage: transfer_region_to_faction("region", "faction")</syntaxhighlight>Well, that complains about lua errors because it's the documentation for something as opposed to the actual function itself, so why don't we actually try it on some actual lua code that actually exists
<code>
function(context)
    local char_cqi = context:character():command_queue_index()
    local char_lookup_str = cm:char_lookup_str(char_cqi)
    local mf_cqi = context:character():military_force():command_queue_index()
   
    cm:grant_unit_to_character(char_lookup_str, "tutorial_big_bat")
    cm:apply_effect_bundle_to_force("tutorial_free_hair", mf_cqi, 5)
end,</code>
<syntaxhighlight lang="lua">
function(context)
    local char_cqi = context:character():command_queue_index()
    local char_lookup_str = cm:char_lookup_str(char_cqi)
    local mf_cqi = context:character():military_force():command_queue_index()
   
    cm:grant_unit_to_character(char_lookup_str, "tutorial_big_bat")
    cm:apply_effect_bundle_to_force("tutorial_free_hair", mf_cqi, 5)
end,
</syntaxhighlight>Still complains about error messages but you can see how nice and organized it looks AND MORE IMPORTANTLY THE UNDERSCORES AREN'T BROKEN BECAUSE THERE AREN'T ANY NASTY-LOOKING BOXES AROUND THE TEXT
But you can also see that the funny looking boxes are DIFFERENTLY SHAPED funny looking boxes
Alright, now we have all we need to build our callback function! Let’s mush it all together real quickly.
<function(context)
    local char_cqi = context:character():command_queue_index()
    local char_lookup_str = cm:char_lookup_str(char_cqi)
    local mf_cqi = context:character():military_force():command_queue_index()
   
    cm:grant_unit_to_character(char_lookup_str, "tutorial_big_bat")
    cm:apply_effect_bundle_to_force("tutorial_free_hair", mf_cqi, 5)
end,</code>
That's the copy from the original and you can see how there's all sorts of funny-looking spaces and indents and everything and it all looks VERY fancy but also HAS THOSE ANNOYING SILLY BOXES AROUND IT
So we changed all the unspecified languages to text, does that make the marker at the bottom go away?

Latest revision as of 22:59, 16 August 2026

this is a sandbox for Zel to debug whatever is going on with the underscores

Some code goes here, right? no that's not it

bachsadhjsajkd

YES WE FOUND A CODE BLOCK BUTTON
NOW_DO_THESE_UNDERSCORES_ACTUALLY_WORK
AND_IF_NOT_WHY
TELL_ME

In this document, let’s take a look at two example commands to breakdown.

    <Command: 	transfer_region_to_faction	
    Description: 	Transfer a region ownership to a faction.	
    Usage: 		transfer_region_to_faction("region", "faction")

NOW WHY DOESN'T THAT WORK

Command: 	transfer_region_to_faction	
     Description: 	Transfer a region ownership to a faction.	
     Usage: 		transfer_region_to_faction("region", "faction")

you can see the above works because it's done with not SYNTAXHIGHLIGHT not CODE

Do not tell me about whatever language AND 
syntax highlighting this SUM
 may have going on in it because I really don't care

ahsadsad

It doesn't let me click None in the box :( 

I mean

Why does it need to click None?

Surely we can just click Lua instead, right?

sjhsajkhdsad

Command: 	transfer_region_to_faction	
     Description: 	Transfer a region ownership to a faction.	
     Usage: 		transfer_region_to_faction("region", "faction")

Well, that complains about lua errors because it's the documentation for something as opposed to the actual function itself, so why don't we actually try it on some actual lua code that actually exists

function(context)

   local char_cqi = context:character():command_queue_index()
   local char_lookup_str = cm:char_lookup_str(char_cqi)
   local mf_cqi = context:character():military_force():command_queue_index()
   
   cm:grant_unit_to_character(char_lookup_str, "tutorial_big_bat")
   cm:apply_effect_bundle_to_force("tutorial_free_hair", mf_cqi, 5)


end,


function(context)

    local char_cqi = context:character():command_queue_index()
    local char_lookup_str = cm:char_lookup_str(char_cqi)
    local mf_cqi = context:character():military_force():command_queue_index()
    
    cm:grant_unit_to_character(char_lookup_str, "tutorial_big_bat")
    cm:apply_effect_bundle_to_force("tutorial_free_hair", mf_cqi, 5)

end,

Still complains about error messages but you can see how nice and organized it looks AND MORE IMPORTANTLY THE UNDERSCORES AREN'T BROKEN BECAUSE THERE AREN'T ANY NASTY-LOOKING BOXES AROUND THE TEXT

But you can also see that the funny looking boxes are DIFFERENTLY SHAPED funny looking boxes

Alright, now we have all we need to build our callback function! Let’s mush it all together real quickly.

<function(context)

    local char_cqi = context:character():command_queue_index()
    local char_lookup_str = cm:char_lookup_str(char_cqi)
    local mf_cqi = context:character():military_force():command_queue_index()
    
    cm:grant_unit_to_character(char_lookup_str, "tutorial_big_bat")
    cm:apply_effect_bundle_to_force("tutorial_free_hair", mf_cqi, 5)

end,

That's the copy from the original and you can see how there's all sorts of funny-looking spaces and indents and everything and it all looks VERY fancy but also HAS THOSE ANNOYING SILLY BOXES AROUND IT


So we changed all the unspecified languages to text, does that make the marker at the bottom go away?