Edit: I'm gonna end up throwing random questions in to this post. I may as well have 'em convenient for other people
Does $get_arrayfind return the idx of the of the string found, or does it return the string found?
Is ent_expowner essentially the person who killed the monster or is it who got the most xp, or is it a token of player ids of who got the xp?
Is it possible to pull information from a monster that has died?
Is the game_master persistent across map changes?
If you use applyeffect and in the effect use $get(ent_creationowner,id), will it grab the id of whoever applied the effect? Or would it grab who spawned the npc you're applying the effect on?
If you #include a script into another multiple times, does it create "duplicates?" I'm gonna test this later to see if it does.
Do conditions return true if its 1 or greater than 1? If it's set to a string or is 0 does it not pass?
What exactly does $vec(x,y,z) do? Could I just use (x,y,z) as coordinates to spawn something?
How would I get a param passed from an applyeffect?
How is $within_cone used? I see //(<point origin>,<cone origin>,<cone angles>,<cone apex angle>) in ms.stx, but I don't know what point origin or cone origin means. What does it return?
Is it possible to assemble a string that could then pull information from a var via the $get(<ent>,scriptvar,<assembled string of the var name>) ?
Still confused on those if conditionals without brackets...
Does <action> mean the stuff in:
Like the "add" "remove" "cleartype" 'n stuff?
Does setting a quest to '0' still save it to the character?
Does $get_arrayfind return the idx of the of the string found, or does it return the string found?
When using callevent or callexternal or calleventloop, is it all called on the same frame?Thothie said:Index, or -1 if not found. (Like "$get_find_token(<token_sting>,<search_string>)")
Thothie said:Yes. (Unless you use a delay, of course.)
Is ent_expowner essentially the person who killed the monster or is it who got the most xp, or is it a token of player ids of who got the xp?
Thothie said:Neither. It's the target items or projectiles are passing experience to. (Really only applies to projectiles created via tossprojectile.)
There's, currently, no script array from which to pull the IDs of the players who struck the monster. Closest you can get is ent_laststruck (the last entity that struck the monster - which maybe an NPC or entity summoned by a player). Been meaning to implement one, as the information is stored code side on the mob, but not sure how easy it's going to be.
Is it possible to pull information from a monster that has died?
Thothie said:You *might* be able to pull some information via $get(<dead_target>,scriptvar,<xxx>) for a few seconds, but no further scripts will run on the entity once game_death and anything called from there (without a delay) has completed. Generally, if you want a dead mob to store information, have it do so via a callexternal on the game_master or player where the mob calls game_death. (Though you can resurrect it by using "setalive 1" in game_death, but it leads to complications - see monsters reference skeleton_base or mummy_base.)
Is the game_master persistent across map changes?
Thothie said:No, it resets with each map change. Globals (setvarg) persist between map changes, but only if there's no crash.
If you use applyeffect and in the effect use $get(ent_creationowner,id), will it grab the id of whoever applied the effect? Or would it grab who spawned the npc you're applying the effect on?
Thothie said:The latter.
(ent_creationowner is the script that spawned the script, when said script is spawned via createnpc.)
Most applyeffects pass the inflicter as the second parameter for this reason.
[/code]
If you #include a script into another multiple times, does it create "duplicates?" I'm gonna test this later to see if it does.
Thothie said:I've... Never tried that... But I assume so.
The Test said:It appears that it doesn't add a copy. The way I tested it was:
Code://The first script #include test_scripts/test #include test_scripts/test { setvard TESTMAN 0 } { game_heardtext callevent dotestman //This event adds 1 to TESTMAN saytext TESTMAN }
The saytext only added 1 every time, however, when adding two copies of "dotestman" to the original script and removing the includes, it adds two every time, so I don't think the event is getting override with each other.Code://The "test" script { dotestman setvard TESTMAN $math(add,TESTMAN,1) }
Do conditions return true if its 1 or greater than 1? If it's set to a string or is 0 does it not pass?
Thothie said:IIRC Conditions will return true so long as it is non-zero and not unset.
What exactly does $vec(x,y,z) do? Could I just use (x,y,z) as coordinates to spawn something?
Thothie said:It assembles a series of numbers and/or vars into a proper vector, or returns a specific element of a vector. And yes, you can use it to define a spawn point. Generally, rather than passing raw vector data (eg. "(2000,2000,2000)"), it's better to use $vec(2000,2000,2000) as it generally prevents parsing issues and generates the proper floats.
How would I get a param passed from an applyeffect?
Thothie said:Applyeffect <target> <effect_script> [params...] should pass all params to game_activate of <effect_script>.
How is $within_cone used? I see //(<point origin>,<cone origin>,<cone angles>,<cone apex angle>) in ms.stx, but I don't know what point origin or cone origin means. What does it return?
Returns 1 if <point_origin> is within the defined cone.
Is it possible to assemble a string that could then pull information from a var via the $get(<ent>,scriptvar,<assembled string of the var name>) ?
Well, for future reference, while I would avoid it, I tested it, and it does indeed work...
Still confused on those if conditionals without brackets...
No, it won't get there.
Provided the terminating conditional is at the lowest level, it exits the event, regardless of the brackets that follow.
Mind that you can't use "else" nor "else if" with a terminating conditional either... So...Code:setvard SOMETHING_IS 0 if ( !SOMETHING_IS ) { if SOMETHING_IS saytext This ain't happening } saytext This *is* happening... if SOMETHING_IS //This ain't, thus we stop here saytext So this isn't happening. if ( SOME_CONDITIONAL ) //not ever seeing this { saytext Not gettin here. if ( XX_XX == XX_XX ) { saytext True as that was, we ain't ever gonna test it, cuz we stopped awhile ago. } } saytext Not getting here either. if ( SOME_OTHER_CONDITIONAL ) { saytext Also not gettin here. } saytext Nor here.
Code:
game_scriptflag_update //<action> <name> <type> <value> <base_expire_time> - called whenever scriptflags are updated via scriptflags command - do not alter scriptflags here or you may cause an infinite loop (delay 0.1 secs)
Code:
scriptflags //New flag tracking system, has several formats, depending on desired action:
//scriptflags <target> add <name> <type> [value] [expiretime:-1] [expiremsg]
//- adding a scriptflag with a duplicate name resets its value, and its expire time
//- unless the name starts with "stack", in which case it should have an expire time set
//scriptflags <target> remove <name>
//scriptflags <target> cleartype <type> - removes all of <type> from <target>
//scriptflags <target> clearall - removes all scriptflags from target ent
//scriptflags <target> remove_expired - removes expired flags from <target>
//scriptflags <target> edit <name> <type> <value> [expiretime] [msg] - edits properties of first flag found with this name
Yes, the first param it receives is the second param of the scriptflags command.
Does setting a quest to '0' still save it to the character?
Apparently yes, darnitall.
There's a quest erase function, but it tends to cause memory dealloc errors.
Last edited: