UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Easter Egg misc_model delete

broken avatar :(
Created 11 years ago
by Deer2014
0 Members and 1 Guest are viewing this topic.
2,449 views
broken avatar :(
×
broken avatar :(
Location: hu
Date Registered: 20 July 2014
Last active: 6 months ago
Posts
89
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
Deer2014's Groups
Deer2014's Contact & Social Links
Hi guys,

I would like to ask for help. I have an EE (Find the key to the locked door).
In the Radiant I have

a misc_model KVP's:
Code Snippet
Plaintext
target = key_trig
classname = misc_model
model = zombie_old_key  <- this is a custom model, not a Treyarch retail
targetname = key_model
a trigger_use KVP's:
Code Snippet
Plaintext
targetname = key_trig
classname = trigger_use
a script_brushmodel KVP's:
Code Snippet
Plaintext
targetname = mydoor
classname = script_brushmodel
and a trigger_use KVP's:
Code Snippet
Plaintext
targetname = mydoortrigger
target mydoor
classname = trigger_use
Here is the script that I use:
Code Snippet
Plaintext
	maps\_zombiemode::main();

flag_init("myflagname");
thread key_req_door();
thread key();
Code Snippet
Plaintext
key_req_door()
{
mydoortrig = getEnt("mydoortrigger","targetname");
mydoor = getEnt("mydoor","targetname");
mydoortrig SetCursorHint( "HINT_NOICON" );
mydoortrig SetHintString( "You need the key first!" );
flag_wait( "myflagname" );
mydoortrig SetHintString( "Press &&1 to Unlock door." );
mydoortrig waittill("trigger");
mydoortrig delete();
mydoor delete();

}
Code Snippet
Plaintext
key()
{
key_model = getEnt("key_model","targetname");
key_trigger = getEnt("key_trig","targetname");
key_trigger SetCursorHint( "HINT_NOICON" );
key_trigger SetHintString( "Press &&1 To take the key." );
key_trigger waittill( "trigger", myplayer);
flag_set( "myflagname" );
key_trigger delete();
key_model delete();

}
My problem is:
When I take the key (I can open the door), the key misc_model does not disappear in my map (is not deleted)...  :'(
What's wrong? Can someone help me?
Last Edit: July 19, 2015, 04:15:52 pm by Deer2014
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 3 years ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
http://ugx-mods.com/forum/index.php/topic,7268.0.html

Try to get a better understanding of triggers in there.
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 15 September 2013
Last active: 6 years ago
Posts
50
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
GAM3VIDZ's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
GAM3VIDZ's Contact & Social LinksGAM3VIDZGAM3VIDZMy Website
Looking at your code you should change

Code Snippet
Plaintext
key_trigger waittill( "trigger", myplayer);
and change it to
Code Snippet
Plaintext
key_trigger waittill( "trigger", player);
I believe that should fix your issue.
Marked as best answer by Deer2014 11 years ago
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 22 September 2013
Last active: 6 months ago
Posts
326
Respect
Forum Rank
Perk Hacker
Primary Group
Mapper
My Groups
More
Personal Quote
Zombie Mapper and Gamer
Signature
My Custom Zombie Maps:

- Nazi zombie Legion
- City of Hell
- The Abandoned Mine
- The Last Undead House (Finished)

more custom zombie maps coming soon
×
gamer9294's Groups
Mapper Has released one or more maps to the UGX-Mods community.
gamer9294's Contact & Social Links
Quote
My problem is:
When I take the key (I can open the door), the key misc_model does not disappear in my map (is not deleted)...  :'(
What's wrong? Can someone help me?


because you use a  "misc_model"  instead of a "script_model" :)


if you want to do something with models then you need all times using a script_model.   NOT a misc_model.


I hope that this will help you out of the problem :)


best regards,
Gamer9294
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
Looking at your code you should change

Code Snippet
Plaintext
key_trigger waittill( "trigger", myplayer);
and change it to
Code Snippet
Plaintext
key_trigger waittill( "trigger", player);
I believe that should fix your issue.
Irrelevent, that field is entirely unnecesary as myplayer / player is mever referenced, all that argument is, is what you want the user to be defined as, so you can reference that user later

Gamer9294 is correct, misc models cant be referenced by script, you can only access "script_" entities for obvious reasons
broken avatar :(
×
broken avatar :(
OnionmanVere Bo21
Location: ieu dnt wnt 2 no
Date Registered: 27 September 2013
Last active: 4 months ago
Posts
1,863
Respect
Forum Rank
Zombie Destroyer
Primary Group
Mapper
My Groups
More
Personal Quote
ok
Signature
Aye mate you don't know me so y don't you shut tf up ok buddy :)

×
Scobalula's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Scobalula's Contact & Social Links
As my favorite part of the scripting guide on the wiki states:

Quote
To acquire any ent, it MUST BE SET AS A SCRIPT_MODEL (XMODEL) OR SCRIPT_BRUSHMODEL (BRUSH) IN ORDER TO BE SEEN BY SCRIPT. Read that sentence like 5 times. Maybe 10. Seriously. It's REALLY important that you understand that and that you don't forget it.

And as stated above, they need to be script_ to be acquired by script. :P
Last Edit: July 19, 2015, 08:18:32 pm by Scobalula
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 15 September 2013
Last active: 6 years ago
Posts
50
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
GAM3VIDZ's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
GAM3VIDZ's Contact & Social LinksGAM3VIDZGAM3VIDZMy Website
Irrelevent, that field is entirely unnecesary as myplayer / player is mever referenced, all that argument is, is what you want the user to be defined as, so you can reference that user later

Gamer9294 is correct, misc models cant be referenced by script, you can only access "script_" entities for obvious reasons

Yea I noticed that and was going to write that but I figured I'd wait till my first post got approved before I wrote another one haha But thank you for the lesson :)

 
Loading ...