Page 1 of 1

[mapscripts] Changing values and keys at existing entities

Posted: Wed Mar 05, 2008 10:40 am
by Father
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 Image 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

Posted: Wed Mar 05, 2008 3:51 pm
by ReyalP
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.

Posted: Tue Mar 18, 2008 8:01 pm
by Father
Thaks, but it still don't work.. :oops:

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	
	}
}
If I add 'set' command + change 'track' and 'shortname' - it don't work -->

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	
	}
}
I tried add (before 'set') 'wait' 50, 100, 150, 200 - nothing helped.

Related Entity:
Image

So.. what did I omit at that script? Where is a problem?

Thnaks for any ideas

Posted: Wed Mar 19, 2008 4:26 am
by Dersaidin
Father wrote:Thaks, but it still don't work.. :oops:

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?
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.

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.

Posted: Wed Mar 19, 2008 5:59 pm
by mortis
Dersaidin wrote:
Father wrote:Thaks, but it still don't work.. :oops:

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?
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.

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.
Give the man a cookie!

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.

Posted: Sat Apr 05, 2008 3:55 am
by Father
Moving or removing that TOI don't work - I tried everything what you mentiond above.. and nothing works. :?

Posted: Sat Apr 05, 2008 8:59 am
by mortis
Try creating a new TOI and make set the old TOI to invisible. Connect the script block to your new TOI.

Posted: Sat Apr 05, 2008 6:28 pm
by Father
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
don't work too.

TOI without 'scripname' is evil.. :(

Posted: Mon Apr 07, 2008 9:56 am
by mortis
Have you tried removing the entity by using its origin (aka xyz coordinates)?

Posted: Mon Apr 07, 2008 8:24 pm
by Father
mortis wrote:Have you tried removing the entity by using its origin (aka xyz coordinates)?
Yes, it don't work too. :?

Posted: Tue Apr 08, 2008 9:25 am
by mortis
I don't know what to suggest to you at this point. I have found that some entities simply cannot be removed by any method. Maybe that is what is happening in this case.