Page 1 of 1

delete a spawned model in map

Posted: Sat Mar 24, 2007 7:58 pm
by Altusi
Hello,

I just want to know what is the command in a script for delete a model (a model that i spawn in the script). Example:
The map is launch, and after 5 sec a model is spawn on the map.
-->

Code: Select all

main:
wait 5
 local.panzer = spawn models/human/allied_oss_man_m1.tik
 local.panzer.origin = ( -1886 -65 271 )
 local.panzer.angle = 272
 local.panzer solid
 local.panzer immune bullet
 local.panzer immune fast_bullet
 local.panzer immune bash
 local.panzer immune mg
 local.panzer immune explosion
 local.panzer nodamage
...
I want to delete it after some times (i will add some wait command after). So what is the command that i have to write on my script for delete/remove (or hide if i have no choice) it.
Thanks

Al

ps: sorry if my english is not correct :(

Posted: Sat Mar 24, 2007 8:29 pm
by jv_map
Normally I don't pick the easy ones :P , but:

local.panzer delete

would do :)

Posted: Sat Mar 24, 2007 8:51 pm
by Altusi
jv_map wrote:Normally I don't pick the easy ones :P , but:

local.panzer delete

would do :)
Oh! I put this in my script and it doesn't work! I don't see the model.
I put the delete command like this:

Code: Select all

main:
wait 5
 local.panzer = spawn models/static/allied_oss_man_m1.tik
 local.panzer.origin = ( -82.91 201.41 -43.35 )
 local.panzer.angle = 272
 local.panzer solid
 local.panzer immune bullet
 local.panzer immune fast_bullet
 local.panzer immune bash
 local.panzer immune mg
 local.panzer immune explosion
 local.panzer nodamage
wait 15
 local.panzer delete
...
Why he doesn't work for me? Is my script correct?

Posted: Sat Mar 24, 2007 9:41 pm
by jv_map
Your script looks good.
Altusi wrote:I don't see the model.
Do you see it without the delete line?

Posted: Sun Mar 25, 2007 5:21 pm
by Altusi
hmm, it work today! Something strange!
But now it work, thank you!

I think about something, i try to spawn a model on my map (original moh model, like models/static/flowerpainting.tik) and i don't spawn at the good co-ordinates. Is it possible that some model (like model/static) can't be spawn at co-ordinates by the script? Because i try to spawn a human model, and it's work; after that i try with an other (model/static) and it don't spawn at the same co-ordinates. I am sure to have not modified another thing in the script. I don't understand.
If someone can my light... :D



Ps: sorry for my questions, i never script and i try to understand how it work. And be reassured, i checked the tuto before ask question.