[mapscripts] Changing values and keys at existing entities
Moderators: Forum moderators, developers
[mapscripts] Changing values and keys at existing entities
Hello,
how can I change value for existing key at at existing map entity (concretely trigger_objective_info)?
I spent whole afternoon with searching solution but Google, Wolfwiki and Search didn't help.
I tried to use 'remove' function and remove old entity + create new entity with wanted keys and values. But it didn't work (I used 'targetname' with function 'remove'), becouse (imo) entity has not defined key 'scriptname'.
Entity has only these keys: classname, score, shortname, spawnflags, target, track. (I want to change track and shortname)
Thanx in advance
how can I change value for existing key at at existing map entity (concretely trigger_objective_info)?
I spent whole afternoon with searching solution but Google, Wolfwiki and Search didn't help.
I tried to use 'remove' function and remove old entity + create new entity with wanted keys and values. But it didn't work (I used 'targetname' with function 'remove'), becouse (imo) entity has not defined key 'scriptname'.
Entity has only these keys: classname, score, shortname, spawnflags, target, track. (I want to change track and shortname)
Thanx in advance
If you don't do it, someone else will.
Look for spawn and set in http://wolfwiki.anime.net/index.php/Map_scripting
Note that not all values can be meaningfully set this way. Some are used by the compiler, and some are treated in special ways by the gamecode that won't react nicely to being fiddled in mapscript.
Note that not all values can be meaningfully set this way. Some are used by the compiler, and some are treated in special ways by the gamecode that won't react nicely to being fiddled in mapscript.
send lawyers, guns and money
Thaks, but it still don't work..
I read: #955 - some trigger_objective_info fields cannot be modified from mapscript. We now allow trigger_objective_info fields to be changed in mapscript spawn section. Some (spawnflags, customimage, score, target, track, message) must be changed in the first frame, or first 3 frames. --> what does it mean for me?
Here is original part of script:
If I add 'set' command + change 'track' and 'shortname' - it don't work -->
I tried add (before 'set') 'wait' 50, 100, 150, 200 - nothing helped.
Related Entity:
So.. what did I omit at that script? Where is a problem?
Thnaks for any ideas
I read: #955 - some trigger_objective_info fields cannot be modified from mapscript. We now allow trigger_objective_info fields to be changed in mapscript spawn section. Some (spawnflags, customimage, score, target, track, message) must be changed in the first frame, or first 3 frames. --> what does it mean for me?
Here is original part of script:
Code: Select all
barrier1
{
spawn
{
wait 200
constructible_class 3
}
death
{
wm_addteamvoiceannounce 0 "lostchildren_obj1_des"
wm_addteamvoiceannounce 1 "lostchildren_obj1_des"
trigger game_manager obj1_des
}
}
Code: Select all
barrier1
{
spawn
{
wait 50
set
{
shortname "^3The First Barrier^7"
track "The First Barrier"
}
wait 200
constructible_class 3
}
death
{
wm_addteamvoiceannounce 0 "lostchildren_obj1_des"
wm_addteamvoiceannounce 1 "lostchildren_obj1_des"
trigger game_manager obj1_des
}
}
Related Entity:
So.. what did I omit at that script? Where is a problem?
Thnaks for any ideas
If you don't do it, someone else will.
The first three frames thing would mean that those fields are read from the bsp when the map is loaded, they're used then aren't looked at again.Father wrote:Thaks, but it still don't work..
I read: #955 - some trigger_objective_info fields cannot be modified from mapscript. We now allow trigger_objective_info fields to be changed in mapscript spawn section. Some (spawnflags, customimage, score, target, track, message) must be changed in the first frame, or first 3 frames. --> what does it mean for me?
Your script waits 50 (frames I think) then sets the value. So your new value will not have been set when the game first loads that entity. And the game doesn't check that particular field once it is loaded. You could try it without the wait 50.
With the idea of removing the entity and making it again, as in your previous post, I think you can also remove entities by their origin. So if you were having problems there with deleting it since it doesnt have a script name, that may help.
- mortis
- Posts: 360
- Joined: Tue Jul 06, 2004 11:57 pm
- Location: at the center of the e-universe
- Contact:
Give the man a cookie!Dersaidin wrote:The first three frames thing would mean that those fields are read from the bsp when the map is loaded, they're used then aren't looked at again.Father wrote:Thaks, but it still don't work..
I read: #955 - some trigger_objective_info fields cannot be modified from mapscript. We now allow trigger_objective_info fields to be changed in mapscript spawn section. Some (spawnflags, customimage, score, target, track, message) must be changed in the first frame, or first 3 frames. --> what does it mean for me?
Your script waits 50 (frames I think) then sets the value. So your new value will not have been set when the game first loads that entity. And the game doesn't check that particular field once it is loaded. You could try it without the wait 50.
With the idea of removing the entity and making it again, as in your previous post, I think you can also remove entities by their origin. So if you were having problems there with deleting it since it doesnt have a script name, that may help.
And keep in mind that the game doesn't always accept all changed values. Try removing the offending entity and replacing it with another that has the desired values, if all else fails. Note that this may change any script-dependent routines, as well.
mortis wrote:Try creating a new TOI and make set the old TOI to invisible. Connect the script block to your new TOI.
Code: Select all
setstate barrier1 invisible
TOI without 'scripname' is evil..
If you don't do it, someone else will.